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 .
×

[Script] Checklightlevel - Token is being reported as within dim or bright light when it is not.

1796144077

Edited 1796144134
When I use !checklight  to verify what light condition a token is in, it reports that it is in dim and/or bright light even when the light sources are behind DL barriers. I've tried this on several map pages that have DL enabled and different DL barriers in place.  I've also tried it with different tokens with different vision settings. The following screen shots show the problem: The token named Vári is in a room with a closed door and a curtained window. There are light sources in adjoining rooms and on the other side of the wall with windows, but not within the room that the token is in. GM View - Light Layer: GM view - Object Layer: Player View: Token Menu:
1796150500
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Confirmed. CheckLightLevel is a community script, but I'll see if I can do some investigation.
1796151648
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Weird. I have looked at the code, and I don't understand how this ever worked. The script only checks path objects for light blocking, the kind created by legacy games. There is nothing in the code to deal with pathv2, which has been the "Jumpgate" object for several years. I have confirmed that the script works with older 'path' maps. I'm wondering if I only tested my LightMonitor script on older maps??? I'll see if I can contact the author, Oosh.
1796152462

Edited 1796194972
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
In the meantime, you can temporarily run this patch. Warning, this code patch was created solely by Claude. I have tested it and it works, but have not really taken the effort to fully understand the code. I have still got an outreach to the author. to use this, disable the current checkLightLevel script and load this one manually. I have removed my interim code. Oosh has provided an official update below, which will be merged soon.
1796161108

Edited 1796221189
Thanks Keith, I'll try the patch the next time i go into the game. The last time i tryed the Light Meter script was in a game created before Jumpgate then converted. This current game was created using Jumpgate right from the start, though before Jumpgate become standard. keithcurtis said: In the meantime, you can temporarily run this patch. Warning, this code patch was created solely by Claude. I have tested it and it works, but have not really taken the effort to fully understand the code. I have still got an outreach to the author. to use this, disable the current checkLightLevel script and load this one manually.
1796166626

Edited 1796167619
Oosh
Sheet Author
API Scripter
Thanks for the heads up, Keith. There's a new version here  - the fix itself is probably much the same as Keith's, but also fixed a couple of pre-existing bugs. And added a --dmOnly option if you want players to be able to run it. Edit - oh... I had no memory of this being in the one-click. Submitted an update there as well.
1796169451
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thank you, Oosh! The merge is fairly overdue, possibly due to the holiday, so hopefully it will happen soon.
1796224790

Edited 1796224904
I replaced checkLightLevel with Oosh's new code. The situation improved but there are still problems. It appears to me that it's now recognizing the DL barriers, but not closed doors and curtained windows. I hope these screen shots show what I mean (in all 4 of the positions shown, the player view shows the token only being able to see with the 5% daylight mode setting. Dim light is defined as 55% for the Light Meter MOD):