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
eupher
Apprentice


Joined: 18 Jan 2001
Posts: 116
Location: USA

PostPosted: Fri Apr 29, 2011 11:12 am   

Enabling a trigger inside the execution of another trigger...
 
I've encountered a behavior in trigger processing that seems counter-intuitive, and just wanted to make sure it was intended.

If you have a trigger fire and enable another trigger, the trigger pattern that just got enabled gets tested against the output that already fired the first trigger. I was assuming (and this was causing problems) that if you enable a trigger *after* a line of input has already been received, then it wouldn't get tested against that line. I can sort of see what's happening, because if I change the priority of the first trigger to be a higher number than the one it enables then the newly enabled trigger does not get applied to the last line.

Here's a sample of the behavior I'm talking about. Again, it may be intended. I just found it surprising and it took me a while to figure out what was going wrong in my script. Smile

Code:
<class name="Trigger_Test" id="41">
  <trigger name="FIRSTTRIGGER" priority="420" case="true" regex="true" id="42">
    <pattern>^First Trigger$</pattern>
    <value>#TEMP {$} {#T- SECONDTRIGGER}
#T+ SECONDTRIGGER</value>
  </trigger>
  <trigger name="SECONDTRIGGER" priority="430" case="true" regex="true" enabled="false" id="43">
    <pattern>^\w+ Trigger$</pattern>
    <value>#MESSAGE %line</value>
  </trigger>
  <alias name="test_trigger" id="44">
    <value>#ECHO First Trigger
#ECHO Second Trigger
#ECHO ""</value>
  </alias>
</class>
Reply with quote
eupher
Apprentice


Joined: 18 Jan 2001
Posts: 116
Location: USA

PostPosted: Fri Apr 29, 2011 11:13 am   
 
Oh, sorry... running CMUD 3.34

Thanks
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Apr 29, 2011 1:24 pm   
 
Yes, that is intentional. In addition to controling this through the priority, there is a trigger option which can prevent further triggers from firing.
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