ID:149468
 
I am almost posotive I had already posted about this, but I couldn't find it so here goes:

I know global can be used to create a var in the middle of the game (var/global/ME), and the var will stay permanent. But is there any way to create one for a player? This must be done at run time, the name can vary, value can vary, and each mob can have the same var, with a different value.


Man I need help. I've been pondering really really hard for a week.
Hmm... I'm not sure what you are trying to do... by try using a list for this...

A simple example might be....


mob
data[0]
New()
data = list(health=10) // set starting vars
verb/becomewizard()
data += list(mana=null) // Add a 'mana' item at runtime.
data[mana] = 5
src << "You are now a wizard!"
verb/spell()
if("mana" in data)
if(data[mana]>0)
src << "You cast a fancy spell"
data[mana]--
else
src << "No mana"
else
src << "You are not a wizard!"