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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
nazradin
Apprentice


Joined: 23 Mar 2003
Posts: 114
Location: New Zealand

PostPosted: Sun May 16, 2004 11:45 am   

trigger question
 

I am having trouble with a stancing trigger

You attempt to kick a bog wight!
Roundtime changed to 2 seconds.
MB: 241 vs MB: 102 = 139 -- Gain advantage!
Quick move! Gained great position.
THT 63, d100 roll: 97, modified: 236
and hits for 57 points of damage!
... +10 extra hits. Flying kick to body knocks foe down.
Foe is stunned and loses parry.
Roundtime: 4 sec.


trigger is

#BUTTON 17 {volnkick} {
#if (@currentstance > 0) {stance offensive}
kick @thatone @monster
#TEMP {Round* (%d) sec} {
#ALA RT +%%1 {
stance defensive
look
}
}


the roundtime trigger can be Roundtime or Round time

and i dont always use haste so can be

Roundtime changed to (%d) seconds.
Roundtime (%d) sec

any ideas it looks right to me


nazradin
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun May 16, 2004 8:18 pm   
 
Count braces {}. You open more than you close.
Reply with quote
nazradin
Apprentice


Joined: 23 Mar 2003
Posts: 114
Location: New Zealand

PostPosted: Mon May 17, 2004 3:45 pm   
 
quote:
Originally posted by LightBulb

Count braces {}. You open more than you close.




sorry that was a cut and paste miss, there is another braces there copy missed it. so thats not the error

Naz
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon May 17, 2004 5:18 pm   
 
The button works with the missing brace added. What is the problem?

That is, what is happening which you think shouldn't happen,
or not happening which you think should happen,
or happening different from what you want.

You probably think you already said, but I can't find it. I also can't find the pattern of your trigger or figure out why you would want this #BUTTON command in a trigger.

At a guess, you just want to change the alarm time.
#TR {Roundtime: (%d) sec.} {#CALL %alarm( RT, %eval( %1 * 1000))}
Reply with quote
nazradin
Apprentice


Joined: 23 Mar 2003
Posts: 114
Location: New Zealand

PostPosted: Tue May 18, 2004 7:33 am   
 
quote:
Originally posted by LightBulb

The button works with the missing brace added. What is the problem?

That is, what is happening which you think shouldn't happen,
or not happening which you think should happen,
or happening different from what you want.

You probably think you already said, but I can't find it. I also can't find the pattern of your trigger or figure out why you would want this #BUTTON command in a trigger.

At a guess, you just want to change the alarm time.
#TR {Roundtime: (%d) sec.} {#CALL %alarm( RT, %eval( %1 * 1000))}



sorry i did indeed think that i had posted what my exact problem is rather than look at this and work it out

a: the script is from a button is the only reason #button is there I should have not included it in 1st case as it is irrelevant.

relevant portion being

#if (@currentstance > 0) {stance offensive}
kill @thatone @monster
#gag stam
#TEMP {Round*time: (%d) sec} {
#ALA RT +%%1 {
stance defensive
look
}
}

b: the part i am having trouble with is the temp trigger does not seem to be firing as after attacking "kill @thatone @monster", It does not stance nor attempt to as when i remove the #alarm and change trigger to

#TEMP {Round*time: (%d) sec} {
stance defensive
look
}

> kill first lion
You swing a drakar-spiked eonake morning star at a plains lion!
AS: +97 vs DS: +60 with AvD: +34 + d100 roll: +100 = +171 Advantage 71
... and hit for 28 points of damage!
Blow leaves an imprint on the plains lion's chest!
crush rank 1 chest damage 5
Roundtime: 5 sec.
stance defensive
look
A plains lion roars loudly as he stands up!
>
...wait 2 seconds.


so yes i do think that the alarm is the problem but i am not sure why

RT is definded in another class

#CLASS {Gauges|Roundtime}
#TRIGGER "rtTrig" {Q} {#VAR roundTime {%gsl( Q)}} "" {gsl}
#COND {q} {
#VAR worldtime {%gsl( q)}
#IF (%eval( @roundtime-@worldtime)>0) {
#VAR rt {%eval( @roundtime-@worldtime)}
#VAR maxrt {@rt}
#T+ rtAlarm
#TS (@rt+1)
}
} {gsl}
#ALARM "rtAlarm" {-1} {
#add rt (-1)
#if (@rt<1) {#T- rtAlarm}
} "" {disable}
#class 0



Nazradin
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue May 18, 2004 12:32 pm   
 
I've got no problem with the alarm. Here's my test:
#ALIAS test {#TEMP {Round*time: (%d) sec} {#ALA RT +%%1 {stance defensive;look}}}
test
#SH {Rount time: 5 sec}

After five seconds I see:
stance defensive
look

Try testing that yourself and see if it works. Also, when running the whole script, you can check the settings to see if the temp trigger is being created and if the alarm is created correctly after the temp trigger fires. That way you can determine if it is the alarm causing problems or not.
Reply with quote
nazradin
Apprentice


Joined: 23 Mar 2003
Posts: 114
Location: New Zealand

PostPosted: Tue May 18, 2004 2:07 pm   
 
quote:
Originally posted by Kjata

I've got no problem with the alarm. Here's my test:
#ALIAS test {#TEMP {Round*time: (%d) sec} {#ALA RT +%%1 {stance defensive;look}}}
test
#SH {Rount time: 5 sec}

After five seconds I see:
stance defensive
look

Try testing that yourself and see if it works. Also, when running the whole script, you can check the settings to see if the temp trigger is being created and if the alarm is created correctly after the temp trigger fires. That way you can determine if it is the alarm causing problems or not.



seems it is the double % in the alarm, #ALA RT +%%1 , is this bacause it use to be part of an alias that i changed to a button?

thanks naz
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue May 18, 2004 7:27 pm   
 
Yes, that explains it. Aliases use %1 and buttons don't. The double % is to defer evaluation. Since you want %1 evaluated in the #TEMP trigger, the alias needs the evaluation deferred but the button doesn't.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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