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
Xcaliber2k3
Newbie


Joined: 14 Aug 2003
Posts: 6

PostPosted: Thu Aug 14, 2003 3:44 am   

Looping triggers, Timers
 
Ok, When you use the WAIT command in a trigger, is there a way you can reset the timer on it if the pattern is sent to the mud again. For Example:
You have a trigger that says: Someone starts to push you
Then you set the trigger to wait 2 seconds and send the command "Dodge" to the mud. But, the person can do this:
Someone begins to push you...
SOmeone begins to push you...
Someone begins to push you...
(Within the two seconds)
In that case i would get pushed off the cliff because my trigger is set to dodge 2 seconds after each of those commands.

So in conclusion is there a way i could get the trigger to dodge once by reseting the WAIT each time a person enters the command within that 2 second interval.

I want it to do something like this

Someone begins to push you.
1
2
Somone begins to push you. (Reset and start over)
1
2
Someone begins to push you. (Reset and start over)
1
2
"Dodge"
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Aug 14, 2003 5:38 am   
 
Don't use #WAIT in triggers.
Timers, Alarms, and the #WAIT command

A one-time alarm with an ID is probably the best choice for this use.
#TR {^%w begins to push you} {#ALA push +2 dodge}
Reply with quote
Veldrane
Beginner


Joined: 14 Aug 2003
Posts: 10
Location: USA

PostPosted: Thu Aug 14, 2003 5:57 am   
 
why not just simply turn the trigger off?

Somone begins to push you
*trigger off*
1
2
dodge
*trigger on*
then the wait between pushes won't be an issue sence the trigger will be turned off at the time
Reply with quote
Xcaliber2k3
Newbie


Joined: 14 Aug 2003
Posts: 6

PostPosted: Thu Aug 14, 2003 8:19 am   
 
Ok Thanx. But, the way this thing works is someone can use fakes by doing more then one attacks at a time. They throw a punch, if you dont block within 3 seconds you get hit. So i set a trigger to block every three seconds, but heres the down side, they can throw another attack within those three seconds, while my trigger is blocking the first one, the second attack will hit me because there is a block lag in the game, if you get thrown off by an attack, the next one will hit because they faked you.

Now what i need is a script that will stop this, If someone throws a punch for example:

Someone retracts his right arm...
(I have three seconds to block wich activates my trigger, now within these 3 seconds, this guy throws another attack a.k.a a "fake" wich throws my trigger off)
Someone retracts his right arm...
(Now right after this fake my command goes in)
Block
You block air.
Someones punch hits you =[1,900]=

Now, you see what i need is something that wont insert my command until the 3 seconds is over and if a fake happens to be thrown, the trigger will restart the 3 seconds, hence forgeting about the first one and any others thrown before that one. For example what i need it to do is:

Someone retracts his right arm...
(Trigger starts)
Someone retracts his right arm...
(Trigger sees the same command, so it restarts the trigger, terminating the one that started before it)
Someone retracts his right arm...
(It sees the same command again so it restarts. terminating the previous trigger once again. So as soon as the 3 seconds pass, without anyone throwing another punch, the trigger will follow through with my block resulting in me blocking the attack)
(After 3 seconds)
Block
You block the attack!
Reply with quote
miles2go
Beginner


Joined: 27 Jul 2001
Posts: 20

PostPosted: Thu Aug 14, 2003 5:26 pm   
 
If you want to be continually blocking, then yes you probably want the tick timer. I do something similar for Inferno.

Try these:
#AL BlockBlows {#timer (0) {block} (0) (0);#tset 3} blocking
#AL StopTime {#timer (0) {#NOOP} (0) (0)}
#TRIG {^Someone retracts his right arm...} {BlockBlows} blocking
#TRIG {^You block the attack!} {StopTime} blocking

BlockBlows - sets your timer to block in three seconds
StopTime - If you are going to be playing with the timer you want to be able to shut it down. Otherwise you will keep blocking every three seconds long after combat is done. This is intentionally not in the blocking class.
The first trigger prepares to block, and resets the delay to three seconds everytime someone cocks a blow
The second trigger stops the timer after you block. You need this otherwise they can throw a punch, you block, they do nothing for three seconds, you block again, then they clobber you.
Reply with quote
Xcaliber2k3
Newbie


Joined: 14 Aug 2003
Posts: 6

PostPosted: Fri Aug 15, 2003 2:10 am   
 
The timer works fine, but it wont throw the block at the end
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Aug 15, 2003 4:19 am   
 
The tick timer is intended for measuring game ticks. Alarms are intended for providing timed actions. You really ought to try the alarm I suggested last night.
Reply with quote
Xcaliber2k3
Newbie


Joined: 14 Aug 2003
Posts: 6

PostPosted: Fri Aug 15, 2003 8:41 am   
 
Lightbuld, when i put that stuff in, it does nothing. It sets a triggers for ^%w bigins to push you. and a command #ALA push +2 dodge, then it makes an alarms that says push, and a command +2. It doesnt work. Can you explain step by step how i would og by putting that in.
Reply with quote
Xcaliber2k3
Newbie


Joined: 14 Aug 2003
Posts: 6

PostPosted: Fri Aug 15, 2003 10:04 am   
 
YAY! I figured it out, Thanx LightBulb. How can i make it count 2.5seconds? I put #ALA +2.5 Block, but its still counting 2 seconds.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Aug 15, 2003 5:09 pm   
 
+2.5 is correct for 2.5 seconds. Telling the difference between 2 and 2.5 seconds is pretty difficult, even with a stopwatch.
Reply with quote
Xcaliber2k3
Newbie


Joined: 14 Aug 2003
Posts: 6

PostPosted: Fri Aug 15, 2003 10:30 pm   
 
Sometimes it blocks to early and other times it blocks on time, is there a way to make it so it blocks on 2.5 seconds all the time. Cus its blocking around 1.5 on some rounds
Reply with quote
sp000n
Novice


Joined: 04 Jul 2001
Posts: 32

PostPosted: Wed Aug 20, 2003 10:31 pm   
 
Zmud can't tell time that accuratley, I'm afraid. I've been timing 5 second alarms and they're all over the place. Human error can account for a few tenths of a second, perhaps, but it's often off by as much as 40%!
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