Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
Create a free account

[Help] Token Z-Order not synchronized between GM and players?


Edited 1594371500
I've been working on an API for players to target their spells/abilities. Been a few headaches running into Roll20's current limitations (mainly the state of gifs and animations) but I've been able to work past most things until now. Long story short, when a spell is used, a 'targeting' token is generated that the player can move about the map then confirm the placement when an associated token action. It was working perfectly fine from the GM's perspective but when testing an unrelated issue from a separate, non-GM account, I noticed a pretty fatal problem. For some reason, the targeting token doesn't respect toFront() for the controlling player the same way that it does with the GM. Now, I noticed that tokens the player has control over seem to exert some kind of priority in the layering, which is understandable. But between two equally controlled tokens, one can get stuck under the other with which both toFront() and manually setting it from the GM's context menu has no effect. Again, from the GM's screen, everything is lined up perfectly fine. But trying to select a newly spawned token is a mess from the player's screen since it seems to be permanently ordered underneath the older ones. Am I missing something here? The help page doesn't have much to go on and a cursory search of the forums here only seems to bring up bugs from 5+ years ago. It's entirely possible I'm just an idiot here and overlooking something but forcing the player to move their tokens out of the way to be able to select the crosshairs token around really breaks this feature for me and I'll have to completely rethink how I'm going to implement this if I've run into a wall here.
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I think toFront/toBack is still just broken from 5+ years ago. I've had the same issues with trying to use those functions via the API or the context menu.
Sheet Author
I don't remember what the issue was that prompted the change, but player controlled (or is it tokens with sight...) are always on top because players were losing access to their tokens behind overlays, or large npcs.&nbsp; It looks like the wiki has a writeup on how the z-order currently works. <a href="" rel="nofollow"></a>
The Aaron
Forum Champion
API Scripter
It was to make tokens show up above the obscuring darkness of DL and FoW..

Edited 1594401256
Kraynic said: <a href="" rel="nofollow"></a> Yup, there it is. I'm an idiot. :-P My problem is literally the second example listed on that page. Giving the targeting tokens sight fixes the issue and has the added benefit of keeping it from getting lost in dark areas, as The Aaron said, which would have been another issue I hadn't yet thought about. It's going to mess with sight lines a bit but I can live with that given the alternative. Thanks everyone. :-D
The Aaron
Forum Champion
API Scripter
If you're using LDL, you can set the light_losangle to 0 to prevent controllers being able to see from it.&nbsp;
Great idea! Yeah, I've been sticking to legacy while keeping an eye on the progress for the new system to avoid any issues updating later on. Thanks again! :-)