 |
Zzzer Newbie
Joined: 04 Nov 2006 Posts: 3
|
Posted: 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 |
|
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: 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.
|
|
|
|
 |
Zzzer Newbie
Joined: 04 Nov 2006 Posts: 3
|
Posted: 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}} |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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} |
|
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
 |
|
|
|