DICE PACKS BUNDLE
Page 3 of 3 First 123
  1. #21
    Quote Originally Posted by Moon Wizard View Post
    There is no mechanism to tell the client to update like that. Potentially a jiggle (move 1 pixel and then back)?

    JPG
    Not sure this is relevant but AURA just got a make over and part of that was to speed it up. It was processing a ridiculous amount of trivial onMove's and now only processes if it has moved from last reported position more than 1/2 a grid unit (Kluding where it will err on the side of processing).

    Here is the crappy kludge that helped speed up the massive campaigns I run... (also carrier will soon be doing this same thing - prints showed both AURA and Carrier were receiving an insane amount of moves on certain maps)
    Code:
    local TokenMoveArray = {}
    local function tokenMovedEnough(token)
    	-- cleanup after every 20 tokens received - we are not looking for perfect just trimming down processing time
    	if #TokenMoveArray >= 20 then TokenMoveArray = {} end
    	local imageControl = ImageManager.getImageControl(token, false)
    	if imageControl then
    		local x, y = token.getPosition()
    		for i = 1, #TokenMoveArray, 1 do
    			if token == TokenMoveArray[i].token and imageControl == TokenMoveArray[i].imageControl then
    				-- Determine if moved more than 1/2 the grid unit
    				local nGridSize = imageControl.getGridSize() * 0.5
    				if (x - TokenMoveArray[i].x) ^ 2 + (y - TokenMoveArray[i].y) ^ 2 < nGridSize * nGridSize then return false end
    				table.remove(TokenMoveArray, i)
    				break
    			end
    		end
    		table.insert(TokenMoveArray, { token = token, imageControl = imageControl, x = x, y = y })
    	else
    		return false
    	end
    	return true
    end
    
    local onMove = nil
    local function auraOnMove(tokenMap, ...)
    	if onMove then onMove(tokenMap, ...) end
    	local nodeCT = CombatManager.getCTFromToken(tokenMap)
    	if Session.IsHost and nodeCT then
    		if tokenMovedEnough(tokenMap) then
    			local rActor = ActorManager.resolveActor(nodeCT)
    			if rActor then
    				-- Debug.chat("onMove aura update", tokenMap)
    				notifyTokenMove(tokenMap)
    			end
    		end
    	end
    end
    Side Note: I ran this on map with 100 tokens at least and never hit that 20 limit and some of the carriers had 6 guys moving as one. Like I said the 20 is to err on the safe side.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  2. #22
    GKEnialb's Avatar
    Join Date
    Jul 2017
    Location
    Castle Rock, CO
    Posts
    573
    Thanks. The jiggle was how I forced it to update prior to 4.3.1, but it no longer works. Tried upping the jiggle from 1 pixel to 1 square and back, but to no avail. Any chance we could get something added in the future to force a redraw (like an invalidate call)?

  3. #23
    GKEnialb's Avatar
    Join Date
    Jul 2017
    Location
    Castle Rock, CO
    Posts
    573
    Okay, found a workaround, which is far from elegant but seems to work. The jiggle back and forth right next to each other doesn't work but moving the token by one pixel (not back again) does. On the next adjustment to height, I move it back, which updates the arrow again. So basically, if token is centered on a half-square grid, move it by one. If not, move it back to be centered. Had to snap to the center in my distance calculation, but not a bad thing to do. So looks a bit odd but all the behavior is correct, so not too bad. Would still be great to be able to force a pointer update, though.

Page 3 of 3 First 123

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
  •  
GI JOE RPG Launch

Log in

Log in