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
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 275

PostPosted: Mon Apr 04, 2022 3:23 pm   

Trigger loop
 
So now, all of a sudden, a shitload of triggers are looping. How this is possible when only ONE trigger definition exists ANYWHERE in ALL of the code in all of the packages, is a mystery.

These triggers have been in existence for more than a year.

This doesn't seem like a code problem to me...AFTER MORE THAN A YEAR!!

For what it is worth the affected triggers have CAP and/or GAG statements.

Anyone have anything similar?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4496
Location: Pensacola, FL, USA

PostPosted: Mon Apr 04, 2022 11:48 pm   
 
It sounds like the trigger is somehow visible to your child window, so it fired there and reprints to fire again.
Check the enabled packages on the advanced tab of the window in the settings editor.

I gave you the code to fix these issues over here.
_________________
Discord: Shalimar#3679
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 275

PostPosted: Tue Apr 05, 2022 6:02 am   
 
Well here is the confusing thing, and I have never understood it:

Installed package has the scripts, triggers, etc but windows are always listed in the main session. If the package fires a trigger to capture text, it needs access to the main session (which they have) and the only selections are main session and package itself.

So yes, the triggers ARE visible to the child windows as the triggers are IN the packages but the windows are in the main session.

Eg., #TR {Character autosaved at} {#CAP INFO}

The trigger is in a 'channels' package but the window always appears as listed off the session tree. The only triggers writing to this window are from the main session and the 'channels' package.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4496
Location: Pensacola, FL, USA

PostPosted: Tue Apr 05, 2022 2:11 pm   
 
It's a scoping issue.

Triggers (and other settings) are housed in the main (named for the session) window object by default, which acts as if it was a higher-tier folder than class objects.

Window objects by default aren't visible to each other. So they don't have the scope to react to whatever settings are housed in other windows.

Packages are typically global in scope, so everything in your session can 'see' them by default. But this behavior isn't always desired (as you have found out).

So you have the option to toggle which packages a given window has scope (access) to.

But as I explained in the other thread, there is a bug in which CMUD being forced to close from a system update can often re-enable all packages to all windows.

However, if you put the #FUNCTION and #EVENT from that other thread into each of your custom packages, it will ensure that only the main window of your session will have access to that package.
_________________
Discord: Shalimar#3679
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