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
forren
Novice


Joined: 26 Apr 2007
Posts: 44

PostPosted: Mon Jun 11, 2007 1:27 am   

Wildcard references with {x1|x2}
 
Alright, so I have this trigger:

^Your hearing sharpens as your {left|right} ear regenerates.

$aff = %concat(severed, %1, ear)
#SAY $aff
#SAY %1
preRemoveAffliction $aff

When I put this into practice, %1 turns out to be a null value, and as such, $aff becomes "severedear". The only way I can get this to work correctly is by using (%w) instead of {left|right}. Is this a bug, or do I need to do this instead of specifically referencing left/right if I want to store the value?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Jun 11, 2007 1:36 am   
 
At ALL times, whenever you want to capture data into a %1...%99 sort of variable you need to use either the direct variable assignment operator (&varname) or surround the wildcard component with parentheses.

^Your hearing sharpens as your ({left|right}) ear regenerates.
_________________
EDIT: I didn't like my old signature
Reply with quote
forren
Novice


Joined: 26 Apr 2007
Posts: 44

PostPosted: Mon Jun 11, 2007 1:37 am   
 
Ah, that was my issue. Fixed it. Thanks!
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