DICE PACKS BUNDLE
Page 2 of 2 First 12
  1. #11
    Here's a version I ended up testing with:

    Code:
    function onInit()
    	Token.onMove = onTokenMove;
    end
    
    function onTokenMove(tokenMap)
    	local token1 = CombatManager.getTokenFromCT(DB.findNode('combattracker.list.id-00003'));
    	local token2 = CombatManager.getTokenFromCT(DB.findNode('combattracker.list.id-00001'));
    
    	Debug.chat("ON MOVE 1", token1)
    	Debug.chat("ON MOVE 2", token2)
    	Debug.chat("ON MOVE 3", Token.getDistanceBetween(token1, token2))
    end

  2. #12
    I was able to slip this into the beta build (v4.1). When a token is moved by a remote client (either GM or player), the Token.onMove and tokeninstance.onMove events will fire (as in FGC).

    If you base your stuff on something similar to my sample code in the post above along with this change; it should simplify your code.

    Regards,
    JPG

  3. #13
    Thanks JPG!

  4. #14
    SoxMax's Avatar
    Join Date
    Mar 2021
    Location
    Massachusetts, USA
    Posts
    155
    This is awesome! Also the reason for assigning a new handler on token attribute updates is because we weren't aware that Token.onMove existed. Its not actually documented on Jira or the old docs.

  5. #15
    Now just need something to tell us if its visible in LOS
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in