Thread: 5E - Token Height Indicator
-
June 2nd, 2021, 05:08 #261
- Join Date
- Oct 2019
- Location
- Hong Kong
- Posts
- 310
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.
-
June 2nd, 2021, 13:28 #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.
bmos' extensions
he/them
-
June 2nd, 2021, 16:27 #263
- Join Date
- Oct 2019
- Location
- Hong Kong
- Posts
- 310
yep, what bmos said :-)
we found where it's coming from
-
June 2nd, 2021, 16:27 #264
- Join Date
- Oct 2019
- Location
- Hong Kong
- Posts
- 310
yep, what bmos said :-)
we found where it's coming from
-
June 2nd, 2021, 16:29 #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.
bmos' extensions
he/them
-
June 3rd, 2021, 02:19 #266
Thanks, bmos! Really appreciate it. Version 4.2 uploaded, which hopefully alleviates all the strangeness.
-
June 3rd, 2021, 18:02 #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 arguementbmos' extensions
he/them
-
June 3rd, 2021, 18:43 #268
- Join Date
- Aug 2019
- Posts
- 2,025
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.
-
June 4th, 2021, 00:36 #269
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.
-
June 5th, 2021, 13:24 #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)
Bookmarks