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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Zzzer
Newbie


Joined: 04 Nov 2006
Posts: 3

PostPosted: Wed May 30, 2007 10:45 am   

[1.33] #alarm
 
Hi

#trig {^You surround (*) with a telekinetic shield of force.$} {#ALARM {+416} {#SAY %ansi(green)Force Shield on %1 is going down in 4 seconds}}
This trigger used to work in Zmud but not working in Cmud, it seems that the value of %1 isnt stored in the Alarm trigger.
When the trigger fires it shows Force Shield on is going down in 4 seconds
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Wed May 30, 2007 11:22 am   
 
Does it work if you add {} around the text in the #SAY? The brackets should cause proper expansion of the expression and store the value rather than the %1 itself.
Reply with quote
Zzzer
Newbie


Joined: 04 Nov 2006
Posts: 3

PostPosted: Wed May 30, 2007 11:29 am   
 
Tested it with or without say. It didnt matter, I also noticed this alias not working (same error value of %1 not being used)
#al check-chest {unlock %-1;#ALARM {+12} {open %-1;look at %-1;close %-1}}
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed May 30, 2007 4:02 pm   
 
Yes, this behaviour has changed. You need to use a local variable:

$params = %-1
unlock $params
#alarm {+12} {open $params;look at $params;close $params}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Wed May 30, 2007 4:16 pm   
 
This may or may not be a bug, I'll let Zugg make that call. The %1 seems not be working because of scoping. The %1 will assume the scope of the alarm, which by the time it gets executed doesn't have a value for %1 and nothing seems to force it to resolve.

However if you made this slight modification, then it works.

Code:
#trig {^You surround (*) with a telekinetic shield of force.$} {$Temp=%1;#ALARM {+416} {#SAY %ansi(green)Force Shield on $Temp is going down in 4 seconds}}


The fact this works says that the value is resolved before the alarm gets created.

Is it a bug or not? Hard to say, you can make arguments either way, so as I mentioned before Zugg will have to have the final say.

[Edit]I guess Fang confirms that this is not a bug and expected behavior.
_________________
Asati di tempari!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed May 30, 2007 5:22 pm   
 
I'm pretty sure it is. And with the trigger you have there, you could change the (*) wildcard to ($Temp:*) and avoid having to set the variable manually.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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