You can do it via cloud, just put your GM Name in the "Join by GM Name" box and hit start. I do it all the time without changing anything else from how I run my normal sessions.
Printable View
You can do it via cloud, just put your GM Name in the "Join by GM Name" box and hit start. I do it all the time without changing anything else from how I run my normal sessions.
I have a laptop I use as the client for testing. I log into the host using local IP. Unfortunately I only see this issue when I have the group all logged in thus I said I would have to wait :)
Thank you for checking, yes I see that this extension gets the correct lenght when measuring (like your attached screenshot), I get the same results.
But as I already have reported the combat modifier gets another range when it tries to get a distance between two tokens:
https://www.fantasygrounds.com/forum...l=1#post596881
And the same problem is in the Aura effects, see this thread for screenshot of the problem. Wrong range when it tries to get distance between two tokens.
https://www.fantasygrounds.com/forum...l=1#post597800
Now I am only speculating by looking into the code in "aura", "combat modifier" and this extension. I did not really understand it since I only have started looking into the FG code yesterday, but let me speculate and somebody will probably correct me :)
I think both extensions gets their range between two tokens by calling: "Token.getDistanceBetween( ) function. Which I think your code modifies. So "aura" and "combat modifier" calls Token.getDistanceBetween(), and your code returns "nDistance.
This nDistance is not the same distance as you get when in your screenshot you see on the map. So maybe "aura" and "combat modifier" sends the wrong functions when it calls Token.getDistanceBetween()?
Here is what I think "aura" extension sends when calling Token.getDistanceBetween: (really short version, code does not look like this, but I "simplified" it)
ctEntries = CombatManager.getSortedCombatantList()
for _, node in pairs(ctEntries) do
Token.getDistanceBetween( CombatManager.getTokenFromCT(node) , "and the other token")
I hope this is some help for somebody, I would love to get this working :)
What you see on the screen is exactly what gets returned in getDistanceBetween - both get the result from calling the same function (distanceBetween). It looks like both of the other extensions are for 3.5/Pathfinder, so maybe something is up there? I do have different code for larger creatures for 5E than for other rulesets and all of that depends upon "standard" sizes. It looks like the size in your example is 35'. Is that correct? Does it work correctly if the size is 10, 15, 20, or 30 (those should map to large, huge, gargantuan, and colossal, respectively)? Either way, the distance should match what's on the screen, but that'd be a good place to start looking.
Hey, I really like the extension. But for some reason, in 5e, it changes the measurements of square markers to be the same as circles. So what should be a 20ft square says its a 10ft square instead.
This is with fantasy grounds unity latest live version. + Token height extension v3.0 and combat modifier extension.
First off I have a question which might help me find out what the problem is.
First off when measuring distance between tokens by selecting a target (where the arrow with a distance shows between tokens), where is your function distanceBetween called? Because it is not called from function getDistanceBetween?
Second question. It does not look like your extension uses the local function "getDistanceBetween" to anything? Have you just added that to your code to be compatible with other extensions?
Third: If that is the case it might be a cause of the problem. Because in the local function getDistanceBetween you are calling the "distanceBetween" function and sending them coordinates. What I am guessing now is that the coordinates you are sending the "distanceBetween" function is the coordinates for the tokens at the center. And since your function "distanceBetween" does not take into account the size of the tokens the lenght will be wrong.
I have not found out how to get the size of the tokens, that is probobly the trick. To send the x,y,z coordinates to the points that are closest to the two tokens instead of the center of it.
Fourth: I also think your math is wrong. As you see in the screenshot (bottom of screenshot where the range is shown) the distance between the two medium sized tokens are 20 measured to 20 feet. 10 feet in x direction, 10 feet in y direction 10 feet in z direction. I think you should be able to do this: From the token on the ground (the hero named "ffdsfsad"), the square that is 1 step in the x,y and z direction is directly towards the alchemical golem, that is one step. And now I only have one more step to go, 1 step in the x,y and z direction directly towards the golem. That is 2 steps. In pathfinder first step i 5 feet, second step i 10 feet. That is 15 feet total.
Can we just use this to calculate it, I think that should be correct: (I modified your code slightly in the function distanceBetween where have your "elseif diagMult == 0 then"
Code:local hyp = math.sqrt((dx^2)+(dy^2)+(dz^2))
totalDistance = math.floor(hyp / gridsize)* units
I think I tracked down Svandal's problem with his very large dragon, he was using a non standard Pathfinder size of 35 ft. I've updated the non-5E sizeMultiplier calculation to be more generic.
Code:local distancePerGrid = GameSystem.getDistanceUnitsPerGrid()
local nSpace = DB.getValue(ctNode, "space");
sizeMultiplier = ((nSpace / distancePerGrid ) - 1) * 0.5
if nSpace > distancePerGrid * 2 and nSpace % (distancePerGrid * 2) > 0 then
bExact = false
end
Since I was in the the code too I was tinkering with the distance calculation since I tend to agree with Svandal about the current result being too long. I've been experimenting with this for the calculation of distance when the diagMult > 1
it seems to calculate a more "real" distance since halving both smaller legs tends to generate a much further distance than the real hypotenuse. The biggest thing I'm running up against though is what is the movement cost in 3.5/Pathfinder to go from 5,5,5 to 0,0,0?Code:local diagMultIncrease = diagMult - 1
local distances = {dx, dy, dz}
table.sort(distances)
local first = distances[1] * diagMultIncrease / 2
local second = distances[2] * diagMultIncrease
local third = distances[3]
totalDistance = math.floor((first + second + third) / gridsize) * units
Version 3.1 upload to account for the arbitrary sizes and to fix StarDrifter's finding on the squares.
@SoxMax - thanks, I was thinking that may have been the issue. I think your code also works for 5E, so now I have a common determination. I appreciate that.
@Svandal - does that fix your primary concern? As for the other questions, just for information:
It is called from getDistanceBetween, right before it returns the distance (line 30)Quote:
First off when measuring distance between tokens by selecting a target (where the arrow with a distance shows between tokens), where is your function distanceBetween called? Because it is not called from function getDistanceBetween?
Correct, I override getDistanceBetween to allow other extensions to automatically get the height taken into account when used in conjunction with this extension (they don't need to do anything special unless they're overriding it as well, as it's a call from the core ruleset).Quote:
Second question. It does not look like your extension uses the local function "getDistanceBetween" to anything? Have you just added that to your code to be compatible with other extensions?
It was using "standard" sizes of tokens based upon their size, but with SoxMax's update, any size should work. So it was taking the size of the tokens into account (unfortunately with a lot of strange logic due to how FG handles creatures that are bigger than medium), just not all sizes...Quote:
Third: ...
My math is correct (at least it's does exactly what my intent is). In your sample picture, if they were at the same height, you'd get a range of 15'. Having one 10' higher than the other must add some amount to the distance. I used the same formula for adding a third dimension as is done with two dimensions (full effect from the longest axis, half from the shorter axes), which I believe meets the spirit of the rules. The formula you quoted is the actual raw distance - if that is more to your liking, you can make all the calculations raw by setting the Raw Distance flag on the map (see post #86, page 9).Quote:
Fourth: I also think your math is wrong.
Thanks for bringing up the issue - hopefully it works to your satisfaction now.
I see your point, but that's also what happens in the 2D calculations as well - going diagonally 500 feet is 707 feet mathematically but 750 feet with the 3.5/PFRPG movement rules. They did that for simplicity, not for accuracy (and 5E goes even further). I'd prefer to follow that spirit and a quick search on people asking that question in a tabletop setting seems to agree with the formula I have. That being said, I'm easy - if there's enough of a request for a different method, I'd entertain it (at the risk of annoying people who like it as it is).Quote:
it seems to calculate a more "real" distance since halving both smaller legs tends to generate a much further distance than the real hypotenuse.
Of course, that makes sense. I got stuck last night with the idea that the real distance was the same as pathfinder distance diagonally, which is only correct for small distances. I understand it now, and since 99% of pathfinder rules are written for 2 dimensions we dont actually have good 3d measurement rules 😃.
And thank you for your other answers, I am new to lua, and new to the fantasy grounds code.
I will test this out later today, but it sounds like it is correct now. Thank you everybody.
Well, I still think the problem is that the function getDistanceBetween does not take into account the token size at all. It only measures distances between token mid points.
The combat modifier extension calls the function getDistanceBetween when you make a ranged attack.
I added a Debug.chat in your code to see what distance gets returned. Look in the chat. As you can see it does not take into account token size when it returns the distance. And the distance returned is not the same as the measured distance with the "targeting function". The targeting function when measuring does something else than call the function getDistanceBetween to take into account token size.
See screenshot for details. The bug is there even with "standard" sized tokens.
It does look like token size is taken into account for pointers but not for getDistanceBetween. However, I think this might be consistent with how FG normally handles the getDistanceBetween function?
It's all a bit vague anyway since we don't know how tall creatures are.
MoonWizard described how the getDistanceBetween() function works in this post. https://www.fantasygrounds.com/forum...l=1#post576016
So calculation is NOT done from center of token to center of token, but instead its done from center of grid square to center of grid square. whichever two grid squares within the token's space are closest.
For a visual representation of how it works, in this image the PC outlined in purple is targeting each of the NPCs. The distance calculation is done from the center of the purple square, to the center of each of the green squares. The green squares represent the closest grid square to the purple square.
https://imgur.com/2S1KwGW.jpg
I had a thought last night about sizes and why you need to do the fuzzy search. I was unfortunately right, it has to do with which square the targeting pointer is on with larger creatures. I've slightly updated my size multiplier code to account for this. Basically anything over 3 * GameSystem.getDistanceUnitsPerGrid() in size needs to be fuzzy matched.
Code:local nSpace = DB.getValue(ctNode, "space");
local distancePerGrid = GameSystem.getDistanceUnitsPerGrid()
sizeMultiplier = ((nSpace / distancePerGrid) - 1) * 0.5
if nSpace > distancePerGrid * 3 then
bExact = false
end
I think this should do it. I have consolidated these calls to a single function so that it is easier to modify them in one place. It includes the bExact code posted by SoxMax as well, but not the proposed distance calculation change.
the image settings could alternately be called onInit and then set script-wide variables so that they don't have to be re-checked over and over (although then it would not pick up changes live so I think the solution I have set up here is best).Code:----------------------
-- CUSTOM ADDITIONS --
----------------------
local function getImageSettings()
local gridsize = getGridSize()
local units = DB.getValue(getDatabaseNode(), "distancebaseunit") or getDistanceBaseUnits()
local suffix = getDistanceSuffix()
local diagmult = getDistanceDiagMult() or Interface.getDistanceDiagMult()
-- Debug.chat(gridsize, units, suffix, diagmult)
return gridsize, units, suffix, diagmult
end
local function getDistanceBetween(sourceToken, targetToken)
if not sourceToken or not targetToken then
return
end
local gridsize, units, _, _ = getImageSettings()
local startz = 0
local endz = 0
local ctNodeOrigin = CombatManager.getCTFromToken(sourceToken)
if ctNodeOrigin then
startz = TokenHeight.getHeight(ctNodeOrigin) * gridsize / units
local ctNodeTarget = CombatManager.getCTFromToken(targetToken)
if ctNodeTarget then
endz = TokenHeight.getHeight(ctNodeTarget) * gridsize / units
end
end
local startx, starty = sourceToken.getPosition()
local endx, endy = targetToken.getPosition()
return distanceBetween(startx,starty,startz,endx,endy,endz)
end
function onInit()
if super and super.onInit() then
super.onInit()
end
Token.getDistanceBetween = getDistanceBetween
end
-- Distance between two locations in 3 dimensions.
local function distanceBetween(startx,starty,startz,endx,endy,endz,bSquare)
local gridsize, units, suffix, diagmult = getImageSettings()
local totalDistance = 0
local dx = math.abs(endx-startx)
local dy = math.abs(endy-starty)
local dz = math.abs(endz-startz)
if bSquare then
local hyp = math.sqrt((dx^2)+(dy^2)+(dz^2))
totalDistance = (hyp / gridsize)* units * 2
else
if diagmult == 1 then
-- Just a max of each dimension
local longestLeg = math.max(dx, dy, dz)
totalDistance = math.floor(longestLeg/gridsize+0.5)*units
elseif diagmult == 0 then
-- Get 3D distance directly
local hyp = math.sqrt((dx^2)+(dy^2)+(dz^2))
totalDistance = (hyp / gridsize)* units
else
-- You get full amount of the longest path and half from each of the others
local straight = math.max(dx, dy, dz)
local diagonal = 0
if straight == dx then
diagonal = math.floor((math.ceil(dy/gridsize) + math.ceil(dz/gridsize)) / 2) * gridsize
elseif straight == dy then
diagonal = math.floor((math.ceil(dx/gridsize) + math.ceil(dz/gridsize)) / 2) * gridsize
else
diagonal = math.floor((math.ceil(dx/gridsize) + math.ceil(dy/gridsize)) / 2) * gridsize
end
totalDistance = math.floor((straight + diagonal) / gridsize)
totalDistance = totalDistance * units
end
end
return totalDistance
end
function onMeasurePointer(pixellength,pointertype,startx,starty,endx,endy)
local gridsize, units, suffix, diagmult = getImageSettings()
if not (gridsize and units and suffix and diagmult) then return; end
local bSquare = false
if pointertype == "rectangle" then
bSquare = true
end
local startz = 0
local endz = 0
local ctNodeOrigin = getCTNodeAt(startx,starty,gridsize)
if ctNodeOrigin then
local ctNodeTarget = getCTNodeAt(endx,endy,gridsize)
if ctNodeTarget then
startz = TokenHeight.getHeight(ctNodeOrigin) * gridsize / units
endz = TokenHeight.getHeight(ctNodeTarget) * gridsize / units
end
end
local distance = distanceBetween(startx,starty,startz,endx,endy,endz,bSquare)
if distance == 0 then
return ""
else
local stringDistance = nil
if diagmult == 0 then
stringDistance = string.format("%.1f", distance)
else
stringDistance = string.format("%.0f", distance)
end
return stringDistance .. suffix
end
end
function getCTNodeAt(basex, basey, gridsize)
local allTokens = getTokens()
for _, oneToken in pairs(allTokens) do
local x,y = oneToken.getPosition()
local ctNode = CombatManager.getCTFromToken(oneToken)
local bExact = true
local sizeMultiplier = 0
-- bmos / SoxMax supporting other rulesets
local nSpace = DB.getValue(ctNode, "space");
local distancePerGrid = GameSystem.getDistanceUnitsPerGrid()
sizeMultiplier = ((nSpace / distancePerGrid) - 1) * 0.5
if nSpace > distancePerGrid * 3 then
bExact = false
end
local bFound = false
if bExact then
bFound = exactMatch(basex, basey, x, y, sizeMultiplier, gridsize)
else
bFound = matchWithinSize(basex, basey, x, y, sizeMultiplier, gridsize)
end
if bFound then
return ctNode
end
end
end
function exactMatch(startx, starty, endx, endy, sizeMultiplier, gridsize)
local equal = false
local modx = endx
local mody = endy
if modx > startx then
modx = modx - gridsize * sizeMultiplier
elseif modx < startx then
modx = modx + gridsize * sizeMultiplier
end
if mody > starty then
mody = mody - gridsize * sizeMultiplier
elseif mody < starty then
mody = mody + gridsize * sizeMultiplier
end
if modx == startx and mody == starty then
equal = true
end
return equal
end
function matchWithinSize(startx, starty, endx, endy, sizeMultiplier, gridsize)
local equal = false
local modx = endx
local mody = endy
local lowerBoundx = endx
local lowerBoundy = endy
local upperBoundx = endx
local upperBoundy = endy
if endx > startx then
lowerBoundx = endx - gridsize * sizeMultiplier
elseif endx < startx then
upperBoundx = endx + gridsize * sizeMultiplier
end
if endy > starty then
lowerBoundy = endy - gridsize * sizeMultiplier
elseif endy < starty then
upperBoundy = upperBoundy + gridsize * sizeMultiplier
end
if startx >= lowerBoundx and startx <= upperBoundx and starty >= lowerBoundy and starty <= upperBoundy then
equal = true
end
return equal
end
For some reason, making the map full screen/"sending to background" seems to make the distance calculation revert to original smiteworks version.
Is anyone else noticing this? I don't recall seeing it discussed here.
EDIT: It looks like there are other windowclass names for images sent to background or full screen. Probably the extension.xml file needs to have a change made so that image.lua is used in all these places.
EDIT3: You can use this in extension.xml instead of the current windowclass merge you're using to replace image.lua:
Code:<template name="image_record_step">
<imagecontrol name="image" merge="join">
<script file="campaign/scripts/image.lua" />
</imagecontrol>
</template>
Wow, great discussion and super helpful updates. I've folded it all into the extension (made a minor mod to use bmos's updates in the SoxMax code with mattekure's suggestion) and released v3.2. Tried it with the various sizes and seems to work fine, but the off-nominal cases is where all the bugs are lurking. Svandal is the expert at finding those! :) Hopefully now it'll work. (oh, I should have paid more attention to your screenshot - I'll check to see why onMeasurePointer and getDistanceBetween are giving different results. Presumably they're getting different starting locations for the same tokens).
All I'm still looking at currently is how to get the suffix from GameSystem.xml.
It would allow getting rid of the 4E suffix override (and further improve support for more rulesets).
Awesome. I spent a while looking into it and went the hardcoding route once my brain started hurting too much...
For the suffix stuff etc., I'd rather use the sidebar of an image (grid mode), where one can overwrite the typical increment and the suffix of range indicators :) Then one can even adjust that kind of stuff ingame :) (I have some prototype for that in my height extension, not uploaded yet; I can try to find that prototype if you want to add such things :) )
Certainly. That is the primary source using getDistanceSuffix(), but I like to configure each of those variables to fallback to the gamesystem file values if it doesn't get them from the image sidebar.
I did this with "local diagmult = getDistanceDiagMult() or Interface.getDistanceDiagMult()"
To account for the problem in getDistanceBetween I tried experimenting with a new way of generating the distances which is more reliant on the built in methods. This generates a pretty good result, but gets wonky when height is the primary distance between targets. It does have the advantage however of also overwriting the imagecontrol getDistanceBetween making it consistent with the Token.getDistanceBetween function.
Code:----------------------
-- CUSTOM ADDITIONS --
----------------------
local function exactMatch(startx, starty, endx, endy, sizeMultiplier, gridsize)
local equal = false
local modx = endx
local mody = endy
-- Debug.console(modx, startx, mody, starty)
if modx > startx then
modx = modx - gridsize * sizeMultiplier
elseif modx < startx then
modx = modx + gridsize * sizeMultiplier
end
if mody > starty then
mody = mody - gridsize * sizeMultiplier
elseif mody < starty then
mody = mody + gridsize * sizeMultiplier
end
-- Debug.console(modx, startx, mody, starty)
if modx == startx and mody == starty then
equal = true
end
return equal
end
local function matchWithinSize(startx, starty, endx, endy, sizeMultiplier, gridsize)
local equal = false
local lowerBoundx = endx
local lowerBoundy = endy
local upperBoundx = endx
local upperBoundy = endy
if endx > startx then
lowerBoundx = endx - gridsize * sizeMultiplier
elseif endx < startx then
upperBoundx = endx + gridsize * sizeMultiplier
end
if endy > starty then
lowerBoundy = endy - gridsize * sizeMultiplier
elseif endy < starty then
upperBoundy = upperBoundy + gridsize * sizeMultiplier
end
-- Debug.console(lowerBoundx, startx, upperBoundx, lowerBoundy, starty, upperBoundy)
if startx >= lowerBoundx and startx <= upperBoundx and starty >= lowerBoundy and starty <= upperBoundy then
equal = true
end
return equal
end
local function getCTNodeAt(basex, basey)
-- Debug.console("start getCTNodeAt")
local allTokens = getTokens()
for _, oneToken in pairs(allTokens) do
local x,y = oneToken.getPosition()
local ctNode = CombatManager.getCTFromToken(oneToken)
local bExact = true
local nSpace = DB.getValue(ctNode, "space");
local distancePerGrid = GameSystem.getDistanceUnitsPerGrid()
local sizeMultiplier = ((nSpace / distancePerGrid) - 1) * 0.5
if nSpace > distancePerGrid * 3 then
bExact = false
end
local gridsize = getGridSize()
local bFound = false
if bExact then
bFound = exactMatch(basex, basey, x, y, sizeMultiplier, gridsize)
else
bFound = matchWithinSize(basex, basey, x, y, sizeMultiplier, gridsize)
end
-- if sizeMultiplier > 0 then
-- local exactMatch = exactMatch(basex, basey, x, y, sizeMultiplier, gridsize)
-- local matchWithinSize = matchWithinSize(basex, basey, x, y, sizeMultiplier, gridsize)
-- Debug.console(ctNode, "sizeMultiplier", sizeMultiplier, "gridsize", gridsize)
-- Debug.console("exactMatch", exactMatch, "matchWithinSize", matchWithinSize)
-- end
if bFound then
return ctNode
end
end
end
local function calculate3dDistance(flatDistance, heightDistance)
local distancePerGrid = GameSystem.getDistanceUnitsPerGrid()
local diagMult = getDistanceDiagMult()
local totalDistance = flatDistance
if diagMult == 0 then
totalDistance = math.sqrt((flatDistance ^ 2) + (heightDistance ^ 2))
elseif diagMult == 1 then
totalDistance = math.max(flatDistance, heightDistance)
else
if flatDistance > heightDistance then
totalDistance = flatDistance + heightDistance * (diagMult - 1)
else
totalDistance = heightDistance + flatDistance * (diagMult - 1)
end
totalDistance = math.ceil(totalDistance / distancePerGrid) * distancePerGrid
end
Debug.chat(totalDistance)
return totalDistance
end
local getDistanceBetweenTokens_orig
local function getDistanceBetweenTokens(sourceToken, targetToken)
local flatDistance = getDistanceBetweenTokens_orig(sourceToken, targetToken)
if not flatDistance then
return nil
end
local sourceHeight = 0
local targetHeight = 0
local ctNodeOrigin = CombatManager.getCTFromToken(sourceToken)
if ctNodeOrigin then
sourceHeight = TokenHeight.getHeight(ctNodeOrigin)
local ctNodeTarget = CombatManager.getCTFromToken(targetToken)
if ctNodeTarget then
targetHeight = TokenHeight.getHeight(ctNodeTarget)
end
end
local heightDistance = math.abs(sourceHeight - targetHeight)
return calculate3dDistance(flatDistance, heightDistance)
end
function getDistanceBetween(source, target)
-- Debug.console("getDistanceBetween")
-- Debug.console("types", type(source), type(target))
if type(source) == "tokeninstance" and type(target) == "tokeninstance" then
return getDistanceBetweenTokens(source, target)
end
local flatDistance = super.getDistanceBetween(source, target)
if not flatDistance then
return nil
end
local sourceHeight = 0
local targetHeight = 0
local ctNodeOrigin = getCTNodeAt(source.x, source.y)
if ctNodeOrigin then
sourceHeight = TokenHeight.getHeight(ctNodeOrigin)
local ctNodeTarget = getCTNodeAt(target.x, target.y)
if ctNodeTarget then
targetHeight = TokenHeight.getHeight(ctNodeTarget)
end
end
local heightDistance = math.abs(sourceHeight - targetHeight)
return calculate3dDistance(flatDistance, heightDistance)
end
function onMeasurePointer(pixellength,pointertype,startx,starty,endx,endy)
local distance = getDistanceBetween({x = startx, y = starty}, {x = endx, y = endy})
if distance == 0 then
return ""
else
local stringDistance = nil
if diagMult == 0 then
stringDistance = string.format("%.1f", distance)
else
stringDistance = string.format("%.0f", distance)
end
return stringDistance .. getDistanceSuffix()
end
end
function onInit()
if super and super.onInit() then
super.onInit()
end
getDistanceBetweenTokens_orig = Token.getDistanceBetween
Token.getDistanceBetween = getDistanceBetweenTokens
end
I suggested that same approach around v1.9 (that's why getDistanceBetweenTokens_orig was there) but GKEnialb wanted to do it all in a single function rather than calling the original function.
I actually think that was the right call since otherwise different formulas are being used (which is causing the weirdness you mention when height is the primary differentiator). Supposedly the original function being called there is similar to this.
Yeah, I appreciate the thought Soxmax, but I don't think it'll work with horizontal being calculated separately from vertical. There are some other interesting things in what you posted, though, so I'll play with something in between.
Sorry, Svandal, I do see that getDistanceBetween doesn't work right for tokens larger than one square - you were absolutely right that it's just using the center and that it doesn't match the arrow. I had figured that since both onMeasurePointer and getDistanceBetween were both calling distanceBetween, they must be getting the same result, but didn't think about the fact that getDistanceBetween starts with tokens instead of coordinates (and getting the position of those tokens returns the center). The good news is that I know how to fix it - just have to find the square in the large target closest to the other (as mattekure points out in post 135). I'll have a fix shortly.
* Well, "shortly" may not be too accurate. I implemented finding the closest square, but apparently that's not exactly how it works. I think it takes the line between the center of each token and finds the furthest square of each token along that line. Looking at this image:
Attachment 46366
The closest square is in red and is 20' away (with the variant/3.5/PFRPG counting). However, the old getDistanceBetween (and the logic I use in the arrow) both come up with 25', which would be true if the square directly south of the red square was chosen. Not sure that I like that, but better to make it match what the core comes up with...
4E
Token Height 3.2
Aura-Effects .10
New Campaign, no other extensions.
I get this error on token move.
https://i.imgur.com/ABGKEFO.png
Removing Token Height removes the error.
Okay, posted v3.3 which (hopefully) fixes getDistanceBetween to find the correct square to perform the distance between...
I feel so honored. My first mentino in an update. Svandal, the man who never stopped nagging :)Quote:
Originally Posted by 24GKEnialb
I have tested it, and it seems to be working, so great job. It will speed up our games much when there is 3D combat.
But it was necessary nagging to get me past the mental block that the arrow and function had to return the same value... :) Glad it's working for you now.
Attachment 46423
I got this error in my campaign tonight. Everything was working fine and then the last battle I got this error. Never changed maps.
Very odd. Did you add any tokens to the map between the time it was working and when you got the error? Do you have any other extensions loaded? If it does come up again, you may be able to kick it by removing/re-adding the tokens from the combat tracker and resharing the map. That's just a system call, so not really sure how it could have disappeared.