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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Give Players ability to toggle overlay image

Hi everyone! I’d like to give my players the ability to toggle an overlay on the map on/off via a switch, basically an on/off button. These are zone boundaries that subdivide a base map: the boundaries are actually one or more transparent PNG files. Is there a command that allows players to do this? Maybe by putting everything on the map layer and just changing the base image with something like “Bring to Front” or “Send to Back”. I have a Pro subscription, so API-based solutions are welcome.
That can definitely be done with TokenMod and Metascripts. I’d set the command to switch the overlay images between the Map layer and the GM layer.  I’m not home at my computer at the moment, but it’s basically an {&if} command to detect if the image is on the Map layer already, and move it to the GM layer, or else if not then move it to the Map layer. You’d use {&select} to select the overlap images, and you could easily choose them if you name them something with ‘Overlay’ in the name. 
1766426879
Gold
Forum Champion
I believe you can do that with TokenMod, a powerful API Mod script. You can definitely set up TokenMod to give the GM a macro button to quickly do that. I'm not exactly sure how to set that up for Players to be able to do it. You can configure TokenMod to allow Players to use TokenMod macros affecting tokens they don't personally control, so that's a good step in the right direction... But in my thinking the issue comes that your Boundary graphics may be so large that they need to be on Map Layer (and thus would be out-of-reach for Players to click), whereas if you put the Boundary graphic on the Token Layer then it might bury the Character tokens when the Boundary graphic is brought to-front. This might be overcome since Roll20 should let them select their own token anyway (even if it is underneath the Boundary graphic) but this will require some testing to be sure. Hopefully you can experiment and figure a way or someone else will come along to help. 
1766434761
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Yup, this is very doable with TokenMod. Here is an example from my campaign city map, showing City guard Precincts, Carriage Routes, Undergraound Habitations, and Racially defined neighborhoods (it's in an uneasy state of blending after a big war). Here is the macro I use for this map: /w gm &{template:npcaction} {{rname=High Harbor Map Overlays}} {{description=[None](!token-mod --ignore-selected --set currentside|1 --ids @{HHOVERLAY|character_id}) [Ash Guard Wards](!token-mod --ignore-selected  --set currentside|2 --ids @{HHOVERLAY|character_id}) [Carriage Routes](!token-mod --ignore-selected  --set currentside|3 --ids @{HHOVERLAY|character_id}) [Underground](!token-mod --ignore-selected  --set currentside|4 --ids @{HHOVERLAY|character_id}) [Races](!token-mod --ignore-selected  --set currentside|5 --ids @{HHOVERLAY|character_id}) *[repeat this menu](~Site|High-Harbor-Overlays)*}}
1766435333
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
In the above example, the overlay is a multisided token with each overlay on a different side. The overlay token is linked to a character named "HHOVERLAY" so that it can be found by token mod by calling the character ID. This means it can be run without selecting the overlay itself, allowing it to reside safely on the map layer. !token-mod --ignore-selected  --set currentside|3 --ids @{HHOVERLAY|character_id}) --ignore-selected Ignore whichever tokens happen to be selected. This allows the macro to be set as a token macro. meaning the players have access to it whenever there is a token they can control on the scree (All of the sites are selectable, linked to a play-controlled characert named "Site) --set currentside|3 Selects which side of the rollable token to show --ids @{HHOVERLAY|character_id}) Tells the script which token to affect (as described above) I have a similar system set up for my campaign world map.
Thanks everyone for the replies! Keith, your method seems the most effective to me… the only downside is having to create a character sheet for each map. I’m running a Pendragon campaign and I’d need at least 4–5 of them to cover the different regions of Britain… but yeah, yours still seems like the best approach.
1766508086
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
4-5 characters is very little overhead, especially if you never enter any data in the sheet tab, but just use it for the Abilities.