Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Sunnfire
Newbie


Joined: 15 Sep 2005
Posts: 5
Location: CT

PostPosted: Thu Dec 18, 2008 4:40 pm   

Variable within a variable?
 
So. I don't know if I can do this or not, and reading through the help files I could not tell.

Here is what I want to do.

I have a trigger that save the current character name to a variable. (@name)
I have a script that I want to then use that variable to call another variable.

The name of the variable I want to call is @bob_armor

So is there a way for me to have the script take the @name variable, and append it to _armor and then use that.

So that I can have a script that just does,

@(@name)_armor


I hope I explained that well enough to show what I am getting at.
Reply with quote
calesta
Apprentice


Joined: 07 Dec 2008
Posts: 102
Location: New Hampshire, USA

PostPosted: Thu Dec 18, 2008 4:56 pm   
 
Code:
name = bob
bob_armor = helmet
#show Var: @{@{name}_armor}


Is that what you are looking for?
Reply with quote
Sunnfire
Newbie


Joined: 15 Sep 2005
Posts: 5
Location: CT

PostPosted: Thu Dec 18, 2008 5:20 pm   
 
Indeed.

That works perfect. Thank you.

I didn't think separating the @ sign would work.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net