DICE PACKS BUNDLE
Page 27 of 68 First ... 17252627282937 ... Last
  1. #261
    Quote Originally Posted by GKEnialb View Post
    @Zygmunt Molotch and @rhagelstrom - can you both confirm you're using v4.1? That does the same thing as the Aura hotfix (removing "local" from the local functions). And was it working for a while and then started spewing errors or had errors from the beginning? If the former, did you do anything with tokens or maps between when it was working and when it wasn't? Really baffled on this type of error...
    I can confirm 4.1 and latest Aura release with hotfixes

    Screenshot 2021-06-02 120728.png

    regarding map in background, no

    I can get the error repeatedly without players and the map being in focus (albeit, my error is a scripting one, different from rhagelstrom's error)

    it always occurs for melee attacks and frequently when some form of flanking, or line could be drawn between two tokens (of course this may not be related, initially I thought it was the CombatModifiersExtension, and it still could be..., but it's anecdotal extra info)
    Last edited by Zygmunt Molotch; June 2nd, 2021 at 15:22.

  2. #262
    disregard. it seems errors were coming from another extension and provoking an error here.
    Last edited by bmos; June 2nd, 2021 at 16:22.

  3. #263
    yep, what bmos said :-)

    we found where it's coming from

  4. #264
    yep, what bmos said :-)

    we found where it's coming from

  5. #265
    I found out today that the SmiteWorks getDistanceBetween function has undocumented functionality that this extension removes.
    The token arguments can be instead tables of { x, y }

    A decent solution would be to use CombatManager.getTokenFromCT(getCTNodeAt(x,y)).
    This comes with that function's usual downside of not differentiating between one token flying on top of another.

    Or you can just say "using it that way isn't documented so I'm not going to support it" which would be also be reasonable IMO.

    Here is something that seems to be working:
    Code:
    function getDistanceBetween(sourceToken, targetToken)
    	if not sourceToken or not targetToken then
    		return;
    	end
    
    	local gridsize, units, _, _ = getImageSettings()
    
    	local startx = 0
    	local starty = 0
    	local startz = 0
    
    	local endx = 0
    	local endy = 0
    	local endz = 0
    
    	local ctNodeOrigin
    	if sourceToken.getContainerNode then
    		ctNodeOrigin = CombatManager.getCTFromToken(sourceToken)
    		if ctNodeOrigin then
    			startz = TokenHeight.getHeight(ctNodeOrigin) * gridsize / units
    		
    			local ctNodeTarget
    			if targetToken.getContainerNode then
    				ctNodeTarget = CombatManager.getCTFromToken(targetToken)
    				if ctNodeTarget then
    					endz = TokenHeight.getHeight(ctNodeTarget) * gridsize / units
    				end
    			end
    		end
    	end
    
    	if not sourceToken.getContainerNode and not targetToken.getContainerNode then
    		startx, starty = sourceToken['x'], sourceToken['y']
    		endx, endy = targetToken['x'], targetToken['y']
    	elseif not sourceToken.getContainerNode and targetToken.getContainerNode then
    		startx, starty = sourceToken['x'], sourceToken['y']
    		endx, endy = targetToken.getPosition()
    		endy = endy * -1
    	elseif sourceToken.getContainerNode and not targetToken.getContainerNode then
    		startx, starty = sourceToken.getPosition()
    		starty = starty * -1
    		endx, endy = targetToken['x'], targetToken['y']
    	else
    		startx, starty = getClosestPosition(sourceToken, targetToken)
    		endx, endy = getClosestPosition(targetToken, sourceToken)
    	end
    
    
    	return distanceBetween(startx, starty, startz, endx, endy, endz, false)
    end
    Last edited by bmos; June 2nd, 2021 at 18:52.

  6. #266
    GKEnialb's Avatar
    Join Date
    Jul 2017
    Location
    Castle Rock, CO
    Posts
    523
    Thanks, bmos! Really appreciate it. Version 4.2 uploaded, which hopefully alleviates all the strangeness.

  7. #267
    It will at least fix that problem, seems like there are always more haha
    I just noticed that there is another thing to getDistanceBetween:
    https://fantasygroundsunity.atlassia...ween-%5BFGU%5D

    it can also accept token IDs as an arguement

  8. #268
    This is one of four extensions that I use which add overlays. Unfortunately we experience occasional targeting, double-click roll to hit target and now even lighting issues that may or may not be connected to overlay extensions. I already had the highlighter extension disabled and will try height, initiative icon and wound overlays next time.

  9. #269
    GKEnialb's Avatar
    Join Date
    Jul 2017
    Location
    Castle Rock, CO
    Posts
    523
    Quote Originally Posted by bmos View Post
    It will at least fix that problem, seems like there are always more haha
    I just noticed that there is another thing to getDistanceBetween:
    https://fantasygroundsunity.atlassia...ween-%5BFGU%5D

    it can also accept token IDs as an arguement
    Oh, boy. I'll add that in as well (as soon as I can find a nice example of using token IDs).


    This is one of four extensions that I use which add overlays. Unfortunately we experience occasional targeting, double-click roll to hit target and now even lighting issues that may or may not be connected to overlay extensions. I already had the highlighter extension disabled and will try height, initiative icon and wound overlays next time.
    Haven't had any of those reported against this extension, but let me know if you find something.

  10. #270
    Just passing by to thanks @GKEnialb and this amazing extension!
    No more Pythagoras theorem on the table on the fly, woo-hoo!
    :- )

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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
  •  
FG Spreadshirt Swag

Log in

Log in