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 .
×

GM Tooltip Visibility via Macros/API

I manage token setup automatically through API tooltips. But after spending all day setting it up, I realized that the tooltips were visible to players by default. API or otherwise, I need a way to toggle the "GM Only" box automatically, without having to go through every single token manually.  How can this be done?
1769824222
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Robert! I believe the Aaron just added this to Token-mod, and it should be available with the next code merge.
Wow, this is really reassuring news! What is a code merge and when do they normally happen? (I don't imagine it will be between now and a saturday-afternoon game, but it can't hurt to ask). I'll keep my eye out for the update. Thank you so much for letting me know. 
1769834719
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
They typically come earlier during the week. When a script author creates or updates a script, they send of a "Pull Request" to the ROll20 GitHub reporistory. The requests are reviewed by someone on the staff, and then "merged" with the existing repo, so that users can install them on their Mod page. I have about three scripts awaiting approval, and I saw that Token-Mod is in there, for the specific reason you mention.
1769865930
The Aaron
Roll20 Production Team
API Scripter
Hi Robert R.! That sounds like it would be onerous to dealwith even when the TokenMod update hits.  If you'd prefer, theres a little snippet that will just hide all tooltips: !hide-all-tooltips Code: on('ready',() => { on('chat:message', msg=>{ if('api'===msg.type && /^!hide-all-tooltips(\b\s|$)/i.test(msg.content) && playerIsGM(msg.playerid)){ let who = (getObj('player',msg.playerid)||{get:()=>'API'}).get('_displayname'); sendChat('',`/w "${who}" Hiding all tooltips...`); let count = 0; let tokens = findObjs({ type:'graphic' }); const burndown = () =>{ let t = tokens.shift(); if(t){ if(false === t.get('gm_only_tooltip')) { ++count; t.set('gm_only_tooltip',true); } setTimeout(burndown,0); } else { sendChat('',`/w "${who}" Hid <code>${count}</code> tooltips.`); } }; burndown(); } }); });
Thank you so much! This absolutely worked for my purposes. By your reckoning, what makes it onerous with Token-Mod? It would be nice to run them as part of the same command, so I'd like to know what the limitations are. 
1770345010
timmaugh
Roll20 Production Team
API Scripter
TokenMod should be up to the task... but you would have to select all of the tokens on the page. If you want to save yourself that level of manual involvement, you could add the Metascript Toolbox script and select everything automatically (right in your TokenMod command line): !token-mod --set gmonlytooltip|true {&select *} (Note: I don't know what the actual TokenMod syntax is for the "gm-only-tooltip" property; this is just to demonstrate adding the metascript tag {&select *} to the command line.)
1770438691
The Aaron
Roll20 Production Team
API Scripter
I just meant you'd have to fix it manually in every page, on every layer, by selecting every graphic if you did it with TokenMod. This script applies it to all tokens on all pages and layers in one go.  You absolutely can toggle it with TokenMod.