(done) Exvar feature questions

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
Joramun
Mon Master
Posts: 925
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

(done) Exvar feature questions

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

Re: Exvar feature questions

Post 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. ;)
User avatar
Joramun
Mon Master
Posts: 925
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

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

Post 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.
User avatar
Joramun
Mon Master
Posts: 925
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Post by Joramun »

HURRAY !!
What Is Your Quest ?
Post Reply