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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
tbone235
Apprentice


Joined: 02 Nov 2002
Posts: 107
Location: Australia

PostPosted: Sat Feb 01, 2003 3:04 am   

Saving a variable
 
Ok, I'm making a spellup script and i have a list that is generated with all my spells that i can cast in it, but when i shut down zmud it clears the list... how can i stop it from doing this so it always holds my spellup list?

thanks
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Feb 01, 2003 4:43 am   
 
Uncheck the "Use Default Value" for that variable
Reply with quote
tbone235
Apprentice


Joined: 02 Nov 2002
Posts: 107
Location: Australia

PostPosted: Sat Feb 01, 2003 9:03 am   
 
ok, so how can i write that into my script so that it doesn't use default value, IE, if i give this script to other ppl how can i make it so that they dont have to touch the variables
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Feb 01, 2003 1:21 pm   
 
Don't give the variable a default value when creating it. This is the syntax for #VAR:
#VAR name value default class

As you can see, if you specify only the first two arguments, then no default value is used. It might not always be clear when you are specifying a third argument since somethign matched with a trigger and contained in %1, for example, might contain spaces in it which would put the second word as the default value. So, as a general rule, enclose these arguments in curly braces:
#VAR myVar {%1}

However, if you need to specify a class for the variable being created, leaving the default value blank will just give the variable a default value of an empty string, which is not what you want. For that, you sue the special _nodef value:
#VAR myVar {This is the value} _nodef myClass

Kjata
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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