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

[Help] [API Newbie] make same edit to properties of all tokens?

So, first off, I'm an idiot. Set default token properties to "Has sight", "Light to 60, dim at 30" and "All players see light" before adding player tokens to some maps, and then forgot to change it back. Long story short, I just designed a map where every carefully placed and layered blade of grass, every tree, and every rock glows brightly, and can see. Creepy in theory, but effectively deactivates lighting. So, rather than manually edit every layered tile in the whole map (whimper) can anyone steer me towards how to loop though everything and set no sight and no light with an API script?  I have some coding experience, but haven't even looked into coding Roll20 before. Thinking something along the lines of (psudocode for the win) New chat command !resetLighting    for each token in map          token.light=0          token.dim=0          token.sight=false          token.playersSeeLight=false Is this feasable?
1501922318
Ziechael
Forum Champion
Sheet Author
API Scripter
TokenMod can do all this for you :)
Ziechael said: TokenMod can do all this for you :) I looked at TokenMod - while it can set the desired attributes, it looks like it needs a list of IDs to edit - is there a way to get it to mod every token on the map that I am missing?
1501923791
Jakob
Sheet Author
API Scripter
TokenMod works on selected tokens as well as ids, so just rubberband everything on a layer and you'll be good.
Jakob said: TokenMod works on selected tokens as well as ids, so just rubberband everything on a layer and you'll be good. That makes perfect sense. Thanks!
And everything is now fixed. Thanks all. It's funny, I ran across TokenMod about a week ago, thought "That looks cool and super-powerful, but I can't think of a situation in which I'd actually use it" and here is has already saved me from a long tedious map edit and restructure. Thanks again to everyone who suggested it.