5E Storm Kings Thunder Playlist
  1. #1
    bmos's Avatar
    Join Date
    Jun 2019
    Location
    Maine, USA
    Posts
    794

    Moving from player id in CT to charsheet

    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:
    Code:
    DB.addHandler(DB.getPath('combattracker.list.*.effects'), 'onChildUpdate', combineCarryModifiers)
    Unfortunately, I need to define rActor for use in the combineCarryModifiers function.
    When I define rActor:
    Code:
    rActor = ActorManager.getActor('pc', node.getParent())
    I get the following result:
    Code:
    { 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?

  2. #2
    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

  3. #3
    bmos's Avatar
    Join Date
    Jun 2019
    Location
    Maine, USA
    Posts
    794
    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 !!
    Last edited by bmos; June 20th, 2020 at 02:34.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
PF2E Playlist

Log in

Log in