|
sseibert1 Newbie
Joined: 03 Jan 2008 Posts: 1
|
Posted: Fri Jan 04, 2008 12:42 am
Trigger Question |
I am trying to set up a trigger to make the character functional during periods of being away so as not to hold up the group...I am new to CMUD and am very rusty in programming of any sort, but am trying to get the syntaxes correct. I am using the Profile editor to make the triggers and such...
I have the following variables set up : tank, fighting, target, assist_action_1, and assist_action_2
Pattern is : @tank {cleaves|crushes|demolishes|hits|massacres|misses|obliterates|pierces|pounds|pulverizes|slashes|smashes|smites|stabs|stings|stuns|whips} (*)
Action is : %IF (@fighting=0, @fighting=1;@target=%2;backstab @target, @assist_action_1;@assist_action_2)
I would like the (*) in the pattern to let me utilize one word (typically the second one) to set as the target to use in the assist_action variables
I can get the trigger to fire, but it won't compile...
There would be a second trigger to set the fighting variable back to 0 when fight was over. |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Fri Jan 04, 2008 1:07 am |
So you would want
'TheTank cleaves big ogre.'
To capture 'big ogre', then extract 'ogre' from that as the 2nd word?
Try...
Code: |
#TR {@tank {cleaves|crushes|demolishes|hits|massacres|misses|obliterates|pierces|pounds|pulverizes|slashes|smashes|smites|stabs|stings|stuns|whips} (*)} {#IF (!@fighting) {
fighting=1
#IF (%numwords( %1) > 1) {target = %word( %1, 2)} {target = %1}
backstab @target, @assist_action_1
@assist_action_2
}
} |
The nested #IF is incase the (*) only matches 1 word |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Fri Jan 04, 2008 1:10 am |
The problem was with the IF statement syntax. You should be using
#IF (test) {then do this} {else do this}
Also, when assigning variables then don't use
@target=%2
or
@fighting=1
Instead use
variable = value
leaving out the @
The first one was bad syntax that zMUD allowed when it really shouldn't have. CMUD is more strict |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
|
|
|
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
|
|