|
Bobert Beginner
Joined: 01 Apr 2004 Posts: 20 Location: Purdue University
|
Posted: 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. |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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}} |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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} |
|
|
|
Bobert Beginner
Joined: 01 Apr 2004 Posts: 20 Location: Purdue University
|
Posted: Thu Apr 01, 2004 4:53 am |
Thankyou very much!
Its nice having fast and accurate tech support. |
|
|
|
|
|