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
Rugbystyle
Wanderer


Joined: 07 Oct 2001
Posts: 71

PostPosted: Tue Oct 31, 2006 8:21 pm   

[1.12] Expression triggers in seperate .pkg's
 
I am unable to get any Expression triggers to function from a seperate package. However, identical triggers function perfectly when created in the session window settings.

I made a basic expression trigger of:
pattern: @test=1
value: #ECHO works

When the trigger and alias are in the session window tree, setting test=1 will cause "works" to appear. However, when these settings are instead created in a seperate package, enabled for the window, setting test=1 will not work.
_________________
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Oct 31, 2006 8:40 pm   
 
Make sure you put this trigger into a *module* and have set the Published option for the module.

You don't put settings into a "package". A trigger (alias, macro, etc) always goes within either a "Window" or a "Module". A package is a *.PKG file that contains one or more "Windows" or "Modules".

It's still possible that there is a bug, but I want you to check this first and make sure your expression trigger was really within a module that was published. Otherwise it can't be seen outside of it's package.
Reply with quote
Rugbystyle
Wanderer


Joined: 07 Oct 2001
Posts: 71

PostPosted: Wed Nov 01, 2006 12:39 am   
 
Double checked, and verified that the module containing the Expression trigger is in fact published. I ran mulitple aliases from the seperate, published, enabled module to verify everything was working properly. I then remade multiple basic Expression triggers and was unable to get any of them to function.
_________________
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Nov 01, 2006 1:15 am   
 
OK, thanks for double-checking this. I've added it to the bug list.
Reply with quote
Apathy
Beginner


Joined: 13 Jul 2003
Posts: 17

PostPosted: Wed Nov 01, 2006 4:07 am   
 
I had a similar problem, but with a pattern trigger, and not consistently.
The pattern was just: ^RDMP - Red Dragon Mud Protocol supported$

I moved the trigger to the session window and it started working. I moved it back to a published module in a separate package, and it stopped working. Finally I just deleted the trigger and remade it, and then it worked just fine.
Reply with quote
Zugg
MASTER


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

PostPosted: Sun Nov 05, 2006 2:06 am   
 
Rugbystyle: there turns out to be a big problem with this...

Expression triggers are fired in CMUD when a variable in the pattern changes. This is a compiled reference. In zMUD, expression triggers were looped every time *any* variable changed, and each trigger was re-parsed. But in CMUD, the expression trigger is only fired when the compiled variable reference changes.

This means that an expression trigger can only refer to a single variable (so that the reference to that variable can be used to trigger it). When you put an expression trigger into a seperate package, or even a separate module, it can't reference the variables in the current MUD window.

In other words, an expression trigger in a package should be able to fire when any other window contains the variable that changes. But this can't be done, because the variable reference is undefined, and a variable with that name might exist in several other modules and windows. There is no way to make it into a unique reference that can be used to fire the expression trigger.

I think you will need to re-think what you were trying to do with this and do it another way. You couldn't do this in zMUD either (because it didn't even have packages). It's only a restriction for expression triggers. Normal triggers are looped when text is received from the MUD and variable references can be adjusted to the current window receiving text. But with expression triggers there is no way to do this.

Apathy: I think your problem with triggers is something else and you should start a different topic for it if you have something you can reproduce.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1244

PostPosted: Sun Nov 05, 2006 2:43 am   
 
So expression triggers will only work for variables defined in the same module/window and package? (to summarise)
Reply with quote
Zugg
MASTER


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

PostPosted: Sun Nov 05, 2006 4:33 am   
 
Correct. For example, an expression trigger works fine in a separate module if you update the value of the variable in *that* module. It just has no way to trigger based upon variables in a different module. Or, I supposed you can try hard-coding a direct full path for the variable. As long as the expression trigger is only tied to a single specific variable, then it should work.
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