(done) Moving conditions to a table

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.
Post Reply
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

(done) Moving conditions to a table

Post by Sophia »

I've been considering adding a conditions table to DSB that would work similar to obj, which would remove a lot of the arcane weirdness that you can run into by having to use condition id's and dsb_add_condition and such. However, this is very likely a breaking change.

Any thoughts?
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Moving conditions to a table

Post by Gambit37 »

To be honest I haven't done enough with them yet to be able to offer any coherent thoughts on the matter. :)
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Moving conditions to a table

Post by Sophia »

It shouldn't be that hard to make the new system use dsb_add_condition under the hood, which means old dungeons will probably still work, so I'm going to go ahead with it. This is how it will be for 0.72.

The table approach does feel a lot more intuitive.
For example:

Code: Select all

conditions.poison = {
	scope = INDIVIDUAL,
	update_rate = 24,
	update_func = poison_func,
	subrenderer_image = gfx.poisoned,

	mouth_show = true,
	green = false,
}
Gambit, this also means that as of 0.72 your dungeon will suddenly stop working because of those dsb_replace_condition calls you needed to use. They won't be necessary any more, so just remove them and everything will work fine again. :mrgreen:
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: (done) Moving conditions to a table

Post by Gambit37 »

Great, that does look much simpler, thank you :)
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: (done) Moving conditions to a table

Post by Sophia »

Updated the wiki with the new information! Which won't actually be relevant until 0.72 is out, but that will be soon, hopefully.
Post Reply