Page 1 of 1

(done) Exvar feature questions

Posted: Wed Mar 14, 2007 6:27 pm
by Joramun
1) Is it possible to document exvars, because that's the only thing you cannot guess by looking at dsb's code !

2)

When an item has exvar[the_item] = { opby = "key_ra" }

Is it possible to have : exvar[the_item] = { opby = { "key_ra", "key_gold" } }

so that one item is able to interact with several item types ?

I assumed so for RTSB. (because the feature already exists for :

exvar [tmp] = { target = { item1, item2 } }

even if it's not exactly the same ( because opby name an item_type, while target just targets a particular item in the dungeon )

and it's much more practical )

Re: Exvar feature questions

Posted: Wed Mar 14, 2007 8:13 pm
by Sophia
Joramund wrote:1) Is it possible to document exvars, because that's the only thing you cannot guess by looking at dsb's code !
What do you mean? I agree with you that more documentation is probably a good idea, but anything that uses exvars makes reference to them in the code...
Joramund wrote:Is it possible to have : exvar[the_item] = { opby = { "key_ra", "key_gold" } }
No, this isn't possible.
Joramund wrote:(because the feature already exists for :
exvar [tmp] = { target = { item1, item2 } }
Already exists? Huh?
This isn't possible either.

The real problem is that exvars, currently, must be "flat." That is, they can store integers, strings, and whatnot, but tables inside of exvars are currently not saved in dungeon.dsb. I didn't really feel like getting into the potential for infinite recursion and the like. ;)

Posted: Wed Mar 14, 2007 8:35 pm
by Joramun
ah sorry we had a misunderstanding on flashchat ...

if 2) is not possible then I will have major problems for multiple targets...

How can i circumvent that ?

EDIT : but if this can still be added, i'd say hurray !

Posted: Wed Mar 14, 2007 11:09 pm
by Sophia
Joramund wrote:EDIT : but if this can still be added, i'd say hurray !
Ok, this is all done for 0.8. I don't think allowing simple nested tables like exvar[x] = { target = { a, b, c } } will hurt my sanity too much.

Named elements inside of exvar tables like exvar[x] = { something = { test = 1, stuff = 2 } }, etc. are still not allowed.

Multi-targeted switches etc. can now be done the way you said.
I also allowed multiple opbys because it wasn't that much trouble now that exvars have been expanded in this way, so even though I don't think the conversion from RTC will require it, that can be done now too.

Posted: Wed Mar 14, 2007 11:46 pm
by Joramun
HURRAY !!