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.