PDA

View Full Version : Moving from player id in CT to charsheet



bmos
June 19th, 2020, 19:23
Since it appears that the id of a character can be a different string under the charsheet and combattracker db entries, is there a way to easily get back and forth?

I have a handler in onInit which runs combineCarryModifiers when I change effects:

DB.addHandler(DB.getPath('combattracker.list.*.eff ects'), 'onChildUpdate', combineCarryModifiers)

Unfortunately, I need to define rActor for use in the combineCarryModifiers function.
When I define rActor:

rActor = ActorManager.getActor('pc', node.getParent())

I get the following result:

{ s'sType' = s'pc', s'sCreatureNode' = s'combattracker.list.id-00001', s'sCTNode' = s'combattracker.list.id-00001', s'sName' = s'testy' }

It fills the sCTNode string correctly (since that is what node.getParent() returns) and gets the character name correctly, but doesn't return the right string for sCreatureNode.

Obviously, I'm doing something wrong. What is it?

Moon Wizard
June 19th, 2020, 21:40
You need to pass "ct" as the first parameter into getActor; because you're passing it a combat tracker node as the second argument.

Regards,
JPG

bmos
June 20th, 2020, 02:25
I did actually try that, but must have messed something else up.
Thanks for the pointer :)

EDIT: It works now, not sure what else I had messed up last time but thanks again !!