Nick's BIG DSB thread and Dungeon Re-Master

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Nick's BIG DSB thread and Dungeon Re-Master

Post by Sophia »

Automaton wrote: Mon Sep 28, 2020 11:31 amI understand how dsb_bitmap_draw and dsb_bitmap_textout work, but the destination value being passed "bmp" I can't work out how to make this be the affected character.

TLDR How do I make an equivalent "dsb_heal_popup"?
As kaypy explained, you can't really do that directly. The actual popup is handled by the system and the hooks aren't really exposed to you. However, what I can do (that will basically do the same thing) is make it so the game is not quite so hardcoded with health, stamina, and mana damage types. I'll look into adding an interface for you to create a "damage type" that represents healing (or whatever) and have dsb_damage_popup display it for you.
Automaton wrote: Mon Sep 28, 2020 1:12 pmI think I may be doing new conditions wrong (as in I recreated the table with all the old entries and added my own)
Right, you shouldn't do that. Just add your new entry to the table instead. (A brief explanation of how to add to a Lua table instead of replacing it is here: viewtopic.php?p=123399 )
User avatar
Automaton
Journeyman
Posts: 88
Joined: Sat Aug 28, 2004 10:49 am

Re: Nick's BIG DSB thread and Dungeon Re-Master

Post by Automaton »

Sophia wrote: Mon Sep 28, 2020 10:44 pm Right, you shouldn't do that. Just add your new entry to the table instead. (A brief explanation of how to add to a Lua table instead of replacing it is here: viewtopic.php?p=123399 )
Sounds ok in principle, but I just ran into a problem I saw that you and gambit already discussed - If you are replacing graphics, you have to reassert the conditions anyhow and as I am replacing all the GFX, I'd have to reassert everything anyhow. Is/are there technical reasons while you should not replace the entire table in your own custom lua? It seems simpler this way than to reassert everything.

Cheers,
Nick K.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Nick's BIG DSB thread and Dungeon Re-Master

Post by Sophia »

You won't have to reassert the graphics if you use a graphics.cfg rather than pushing your new entries into gfx by hand. Since you're just doing a 1:1 replacement in this case you won't run into the same problems as you did with potions.

Anyway, the problem in general with just replacing tables rather than adding to them is that it isn't future-proof (if I add something to the base table in a later version, your code won't have it) and it obliterates anything that the base code automatically adds to the table, for example adding functions to potions after they've been declared, which you also ran into.

In this particular case, it should probably work, so if it's really going to be a whole lot easier, go ahead and try it... but if you get strange errors related to conditions that's going to be the first thing I blame. :mrgreen:
Post Reply