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

Dynamic Lighting - Night Vision question

Can anyone think of a way to automatically disable a token's night vision when the token is within the radius of a light source? Cheers Ray
1650150816
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
A script could be done for it. What is the problem you are trying to solve (ignoring the "how" at the moment)? There may be other ways to accomplish it.
1650387974

Edited 1650388263
Ray
Pro
keithcurtis said: A script could be done for it. What is the problem you are trying to solve (ignoring the "how" at the moment)? There may be other ways to accomplish it. I am trying to simulate the 1st edition AD&D interpretation of infravision as described on page 102 of the PHB... "As previously mentioned, infravision is the ability to see into the infrared spectrum. Thus heat radiation becomes visible and differences in temperature allow infrared sight. Warm things are bright, cool things grey, very cold things are black. Most infravision extends to 60' distance. Dungeon-dwelling monsters have infravision to 120'. All infravision is spoiled if a light source is shedding illumination upon the creature possessing the infrared sight capability . Similarly, great heat will spoil the capability." So I'm looking for a way to automatically turn off the token's night vision if the token is within the radius of another token that is emitting either bright or dim light...and by extension, turn it back on again when the token moves out of the light radius. I am currently using Tokenmod to switch the tokens manually between normal sight and infravision: visionnormal macro !token-mod --set has_bright_light_vision|on has_night_vision|off night_vision_distance|0 night_vision_effect|none night_vision_tint|transparent visioninfravision macro !token-mod --set has_bright_light_vision|on has_night_vision|on night_vision_distance|60 night_vision_effect|nocturnal night_vision_tint|#666666 The tint helps to simulate the "infravision / nightvision" effect that I want the players to see on the VTT.
1650394458
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Ah, I see the problem. At first I thought that just being in the light would be enough: you see what everyone sees. But RAW, if you are at the edge of bright light, you can't use infravision in the other direction to peer into the darkness beyond? Hmm... There's a Paladin Aura script in the Repo that toggles save bonuses on and off when a token is within range of a friendly paladin. I don't see why it couldn't be re-written to toggle vision settings on or off when within a certain distance of a bright light source. I'm pretty sure the geometry math is beyond me, but it might be worth asking on the API forum if anyone knows how it could be done, or is willing to take a stab at it. Assuming you don't have the JavaScript-fu yourself, of course.
1650394527
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Looking at the instruction on that script, it seems it sends a reminder to the player of the save bonus, not toggles the setting on their sheet. Still, if the script can send a message, it should be able to toggle token settings.
keithcurtis said: Ah, I see the problem. At first I thought that just being in the light would be enough: you see what everyone sees. But RAW, if you are at the edge of bright light, you can't use infravision in the other direction to peer into the darkness beyond? Exactly, RAW exposure to a light source "blinds" infravision...so I'm looking to simulate that.
keithcurtis said: Ah, I see the problem. At first I thought that just being in the light would be enough: you see what everyone sees. But RAW, if you are at the edge of bright light, you can't use infravision in the other direction to peer into the darkness beyond? Hmm... There's a Paladin Aura script in the Repo that toggles save bonuses on and off when a token is within range of a friendly paladin. I don't see why it couldn't be re-written to toggle vision settings on or off when within a certain distance of a bright light source. I'm pretty sure the geometry math is beyond me, but it might be worth asking on the API forum if anyone knows how it could be done, or is willing to take a stab at it. Assuming you don't have the JavaScript-fu yourself, of course. As you said, it would be great if the script could toggle the bonus rather than just sending a reminder. Also, I saw somewhere that this script was only working on maps where the scale is in feet and not in meters (old continent request lol), and I think that layton is no longer a pro... I'd love to use this script but without these 2 functionalities, i'd rather not... If anyone have time to work on a patch, the old continent citizens woul thank him with great respect :):)