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

API for lighting?

I've been trying to get some API scripts working with TokenMod so I can automatically set different lighting mods. I have found one that I absolutely love but it doesn't seem to work. Is this because it is incompatible with the updated lighting settings? Macro: ?{ Light/Vision options: |Normal vision,!token-mod --set light_radius#1 light_dimradius#0 --on light_otherplayers |Off,!token-mod --set light_radius#0 light_dimradius#0 --off light_otherplayers |Darkvision,!token-mod --set light_radius#60 light_dimradius#=-5 --off light_otherplayers |Candle,!token-mod --set light_radius#10 light_dimradius#7 --on light_otherplayers |Lamp,!token-mod --set light_radius#30 light_dimradius#17 --on light_otherplayers |Torch/Light Cantrip,!token-mod --set light_radius#40 light_dimradius#22 --on light_otherplayers |Hooded Lantern/Bonfire,!token-mod --set light_radius#60 light_dimradius#31 --on light_otherplayers |Daylight Spell,!token-mod --set light_radius#120 light_dimradius#61 --on light_otherplayers } Thanks!
1610547984
David M.
Pro
API Scripter
You will have to use the following parameters for it to work with UDL From the token-mod help handout: Updated Dynamic Lighting has_bright_light_vision  is the UDL version of  light_hassight . It controls if a token can see at all, and must be turned on for a token to use UDL. You can also use the alias  bright_vision . has_night_vision  controls if a token can see without emitted light around it. This was handled with  light_otherplayers  in the old light system. In the new light system, you don't need to be emitting light to see if you have night vision turned on. You can also use the alias  night_vision . emits_bright_light  determines if the configured  bright_light_distance  is active or not. There wasn't a concept like this in the old system, it would be synonymous with setting the  light_radius  to 0, but now it's not necessary. You can also use the alias  emits_bright . emits_low_light  determines if the configured  low_light_distance  is active or not. There wasn't a concept like this in the old system, it would be synonymous with setting the  light_dimradius  to 0 (kind of), but now it's not necessary. You can also use the alias  emits_low .
1610551501
The Aaron
Roll20 Production Team
API Scripter
Here's a full discussion of it on the TokenMod thread:&nbsp;<a href="https://app.roll20.net/forum/permalink/9064542/" rel="nofollow">https://app.roll20.net/forum/permalink/9064542/</a>
Thank you very much! Little bit overwhelmed with the new toys of API scripting as I am new to Roll20. Will definitely experiment and check out that full discussion.