PDA

View Full Version : 5e Combat Tracker Active Actor



Stv
June 30th, 2020, 21:03
Another plea for help :)
If I know the combat tracker DB node for an actor, is there a simple function call that can be invoked to make that actor the one in focus in the combat tracker, *without* making it the active actor in the combat tracker ?

Basically I want to programmatically set focus to an actor without upsetting the initiative order in the CT.
Any help/pointers greatly appreciated.

Cheers, Steve.

Moon Wizard
July 1st, 2020, 06:32
I guess you need to define what you mean by "set focus"?

The active flag is just a field that gets set on the actor, and the CT script makes sure only one actor at a time has it. If the active actor was set by the standard turn/round progression buttons, then extra work is done in CombatManager script to manage effects, start/end turn stuff, and more. The active actor's token is marked with the setActive flag as well.

Regards,
JPG

Stv
July 1st, 2020, 11:44
Thanks for the reply Moon.
What I mean by 'active' is that currently (on the DM side at least) when the actor is made active the CT window centres on that actor and opens up it's attacks, traits etc. This is the functionality I'm chasing, but without changing the actual current actor. Hope that's clearer :P

I'll have a dig around in the CombatManager script in the meantime and see if what I need is in there.

Cheers, Steve.

Stv
July 2nd, 2020, 08:21
Found what I was looking for.
In case anyone else ever needs it once you have the window reference to the actors CT window, scrollToWindow(windowclass) pulls it into view in the CT.

Cheers, Steve.