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

Placing tokens on the map with go "To Back" set as the default setting on the token's character sheet!?

1625169789

Edited 1625169880
PonSquared
Pro
Marketplace Creator
A few months ago there was a thread about this topic:  Permanently save token to front / to back setting . I tried to follow the directions and did my best to puzzle it out but I just could not get it to work. Having tokens set this way would take one small but annoying thing off my plate while I am DMing. I am really at the end of my rope on how to do this!! :/ Could someone who knows how to do this explain it to me in layman's terms?  I'll be forever grateful!!
1625170080
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Do the tokens that are popping to the front have sight and control? They cannot be sent to back in that case.
1625170320
The Aaron
Roll20 Production Team
API Scripter
You're talking about using that script? After installing that script (Here's a video ), set one of the bar's current or max properties, or the name or gm notes, to contain this string: [back] Then set it as the default token for a character.  Dragging that character out should then push the graphic to the back. There is an edge case with player controlled tokens: player controlled tokens are always on top for the controllers, regardless of their sorting order.
Now I need to find 'that script' it would be perfect for the orbital condition markers I use, pull one out put it over a character/monster token and instantly it goes to the back not blocking access to the token.
1625173373
PonSquared
Pro
Marketplace Creator
on('ready',()=>{ const lookWhere = [ 'bar1_value', 'bar1_max', 'bar2_value', 'bar2_max', 'bar3_value', 'bar3_max', 'name', 'gmnotes' ]; const regex = /\[back\]/i; const DELAY = 100; on('add:graphic',(obj)=>{ let id = obj.id; let limit = 10; const check =()=>{ let graphic = getObj('graphic',id); if(graphic){ if(lookWhere.find(k=>regex.test(decodeURIComponent(obj.get(k))))){ toBack(obj); } } else if (--limit){ setTimeout(check,DELAY); } }; setTimeout(check,DELAY); }); });
1625173604

Edited 1625173681
PonSquared
Pro
Marketplace Creator
Okay!  Thank you so much for the directions  keithcurtis   &  The Aaron !!  I was able to get it mostly working.  Ideally, I'd like to but the [back] tag in the gmnotes section so I can hide it on the map.  Unfortunetly this didn't work for me but I was able to get it to work when I put [back] in the HP bubble/bar/green circle.  Its annoying that the [back] shows up to me every time I move the token but it now does default "to back" so main goal achieved!!  Now, if there was only some way to hide the HP bubbles/bar/green circle from the DM... Thanks again for the fantastic script and the directions on how to get it working!