|
Tharius Beginner
Joined: 15 Apr 2013 Posts: 24
|
Posted: Mon Apr 20, 2020 1:43 pm
Segregating Packages to the character they're attached to |
In an effort to solve some corruption issues I've been setting my triggers into packages and associating them with different character sessions.
For example:
Mage
+ - generalTriggers
+ - mageTriggers
Cleric
+ - generalTriggers
+ - clericTriggers
I see the per session variables created which has stopped the corruption issue I was having previously. What I am now seeing I'll describe as access bleed.
The packages are set to global, I've tried to find some explanation of local but haven't been successful.
If I have multiples of both types of characters on, or sometimes even with only 1 of each, I will see triggers firing in the mage window that are defined in the cleric package. This happens regardless of whether or not the trigger is the same.
CMudPro 3.34 under Win10
Thanks! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4672 Location: Pensacola, FL, USA
|
Posted: Tue Apr 21, 2020 12:14 pm |
I find the simplest way is for each Character to have a session, with triggers that are unique to that one character in its package.
Anything that might be shared, is a separate package.
Make sure that each character session only has the relevant packages in its package list. (don't enable a cleric package for a mage)
I also find it helps to run each session in a separate instance of CMUD.
Global vs local is a scoping concern.
Global means that any and all windows can see a given setting(s), not just the session window that called it.
You want capturing triggers to be local, to prevent a recursive loop where it keeps fireing on the newly captured line in the child window.
Whereas coloring triggers are likely more effective when global. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Tharius Beginner
Joined: 15 Apr 2013 Posts: 24
|
Posted: Wed Apr 22, 2020 1:12 am |
For years I've run with the single character single set of triggers style, but managing it across a horde of characters is time consuming and frustrating. So when I reinstalled I decided a structure where packages would represent groups of common functionality. Seems to rather fit with the idea of packages.
Now if they're broken, then fine. Rather than go to the multiple instance model (which I find absurd, are you insinuating that windowing in CMud is fundamentally broken?) I'll put ifchecks at the top of my triggers to guard the against the class of the character.
#if ( @MSDP.class == "cleric" ) {
...
} |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4672 Location: Pensacola, FL, USA
|
Posted: Wed Apr 22, 2020 12:44 pm |
It's a foolproof way to avoid the scoping issues is all.
Make sure that your shared packages have little to no variables in them. They can make use of them, but any variables that apply to the individual should be saved in the individual character packages. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|