-
January 21st, 2022, 16:37 #1
- Join Date
- Jan 2020
- Posts
- 280
CombatManager.requestActivation does not trigger hooks
Hello,
I am trying to listen in for turn end/start events through the CombatManager. So far I have had success with setCustomTurnStart and setCustomTurnEnd, but I recently discovered that the activation flag (in the lower left of the CT, which you can drag/drop to set a turn) does not trigger any hooks. This function, requestActivation, seems to only be used by this drag/drop flag.
I can understand why it might not go through all the work of finding the actors for turn end/start, like how nextActor does, but wouldn't it make sense to at least call onInitChangeEvent? If not that, would it be possible to add another hook, such as onActivationEvent?
-
January 21st, 2022, 17:23 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,561
If you manually adjust the actor round, we have no way of determining what the user is trying to do with regards to round start and round end activity (i.e. rewinding for missed actions, skipping forward in time, just setting up different targeting, ....). In fact, we don't even know that the user wants to "change" the initiative, per se. So, we assume and do nothing other than change the active state.
What are you trying to accomplish?
Regards,
JPG
-
January 21st, 2022, 17:36 #3
- Join Date
- Jan 2020
- Posts
- 280
I'm setting up a targeting extension with the aim of making every turn consistent, which helps (anecdotally, from the five games I run) with novice players or just those that don't use the CT. Really it's just selecting the token at turn start and clearing targets at turn end.
I'm already hooked into the round start event so this isn't a really big problem, since my ext will eventually get to run anyway and get things cleaned up for the next round, but a hook like onActivationEvent or running onTurnStartEvent from requestActivation would be nice for the token selection piece. It makes sense to me to still call onTurnStartEvent since the now-activated node is effectively starting their turn.
-
January 21st, 2022, 19:15 #4
- Join Date
- Apr 2020
- Location
- Camas, WA
- Posts
- 195
Take a look at Celestian's Has Initiative Indicator.
-
January 21st, 2022, 19:19 #5
- Join Date
- Jan 2020
- Posts
- 280
Great rec, thanks. I use that extension and am disappointed I didn't think of looking at it
It's very amusing: all celestian is doing is adding a handler to the CT node active state, effectively creating their own onActivationEvent hook:
Code:DB.addHandler("combattracker.list.*.active", "onUpdate", updateInititiativeIndicator);
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks