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

A Little Macro Help

I'm using the Token Mod script and the macro below to control lights in my game. I've attached the lights that I want to control to a generic character called Lights 1. I want to create a light switch character that uses the "Lights" macro on the "Lights 1" character. !token-mod --set ?{Vision|Off, emits_bright_light#false emits_low_light#false|On, emits_bright_light#false emits_low_light#true low_light_distance#20|} Simplified: I want that macro to target all tokens that represent a generic character. Is that possible and how? Thanks in advance!
1589458177
The Aaron
Roll20 Production Team
API Scripter
Absolutely possible.  You can specify a character ID using the --ids argument and all tokens that represent that character will be affected: !token-mod {{ --set ?{Vision|Off, emits_bright_light#false emits_low_light#false|On, emits_bright_light#false emits_low_light#true low_light_distance#20|} --ids @{Lights 1|character_id} }}
That's perfect! So, to let everyone know what I'm using it for so it can help others, I'm running a modern Werewolf: The Apocalypse game and my players are searching a building. I've created a character called "Lights" and attached it to every light. I then created a "Light Switch" character and gave it that macro as a token ability. I created each character for every room I wanted a light switch in, then targeted the light character for that room with the switch for that room. i.e. "Lights 1, Light Switch 1, Lights 2, Light Switch 2, etc". It's a lot of lights sometimes and it's a big map, so it's definitely slowing the game down. Hopefully it won't be too bad once I'm done placing and the function will hopefully add to the game and not detract from it. I'll let you know after the game tomorrow if the feature is something the players liked or not.