PDA

View Full Version : Help understanding Combat Tracker Nodes (5e)



Tielc
October 24th, 2018, 20:42
I have some questions about how nodes are used in the Combat Tracker. Do multiples of NPCs reference a single node and the HP and Wounds are not linked to them? Or are they each their own instance linked to an internal node?

Along with this, how to get the base node for a character or npc from the Combat Tracker? I'm updating my CurrentHP extension and I would like to include the ability to change the current HP. Currently I'm doing this by modifying the values in the text boxes. But is creating a recursive script warning. On the character sheet I've done this with DB.setValue and it seems to work without the recursive issue. So I would like to try the same thing in the CT, but I'm not sure how to get the actual character. Is this store / referenced in the rActor object?

Trenloe
October 24th, 2018, 20:48
When a NPC record is added to the CT a complete copy is made that is unique to the CT - this allows the tracking of HP, edits, effects, etc. on each individual NPC record in the CT.

For example of getting access to the DB node from the rActor object, do a search in the 5E ruleset for ActorManager.getTypeAndNodeName.

Tielc
October 25th, 2018, 15:34
I was able to get this figured out, thank you and Moon Wizard for the help. I messed with ActorManager.getTypeandNode to get the node I needed. By I ultimately found the crux of my issue was I couldn't access another control on the window from within a control on the same window. So what I did was create a window level function that modified those controls and called that function from with the controls themselves. If that makes sense. This really eliminated the need to access the nodes themselves; I'll let the existing functionality to that.