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
ReedN
Wizard


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

PostPosted: Mon Apr 07, 2008 2:44 pm   

[2.22] Direction overrides cause oninput triggers to fire twice on movement
 
Since there are a lot of non-standard movement commands, I was told to copy the directions to my package and override them to add in the other movement types. Such as:

Code:
<dir name="n" reverse="s" dir="n" id="2222">        n|north|swim n|leap n|tumble n|crash n|burrow n</dir>


This is causing oninput triggers for the movement to fire twice, such as this trigger:

Code:
<trigger type="Command Input" priority="33360" case="true" regex="true" id="3336">
  <pattern>^\s*(d|u|in|out|n|ne|e|se|s|sw|w|nw)\s*$</pattern>
  <value>#raiseevent Movement %1 walk
#say triggered %1</value>
</trigger>


This is what I see with the above trigger:

Code:
5060h, 6655m, 21900e, 26400w cexkdb-triggered w
triggered w
w

A corridor of flowering plum trees.
You see exits leading east and west.
5060h, 6655m, 21898e, 26400w cexkdb-



Debugger showing the trigger firing twice:

Code:
0.0004 | c    Achaea |  exec : Macro "KEY4" : w
0.0005 | f    Achaea |  Command Input: ^.
0.0007 | c    Achaea |  exec : Command Input "CommandRec" : #T+ SendLine trigger #T+ Wak...
0.0011 | f    Achaea |  Command Input: ^\s*(d|u|in|out|n|ne|e|se|s|sw|w|nw)\s*$ : (%1="w")
0.0008 | c    Achaea |  exec : Command Input "^\s*(d|u|in|out|n|ne|e|se|s|sw|w|nw)\s*$" ...
0.0003 | c    Achaea |  exec : Event "Movement" : i_failsafe_moving %1 %2
0.0029 | a    Achaea |5060h, 6655m, 21898e, 26400w cexkdb-triggered w
0.0010 | f    Achaea |  Pattern: ^\d+h, \d+m, \d+e, \d+w [cexkdb@]*\-
0.0008 | c    Achaea |  exec : Pattern "newline" : #RAISEEVENT NewlinePrompt
0.0069 | f    Achaea |  Command Input: ^\s*(d|u|in|out|n|ne|e|se|s|sw|w|nw)\s*$ : (%1="w")
0.0008 | c    Achaea |  exec : Command Input "^\s*(d|u|in|out|n|ne|e|se|s|sw|w|nw)\s*$" ...
0.0004 | c    Achaea |  exec : Event "Movement" : i_failsafe_moving %1 %2
0.0027 | a    Achaea |triggered w
0.0050 | a    Achaea |w
0.0021 | j    Achaea >w


If I disable the direction overrides the second firing goes away, so they are firing once for the default directions and again for my overridden directions. Is this a bug or just how this works. In the case of this just being how this works, then is there a more proper way to override non-standard movement without the side-effects?
Reply with quote
ReedN
Wizard


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

PostPosted: Tue Apr 08, 2008 11:38 am   
 
Also, disabling the default ones doesn't have the desired effect. That just disables Cmud recognizing movement.
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Apr 23, 2008 7:33 pm   
 
Hard to help more without seeing more of your actual event triggers. Make sure you are not sending the movement command to the MUD via the #SEND command. The #SEND command caused ONINPUT triggers to fire. To send data to the MUD without firing ONINPUT triggers be sure to use #SENDRAW.

Otherwise, if you can post a simpler test case that I can try in a blank session that doesn't call a bunch of other scripts, then maybe I can reproduce the problem.
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