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

Change Sight Cone?

Hey all, Is there a way to easily make an API script that, if I targeted a set of tokens, I could type a number of degrees and have it change the "Angle: " field in the token's vision section? The reasoning is that when my players are in town, I want them to be able to see 360 degrees at all times, but when they go into dungeons, I want to move it down to 150 so directional sight matters when they are going through a dark crypt so I can have things sneak up on them and appear out of the corner of their eyes. This is the specific field I want to be able to change to 150 or 360 based on a command in chat when highlighting their tokens:
1537026558

Edited 1537026577
GM Michael
API Scripter
You'll be wanting to use this field of the tokens.  From the wiki light_losangle "360" Angle (in degrees) of the field of vision of the graphic (assuming that light_hassight is set to true)
1537026625

Edited 1537026771
Ziechael
Forum Champion
Sheet Author
API Scripter
TokenMod will handle this nicely for you :)
Ohhh nice! Thank you!
1537032255

Edited 1537042318
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Here is a nice Light macro for token mod that should handle many of your needs (by Ziechael and enhanced by the Aaron, author of TokenMod): !token-mod --set ?{Vision|Torch, light_radius#40 light_dimradius#20 light_hassight#yes light_angle#360 light_otherplayers#yes|Hooded Lantern, light_radius#60 light_dimradius#30 light_hassight#yes light_angle#360 light_otherplayers#yes|Bullseye Lantern, light_radius#120 light_dimradius#60 light_angle#60 light_hassight#yes light_otherplayers#yes|Lamp, light_radius#30 light_dimradius#15 light_hassight#yes light_angle#360 light_otherplayers#yes|Candle, light_radius#5 light_dimradius#=0 light_hassight#yes light_angle#360 light_otherplayers#yes|Darkvision, light_radius#60 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Darkvision (90'), light_radius#90 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Warlock Devil's Sight, light_radius#120 light_dimradius#=120 light_hassight#yes light_angle#360 light_otherplayers#no|No light source(Dusk), light_radius#120 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Fog, light_radius#200 light_dimradius#=5 light_hassight#yes light_angle#360 light_otherplayers#no|No light source, light_radius#5 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Blinded, light_hassight#no light_angle#360 light_otherplayers#no} Your specific code for a bullseye lantern is:  !token-mod --set  light_radius#120 light_dimradius#60 light_angle#60 light_hassight#yes light_otherplayers#yes
1537040286
The Aaron
Pro
API Scripter
(Technically Ziechael made that macro, I’ve just expanded and publicized it!)
1537040404

Edited 1537040417
The Aaron
Pro
API Scripter
Also of interest, if your tokens naturally face down, you can align them with the light like this: !token-mod --on hflip vflip --set rotation|180
1537042815
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The Aaron said: (Technically Ziechael made that macro, I’ve just expanded and publicized it!) Fixed. I use a Chat menu version myself, but that's harder to share, being dependent on a Roll Template. Here's my code for dropping into the roll template of your choice, if you prefer buttons to drop downs: **Light & Vision** [Snuff](!token-mod --set light_otherplayers|off light_radius|0 light_dimradius|0 light_angle|360) | [Sight](!token-mod --on showname light_hassight light_angle|360) | [Blind](!token-mod --off showname light_hassight light_angle|360) | [Spot](!token-mod --set light_otherplayers|on light_radius|5 light_dimradius|0 light_hassight|on light_angle|360) | [GM](!token-mod --set light_otherplayers|off light_hassight|off light_radius|5 light_dimradius|5 light_angle|360) [Candle](!token-mod --set light_otherplayers|on light_radius|5 light_dimradius|0 light_angle|360) | [Lamp](!token-mod --set light_otherplayers|on light_radius|30 light_dimradius|15 light_angle|360) | [Torch](!token-mod --set light_otherplayers|on light_radius|40 light_dimradius|20 light_angle|360) [Hooded Lantern](!token-mod --set light_otherplayers|on light_radius|60 light_dimradius|30 light_angle|360) | [Bullseye Lantern](!token-mod --set light_otherplayers|on light_radius|120 light_dimradius|60 light_angle|90) [Darkvision](!token-mod --set light_otherplayers|off light_hassight|on light_radius|60 light_dimradius|0 light_angle|360) | [DV90](!token-mod --set light_otherplayers|off light_hassight|on light_radius|90 light_dimradius|0 light_angle|360) | [DV120](!token-mod --set light_otherplayers|off light_hassight|on light_radius|120 light_dimradius|0 light_angle|360) |  [*Light*](!token-mod --set light_otherplayers|on light_radius|40 light_dimradius|20 light_angle|360) | [*Daylight*](!token-mod --set light_otherplayers|on light_radius|120 light_dimradius|60 light_angle|360) | [*Faerie Fire*](!token-mod --set light_otherplayers|on light_radius|1 light_angle|3600 light_dimradius|0 statusmarkers|purple light_angle|360)