Yes I added an encounter to the map however I also added encounters previous to this and I didn't get the error. Yes there are other extensions so I get that probably isn't much help. I was rather confused why this was throwing an error as well.
Printable View
Actually in the latest, line 7 is (part of the getImageSettings() function):
The question I'm struggling with is whether it's better to protect against these strange cases (if getGridSize then ...) and just have the extension silently stop working, return some default value that may generally work but not always (like squirelling away the values when the image is initialized), or let the error occur and have it complain when it stops working... I can't think of any way to prevent a function from somehow disappearing (or why it would, unless there is an odd extension conflict).Code:local gridsize = getGridSize()
@rhagelstrom - was there anything different about the last encounter that you added than the earlier encounters? Were the tokens prearranged in the encounter or did you add the NPCs to the combat tracker and then drag from there to the map? Was the error on the DM console, the players' consoles, or both?
I loaded up the campaign again today and ran the same encounter without issue. I was running a map that was created with assets within fantasy grounds so there is that wild card as well. For now I'd say its not reproducible.
The issue was on the DM side. The larger issue with the error is that when the error was thrown it wouldn't allow me to make ranged attacks so I had to just do them manually. I agree with @GKEnialb that it really shouldn't happen.
Perhaps you could get a list together of what extensions you're using?
EDIT: kevininrussia has been having this issue too:
https://www.fantasygrounds.com/forum...-Handler-error
It would be great to see the list of extensions (and ruleset) for both rhagelstrom and kevininrussia. In the meantime, I've uploaded v3.4 which will keep things running if the functions get dropped so you won't have to switch to doing things manually in the middle of a battle...
Great - thanks.
I tried to recreate multiple times but was unable. I don't feel like list of extensions will help but here it is:
Advanced Effects
Attunement Tracker
Automatic Critical Damage
Automatic Death Resistance
Automatic Flanking and Range (no issue year+)
Automatic Halfling Luck
Automatic Mirror Image
Automatic Save Advantage
Automatic Sneak Attack
Better Combat Effects (Self ext for homebrew)
Constutional Amendments
Dark Luck (self ext for homebrew)
Indicators
Miss Flavor Text
Turn Based Effects
Aura Effects
Drowbe's Chat
MN Combat Stats
Random Encounter Gen
Token Height
Thanks - it helps to see if any of them override any of the same things that this extension does (or one of the functions that disappear for no apparent reason). Hopefully you won't see it again (or the workaround from 3.4 adequately hides it from you).
Anyone having major issues with this extn in the TEST version of FGU.
Throws up errors every few seconds
Also, can you post a screenshot or log snippet of the errors, list which ruleset you're using, and any other extensions? I'll take a look at the test channel, but unfortunately can make no promises - I can't make any modifications to make things work in the test channel that would impact the stable channel.
This extension is now broken for me as well. I have a session coming up tonight so I had to disable it for now. It threw errors when opening the map or even scrolling across characters on the combat tracker. I will try and get something posted with some logs.
Uploaded v3.5 - fixed error spamming for nSpace when there were tokens on the map that weren't in the combat tracker. Hopefully that's what was being reported.
3.5 is causing the latest version of Aura Effects not to add effects correctly. I reported on the Aura Effects thread also.
https://www.fantasygrounds.com/forum...l=1#post599638
With V3.5 EXTN - Any GM/DM (Using 5E FGU) attack using Combat Tracker NPC 'Attacks' and then dropping attack DIE onto PC from NPC CT causing an issue today with 'Token Height Indication' Extension.
[5/12/2021 10:02:02 PM] [ERROR] Script execution error: [string "image"]:10: attempt to call field 'onDrop' (a nil value)
Even dropping the 'Targeting Icon' from the CT is causing this issue.
Not seeing previous issues now - Which is good.
Oops - I protected against a division by 0 when a token was directly above or below another but then promptly divided by 0 later in the same function. Fixed in v3.6 - tested with your Aura Effects and it works fine now.
I can't recreate this and I don't call onDrop myself, but I imagine it's related to the original image disappearing sometimes (and unfortunately, can't override every function in image.lua). I'll see if anybody on the workshop has thoughts on how that could happen. If you can recreate and let me know the steps to do it, that'd help (including if it worked for a bit and then stopped working during the session).Quote:
With V3.5 EXTN - Any GM/DM (Using 5E FGU) attack using Combat Tracker NPC 'Attacks' and then dropping attack DIE onto PC from NPC CT causing an issue today with 'Token Height Indication' Extension.
[5/12/2021 10:02:02 PM] [ERROR] Script execution error: [string "image"]:10: attempt to call field 'onDrop' (a nil value)
Even dropping the 'Targeting Icon' from the CT is causing this issue.
Thank toy! this is awesome
With the new FGU version 4.1
With token height enabled, unable to drag the faction from the combat tracker to populate the map. I can drag individual PC/NPC from the CT to populate map, but the group faction drag no longer works.
Thanks for the extension! I patched the XML file to include Pathfinder 2 and it seems to work properly.
Diagonal target range calculation confuses me, though. Why is this 10 ft instead of 5 ft?
https://i.imgur.com/v0K3G6C.png
Ah, yes. I just checked. Thanks for testing this. Too bad for us PF2 groups, but still useful.
Nice extension. I did find the conflict that was happening mentioned before with the onDrop error. We both have extensions, Critically Awesome Essentials and Token Height extension, that both add to image_record_step... so, I figured out the deconflict, is you wished to make them work together nicely.
in your /campaign/scripts/image.lua you can add the following script to the bottom of the file.
Additionally I am attaching a copy of your extension with the deconflict installed in it. I also added the version notes and advanced the version to 3.7Code:function onDrop(x, y, draginfo)
local custData = {};
custData.x = x ;
custData.y = y ;
custData.imgCtrl = self ;
if draginfo.getType() == "token" then
draginfo.setCustomData(custData);
end;
end
V/r,
Diablobob
Thanks! I've incorporated that into v3.7. I also reverted a change to extension.xml, which hopefully will fix other instances of randomly disappearing image functions (see Functions from image.lua disappearing). Not sure about the faction dropping thing - maybe one of these will fix that for free...
So for the calculation, are using the a squared + b squared = c squared?... cause it would be easy with height squared + map token distance squared = square of calculated distance
If you want to look into this let me know and I can get you the callouts if you have a tough time finding them...
I was just curious if your method
For raw measurements (House Rule option in 5E, map option in other rulesets), I use the actual distance (sqrt(x^2+y^2+z^2). For the 5E standard, I extend the 2D method by taking the max in each dimension. For the 5E variant / normal diagonals for most other rulesets, I use long leg + half of each shorter leg (again extending the 2D formula). If you want the exact measurements, it's available in the raw distances option in the maps. If you use the default for the rulesets, though, I want to mimic the spirit as much as possible.
With more help from Moon Wizard, this should now work on maps made full screen or sent the the background. v3.8 uploaded.
GKEnialb this is a slick extension; you've been putting in a ton of work for what probably seemed like a simple idea at the outset! Thanks for this!
I want to also report a minor bug with FGU 4.1 and v3.8 of this extension. With only this extension enabled, I can no longer use the faction helmets to drag a group of tokens from the CT to a map. If I disable this extension, it works fine.
Attached is a gif demonstration as well as the campaign if you need it to help debug.
Ran into this issue tonight. With this and Batch 9 Spell tokens ext only in a clean 5e build, I can not place spell tokens on a map. It silently fails. Turn off token height and I can place spell tokens. Did not expect that. Any thoughts? I am posting on Batch 9s thread as well. Thanks!
With both on - spell tokens cannot be placed. (screen1)
With token height off - spell tokens can be placed (screen2)
I've taken a look at the issues and its a missing super call from the 'diablobob' code in 'image.lua', without the 'super.onDrop' you loose things like 'drag all party tokens to map' from the combat tracker.
-pete
And you should probably not double call 'super.onInit' during your 'onInit' function.Code:-- From diablobob
function onDrop(x, y, draginfo)
if draginfo.getType() == "token" then
local custData = {};
custData.x = x ;
custData.y = y ;
custData.imgCtrl = self ;
draginfo.setCustomData(custData);
end;
if super and super.onDrop then
return super.onDrop(x, y, draginfo);
end
end
Code:function onInit()
if super and super.onInit then
super.onInit()
end
getDistanceBetween_orig = Token.getDistanceBetween
Token.getDistanceBetween = getDistanceBetween
end