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
Bobert
Beginner


Joined: 01 Apr 2004
Posts: 20
Location: Purdue University

PostPosted: Thu Apr 01, 2004 4:08 am   

Trouble saving IF statements
 
I have trouble saving IF statments in my classes. They don't even import from a .txt file.
For example:
#CLASS {FFA|Herbs}
#VAR herbal {1}
#VAR gold {0}
#IF (@gold=1 and @herbal=1) {command}
#TRIGGER {you eat...} {gold=0; herbal=0}
#TRIGGER {you may...} {herbal=1}
#TRIGGER {you are...} {gold=1}
#CLASS 0

will save as:
#CLASS {FFA|Herbs}
#VAR herbal {1}
#VAR gold {0}
#TRIGGER {you eat...} {gold=0; herbal=0}
#TRIGGER {you may...} {herbal=1}
#TRIGGER {you are...} {gold=1}
#CLASS 0

I have also tried nesting the IF statements such as:
#IF @herbal=1 {#IF @gold=1 {command}}

but the same thing happens

If anyone could help me understand why zMUD 7.04 is doing this and how to fix it I would really appreciate it.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Apr 01, 2004 4:17 am   
 
Because your using your IF statements wrong!

They have to be called by an alias/trigger etc

#TRIGGER {you may...} {herbal=1;#IF (@herbal=1 AND @gold=1) {then do this}}
#TRIGGER {you are...} {gold=1;#IF (@herbal=1 AND @gold=1) {then do this}}
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Apr 01, 2004 4:25 am   
 
Alternativly like you can use an expression trigger in place of an if statement note the ()'s used for the pattern and NOT {}

#TRIGGER (@herbal=1 AND @gold=1) {herbal=0;gold=0;commands here}
Reply with quote
Bobert
Beginner


Joined: 01 Apr 2004
Posts: 20
Location: Purdue University

PostPosted: Thu Apr 01, 2004 4:53 am   
 
Thankyou very much!

Its nice having fast and accurate tech support.
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