For example:
Code: Select all
dsb_bitmap_textout(bmp, sys_font, "HELLO THERE", 0, 0, LEFT, {255, 255, 255})
Moderator: Sophia
Code: Select all
dsb_bitmap_textout(bmp, sys_font, "HELLO THERE", 0, 0, LEFT, {255, 255, 255})
Yes. In hand-coded files, it's expected that you want DSB to manage the character and inst id numbers and you use symbolic labels. However, ESB already manages the numbers for you, so for ESB output, it's simpler to just explicitly use the numbers ESB is already using than to create some weird (and potentially buggy) infrastructure to translate from ESB id numbers to symbolic labels, which DSB will then just turn back into id numbers when it compiles the dungeon.Gambit37 wrote:OK, thanks. I found something else: in the Wiki, the description of dsb_add_champion doesn't seem to match what's generated in the dungeon.lua file? Parameters are slightly different?
I don't understand the question. If you mean how to how to get a character's portrait in code, there isn't a command for it at the moment, but I will add one.Gambit37 wrote:Also, what's the right way to get the portrait value for a given champion ID? That is, what's the nature of the champions table array and how can I access it?
Code: Select all
dsb_write(player_colors[1], "THIS WILL BE IN GREEN (OR WHATEVER)")
Code: Select all
function random_valid_party_member()
local sel
local ppos = dsb_rand(0, 3)
local tries = 0
repeat
ppos = (ppos + 1) % 4
sel = dsb_ppos_char(ppos)
tries = tries + 1
if (tries > 4) then
return nil
end
until (valid_and_alive(sel))
return ppos, sel
end
As I stated in another thread, it's not currently possible, but it will be included in DSB 0.53. I'll add the ability to move the "item currently held" indicator to the list of things to do.Gambit37 wrote:is it possible to move the location of the "item currently in mouse cursor" text? You know, the name of picked up items that appears above the magic runes? I've had some thoughts about changing the magic system and would need a bit more space in the interface to do it... similarly, can I move the attack buttons and arrow controls?
There isn't a flag, as such, but the way you'd do it is by setting the monster to use an AI function that was the same as the one monsters use when they are at distance or on a different level... which causes them to just wander around basically randomly.Gambit37 wrote:is there a flag to set monsters as passive? I couldn't find one in the base objects.lua? If not, how would you make a monster that doesn't track or attack the party, but just wanders around randomly?
Code: Select all
obj.passive_monster.ai_near = function (id, sight)
return random_move(id, false, nil)
end
The wallitem graphics that will be displayed will make it obvious there's something to see. But I only want the text to be written ontop of the wallitem at that first position.beowuuf wrote:Why don't you want the visual clue there's something to see there?
Code: Select all
C_MYCONDITION = dsb_add_condition(PARTY, nil, gfx.overlay_graphic, 0, nil)
Code: Select all
-- Activates it
dsb_set_condition(PARTY, C_MYCONDITION, 1)
-- Deactivates it
dsb_set_condition(PARTY, C_MYCONDITION, 0)
Code: Select all
dsb_export("my_global_data")
my_global_data = {
thing1 = 4,
thing2 = "some stuff",
-- etc etc
}
As long as you've added the dsb_export command to your startup.lua (or one of the linked files from lua_manifest) it will automatically save whatever you want to export every time you save.Gambit37 wrote:So the command just sets up an automatic save of the variables, I don't need to write anything special to make it work on every save?
Those can't be moved around. (At least not yet!)Gambit37 wrote:Another question: How do I move the position of the character's name, the three main stats and the load value that's rendered in the inventory? Can't seem to find that in any of the new GUI positioning code?
Oooh, does this mean that eventually I can? I'm tinkering with a new layout for the inventory, and I've come up with something quite nice, but would need to be able to move those bits too...Sophia wrote:Those can't be moved around. (At least not yet!)
You're correct, the core engine draws condition graphics, which is what poisoning is. However, it is modifiable: the position of this graphic within the subrenderer is set by its x_off and y_off values. Look in base/graphics.lua.Gambit37 wrote:I can't find how to move the "Poisoned" graphic within the default subrenderer. Looks like a lot of this stuff is not in the base code, but in the core engine? Is it modifiable?