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

Hard-coding token ids into a macro

Hello all, I have a couple tokens on a page that I would like to be able to adjust via a macro without having to select them, as they are on the map layer, to save time. They are not associated with a character sheet. I can easily do so using the amazingly wonderful TokenMod API script, but I don’t know the best way to get their token IDs to hard-code them into the macro. I was thinking maybe I could use TokenMod to write their token ID into bar1 or somewhere else I could then read manually to set up the final macro.  Another option would be to create associated character sheets for both of them, but that is a clunky solution. Is there an easier way to do what I want that I am missing? Thank you for your time!
1524662753
The Aaron
Pro
API Scripter
/w gm @{selected|token_id} Try that?
Oh yeah, duh. And thanks!  I knew there was something obvious I was missing. 😝 I’ll definitely try that the next time I’m on something other than my iPhone. 😉
1524662963
The Aaron
Pro
API Scripter
Something I've used in the past that might be useful is assigning all the tokens to the same character and using its character id.  In the past I had a bunch of translucent footprints (showing a path that the ranger might find) on the GM layer.  With all the different footprint graphics assigned to represent a single character, you can issue a TokenMod command to that character's id and it will adjust every token that represents it: !token-mod --set layer|map --ids @{Hidden Trail|character_id}
1524663029
The Aaron
Pro
API Scripter
Joe M. said: Oh yeah, duh. And thanks!  I knew there was something obvious I was missing.  I’ll definitely try that the next time I’m on something other than my iPhone.  I actually wrote a very nice script for printing the ids of tokens which I included on the Ammo script... before I discovered I could just whisper them. =D  (I still suspect that wasn't always the case!!!  =D )
The Aaron said: Something I've used in the past that might be useful is assigning all the tokens to the same character and using its character id.  In the past I had a bunch of translucent footprints (showing a path that the ranger might find) on the GM layer.  With all the different footprint graphics assigned to represent a single character, you can issue a TokenMod command to that character's id and it will adjust every token that represents it: !token-mod --set layer|map --ids @{Hidden Trail|character_id} In this case with just two separate map objects that each need different handling, this seems like overkill, but I’ve copied this macro for use in the future. :-)