Thread: 5E - Token Height Indicator
-
February 28th, 2021, 06:06 #1
Token Height Indicator for FGU (all rulesets)
With the FG Ruleset Updates 2023-02, token heights are now part of the base FGU. I've delisted this extension to avoid any conflicts or confusion. Thanks for all the support the last couple of years. If anyone is interested in code and/or wants to steal any part of it, you can find it on GitHub.
This extension allows the height of each token to be set / displayed by holding down the alt key and using the scroll wheel. The token orientation is changed with shift and scroll wheel and the token scale is changed with control and scroll wheel. The height can only be set by tokens in the combat tracker.
Ranges (both the range arrow and via the getDistanceBetweenTokens call for use by other extensions) are updated accordingly.
This is available on the Forge.
Screenshot
Height with range.png
License
This work is Public Domain - feel free to distribute / copy / modify / incorporate as you wish.
Methods for range
My goal is to the mirror the spirit of each style in the rulesets, not necessarily to provide the most accurate result (which will always be raw). As such:
5E Standard: 2D formula is max(x delta, y delta). My formula is max(x delta, y delta, z delta)
5E Variant / most other rulesets: "Variant Diagonal Style" option to account for two schools of thought on whether the distance between a token at 0,0,0 and one at 5,5,5 is 5ft or 10ft. The only difference between the two options is when all three deltas are the same.
"Long": 2D formula is longer delta + 1/2 shorter delta. My formula is longest delta + 1/2 other two deltas.
"Short": 2D formula is longer delta + 1/2 shorter delta. My formula is longest delta + 1/2 middle delta (ignoring smallest delta).
5E Raw Variant / "Raw Distance" option on maps for other rulesets: 2D formula is sqrt(x2+y2). My formula is sqrt(x2+y2+z2).
There are lots of ways to make 5E Standard / variant measurements more "accurate", but that goes against the spirit of those rulesets. If you want to be entirely accurate, then you should use the raw measurements.
Note that Token Height changes squares into cubes and the bottom of the cube is what the height value represents. So a Medium creature with height 0 is assumed to extend from 0' to 5'. As with FGU's distance equations, the starting point for the calculation is in the middle of the square closest to the target, so the distance between a Medium creature and one directly above it will start at 2.5' and a Huge creature (15') with height 0 will start at 12.5' (assuming 5' cubes). If they were moved 10' into the air, the calculation would start at 12.5' and 22.5', respectively.
Shape support (for use by other extensions)
Code:TokenHeight.getTokensWithinShape(originToken, shape, distance, height, width, azimuthalAngle, polarAngle) Image.getTokensWithinShapeFromToken(originItem, shape, distance, height, width, azimuthalAngle, polarAngle) Image.getTokensWithinShape(originX, originY, originZ, shape, distance, height, width, azimuthalAngle, polarAngle) Get all tokens within a shape (including the origin token, if any). Any token with any part of its containing cube will be returned. I know there is a lot of debate and variations on how much of a token needs to overlap for a given shape type. As such, I'm returning all, as it's easier to remove tokens you don't want than to add... The parameters for each type of shape are:
- All:
- originX, originY, originZ - the coordinates of the center / origin of the shape
- shape - "sphere", "cube", "cylinder", "line", "cone"
- sphere:
- distance = radius of the sphere
- cube:
- distance = length of each side of the cube
- cylinder:
- distance = radius of the sphere
- height = height of the cylinder
- line:
- distance = length of the line
- width = width of the line (half on each side of the line in all directions)
- azimuthalAngle = angle of the line leaving the origin in the X/Y plane in degrees. 0 = north, 90 = east
- polarAngle = angle of the line leaving the origin in the X/Z plane in degrees. 0 = flat, 90 = straight up
- cone:
- distance = length of the cone
- width = angle of the cone aperture (53 in 5E, 90 in 3.5/PFRPG)
- azimuthalAngle = angle of the center of the cone leaving the origin in the X/Y plane in degrees. 0 = north, 90 = east
- polarAngle = angle of the center of the cone leaving the origin in the X/Z plane in degrees. 0 = flat, 90 = straight up
Known Bugs / Future plans
- This is for FGU only; it will not work with FGC
- Tested with 5E / 4E / 3.5E / Pathfinder 1&2 / Starfinder / MoreCore; others should work but have not been tested
- Height of an NPC will get reset when taking / removing control of that NPC with GM Assistant
- You will see a slight shift in the token as you change heights. This is to work around a change in FGU 4.3.1 and will not impact the distance calculations.
Version History (most recent)
6.0: Major performance improvements by moving logic from combat tracker nodes to image tokens with help from silentruin, MeAndUnique, and Saagael
6.1: Re-added the code accidentally deleted that made AuraEffects recalculate the auras on a height change
6.2: Removed warning for tokens on map that aren't in combat tracker or are in combat tracker but have no associated space
6.3: Fixed error in Token.getTokensWithinDistance
6.4: Fixed error when changing options
6.5: Fixed issues with D&D 4E
6.6: Workaround for sometimes tokens losing their names, causing them to always share the same height valueLast edited by GKEnialb; February 24th, 2023 at 02:10. Reason: Overcome by events
- All:
-
February 28th, 2021, 12:50 #2
Thank you. I have been looking for a replacement for the 5e enhancer ext. I use it only to do height, remove actors and effects (since it is broken for many other functions) but I have been getting nervous that some future update will break even these. It is an old project that has been orphaned. This is the biggest piece for me and now I can move on!
-
February 28th, 2021, 17:17 #3
There are definitely good replacement apps for those other functions, so glad to hear this completes what you need. My goal was to make this as minimalistic as possible so updates or other extensions won't break it (fingers crossed).
-
February 28th, 2021, 18:38 #4
- Join Date
- Oct 2018
- Posts
- 26
I'd love to use this extension, but it seems that enabling this extension makes it so that token scaling is done with the scroll wheel alone, without any modifier keys required, and that's not something I want to happen.
I don't know if that's intended functionality or caused by some sort of interaction with another extension I've got, but I do know that as long as it's the case I cannot use this one.
-
February 28th, 2021, 23:38 #5
Yes. I noticed that as well. If we can lock that would be helpful. Also, can you make it visible to the players? Mine could not see the height indicator.
-
March 1st, 2021, 00:18 #6
I will look into both of those (locking with cntrl-scroll to change scale and making visible to the players)
-
March 1st, 2021, 03:37 #7
And I've updated to address both. Thanks for the feedback!
-
March 1st, 2021, 05:21 #8
Does the height affect range? Also, I would love it if the players could change their height, but not sure if possible if the token is locked.
-
March 1st, 2021, 11:27 #9
Looks like the changes are working. I would 2nd players being able to change height.
I know the 5e enhancer factor height into the range calculation but I am not sure if that would play nice with the other range exts that handle feats, range in melee and long vs normal range modifiers. If not then that could be a project to complete because many of us would not give up those automations for a range that included height. It would be nice to have though!
Thank you for the updates!
-
March 1st, 2021, 23:14 #10
This is why I still have to use the one from Enhancer sadly. Pulling the Height.ext out of it works just fine to do what this ext is doing also. However, would be nice if we could get that range checking in there. Maybe we are just getting greedy on what we want our exts to do haha.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks