 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Tue Jan 08, 2008 8:43 pm
[2.18 Pro] Events not firing from auxiliary package to main package |
I've got packages setup such that my core combat system is in the "Treant Core" package and my character-specific scripts are in my "Lusternia" package. I have a script that tracks my defenses, especially synchronizing with the lines I get when I execute the DEF command in the game.
(Located in Treant Core package under //Treant Core/Defenses:)
| Code: |
<trigger priority="1670" regex="true" id="167">
<pattern>^\s*def(ences)?\s*$</pattern>
<value>#T+ "//Treant Core/Defenses/Update"
#RAISE OnDefenseCheck</value>
</trigger>
|
I want this to fire the OnDefenseCheck event, so that I can have class-specific packages for checking more defenses.
(Located in Lusternia package under //Treant Stag/Defenses:)
| Code: |
<event event="OnDefenseCheck" priority="4450" id="445">
<value>#T+ "//Treant Stag/Defenses/Update"</value>
</event>
|
The problem is that the event doesn't fire for the Treant Stag module. It's not disabled, and it fires when I do #RAISE OnDefenseCheck from the command line. I've got the Lusternia package enabled for Treant Core (required, anyway) and the Treant Core package enabled for the Treant Stag module, which I would think ensures that they can see each other and things should talk back and forth...
Edit: To add a little more info, other events do fire, such as the OnDefenseChecked at the end of the DEF display, so I'm wondering if it has something to do with the Command Input trigger? It has Trigger on Trigger enabled, though.
Second Edit: Realized I hadn't tried making Treant Stag a global module, which they caused the Command Input trigger to fire the OnDefenseCheck event. This is still a bug, I think, because of the inconsistency in the firing of the events. At least one fired while it was still in Local mode and another only fired when I switched it to Global. |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jan 08, 2008 9:47 pm |
If the event is in a different package, then it should only fire if it is in a module that is Global or External. I cannot get events in a Local module of a different package to fire unless the #RAISE command comes from another module in the same package. So I can't reproduce this.
|
|
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Wed Jan 09, 2008 1:01 pm |
I'm certain I saw the one event fire from a global module and execute in a local module. Now that I know I need to make them global, I'm happy that it works the way I expect. I'll see if I can reproduce the local firing bug for you, though. Thanks.
|
|
|
|
 |
|
|
|
|
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
|
|