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
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Mon Apr 06, 2009 9:41 pm   

[3.05] #state bug
 
It appears that #state does not work without an ID. In the following case the #state command fails to do anything:

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <alias name="test">
    <value>#say Begin Testing!</value>
  </alias>
  <trigger priority="21990">
    <pattern>Begin Testing!</pattern>
    <value>#say State 0 fired!</value>
    <trigger>
      <pattern>State 0 fired!</pattern>
      <value>#say State 1 fired!
#state 0</value>
    </trigger>
    <trigger>
      <pattern>State 1 fired!</pattern>
      <value>#say State 2 fired!</value>
    </trigger>
  </trigger>
</cmud>


Also, if you use the #alarm command and then proceed it with #state 0, the alarm is immediately disabled. The only way to get around this is to give the trigger an ID which can be cumbersome when dealing with a large group of triggers.


Last edited by GeneralStonewall on Mon Apr 06, 2009 10:48 pm; edited 1 time in total
Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Mon Apr 06, 2009 9:53 pm   
 
I think this is an old bug, knew i had seen it pop up before. but evidently not posted in cmud forums.

http://forums.zuggsoft.com/forums/viewtopic.php?t=27449&highlight=%23state

Adding a trigger Id, and the ID name to #state will take care of this problem thou.
Reply with quote
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Mon Apr 06, 2009 10:46 pm   
 
wrym wrote:
I think this is an old bug, knew i had seen it pop up before. but evidently not posted in cmud forums.

http://forums.zuggsoft.com/forums/viewtopic.php?t=27449&highlight=%23state

Adding a trigger Id, and the ID name to #state will take care of this problem thou.


I had posted it on the general cmud forums but realized this was the more appropriate forum. Yes though, it appears that this is also an issue with zmud.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Tue Apr 07, 2009 2:18 pm   
 
How odd that I was just looking at this yesterday as well. The documentation for #state shows an example of its use without an id and I was playing around with that yesterday. It should either work as it shows in the example in the documentation, or the documentation should be changed to correct the impression it can be used without an id present.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Apr 07, 2009 5:09 pm   
 
I'll add this to the CMUD bug list. The #state command is supposed to work without an id.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Apr 17, 2009 9:10 pm   
 
Well, the old bug post is fixed now. ( http://forums.zuggsoft.com/forums/viewtopic.php?t=27449&highlight=%23state )

However, in the first post in this thread, I think people are a bit confused about the execution order of triggers and states. As soon as the state of a trigger matches, the trigger is set to the next state. So in the state above where you do:

#say State 1 fired!
#state 0

the trigger state is already set to the next state, so the #say command immediate matches the pattern. So the trigger displays "State 2 fired!" in response to the #say command BEFORE the "#state 0" command is executed.

So, the actual order in which the commands are executed in this example are:

#say Begin Testing!
#say State 0 fired!
#say State 1 fired!
#say State 2 fired!
#state 0

which is working fine now in v3.06. Just already remember that displaying text to the screen via #SAY (or #SHOW, etc) causes any matching trigger to be executed immediately, interrupting the current script flow. And multi-state triggers are advanced to their next state immediately when a match of the current state is detected. So when a state is running it's script, the trigger is actually set to the NEXT state already, waiting for matching text.
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