In order to save writing the same thing out at least 9 times, I searched for a proc that might help. But I was wrong.
I have 9 'Bounty' variables attached to mobs, one for each of the 9 'villages' that players can be from.
So basically, I want to call it like this:
src.(M.Village)Bounty+=100
And if M.Village was "Leaf" the above line would read:
src.LeafHitList+=100
I tried using text2path for this but no luck. :\
ID:272019
![]() Feb 25 2008, 12:50 am
|
|
![]() Feb 25 2008, 6:49 am
|
|
You can't access variables that way. What you're looking for is the <code>vars</code> list:
|
Nuts!
I mistyped it in my attempts to make the code as universal as possible. What I meant to say was this: src.(M.Village)Bounty+=100 And if M.Village was "Leaf" the above line would read: src.LeafBounty+=100 But I think that answers my question anyway. Thanks. |
Oooh. Run into a new problem.
Same question again, but relating to plain ol' var, as opposed to mob/var or obj/var... mob/proc/VillageBB_Kill(mob/victim) |
Saucepan Man wrote:
Oooh. Run into a new problem. That's because you aren't setting the list to be equal to anything but a text string. You probably want var/list/H = src.vars["[victim.Village]List"] If it's not an src variable but rather a global variable, I don't believe the language has any syntax which would allow you to access it like this. You should find a way to encapsulate it in an object of some kind in that case. |