hehe, yeah :D It is not a problem with a specific system :D (At some point I wanted to add AURA effects to 3.5e, then I might integrate it to one of the extensions there such that height could be respected in aura stuff :) )
Printable View
There seems to be a bug, at least in version 8-20 of FGU (I think it was the previous version that introduced the bug -- prior to that it seemed to be working for me) -- it still works on player for player tokens, but for NPC tokens I can't get it to create the height label. Additionally, for NPCs where I am using an Image instead of a Token, it won't let me increase the size (holding alt+mouse scroll decreases the size). I'm not great at Lua and have never really looked at the FG extension framework until now, but I threw in a few debug lines and printed out the before/after scale, and it did seem to be increasing the overall scale of the token while on the map it was shrinking.
Hight label is working on NPC's here with latest build.
Interesting on the shrinking Token. I have experienced similar issue on some tokens. I might have used Image instead of Token on them. I will have to check that.
Yeah, it seems to be an issue with the underlying implementation in the TokenManager, too -- or something with how it gets the token instance/target in this case (since it works without the extension). I was able to get the label working on NPCs again -- that seemed to be due to the fact that the NPC was not in the Combat Tracker, in which case the handler is unable to access the token. I modified the height manager a bit to see if I could just pass on the token resize to the default helper, but I'm seeing the same issue (sorry, I don't see a code tag on this forum):
Code:if not target then
return false
end
if Input.isShiftPressed() then
if not hasHeightWidget(target) then
createHeightWidget(target);
else
if notches > 0 then
doIncreaseHeight(notches,target);
else
doDecreaseHeight(notches,target);
end
end
elseif Input.isAltPressed() then
local vImage = ImageManager.getImageControl(target, true);
local OrientationCount = vImage.getTokenOrientationCount();
target.setOrientation((target.getOrientation()+notches)%OrientationCount);
elseif Input.isControlPressed() then
TokenManager.onWheelHelper(target, notches);
end
return true;
Ahha! It seems sometimes the target is just a node, and not necessarily a token -- in this case you have to turn the selected node into the token from the CT. I did this and it seems to work, now:
This seems to work in all cases (that I tried, which were 3: player token, default NPC token, NPC image token), but it does change the default keybindings you used (this is because the underlying handler has a check for control pressed, dont ask me why) -- might need a bit more work to fit this in to your original version, but this solves my issue. Great work on this, by the way!Code:elseif Input.isControlPressed() then
local nodeCT = CombatManager.getCTFromToken(target);
if nodeCT then
TokenManager.onWheelHelper(nodeCT, notches);
end
Edit: Note that the default mouse wheel helper has a call that converts the node to the CT Token, which you'd likely need that call as well if you want to override that completely instead of passing it on to the default handler like I do -- I assume that you'd need to make the call to get the node and then the call to get the token which isCode:local tokenCT = CombatManager.getTokenFromCT(nodeCT);
Thank you! fixed!
Yes, my extensions are in general not for FGU at the moment :) Since FGU changes quickly, I'd need to change the height label extension all the time, and I sadly have no time at the moment to keep up with the updates on FGU (I have rarily free time at the moment) :) But you can of course reupload your version of the extension for other users of FGU :) At latest when FGU releases I will look at this again, the TokenManager often changes and I probably just need to update that with the new updates of FGU :)
Oh -- for sure, I wouldn't expect folks to maintain extension FGU given that it is in early access (or in general, honestly, its FOSS there is no obligation lol) -- I really only commented in the first place because it had worked and then stopped working, and it seemed you had future proofed it a bit for FGU in the most recent version since you had the check for the FGU client, so I thought you might want to know (and honestly I didn't think I would be able to fix it, or I would've just waited and posted the fix).
In any case, attached is my bodged together fix for FGU 8-20 with Image Tokens, for anyone that is interested (the code change is in the manager_height.lua -- you can unzip the .ext and its in the scripts folder, for those that want to change it themselves) Note: I didn't update the version in the extension metadata because that's how I roll (and I forgot until just now. I don't think it matters)
Thanks again for the great work (this is literally the only extension that I use for FGU :) My players have a bunch of giant owls so it is critical. )