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

LightClosing needs an update.

1. How could the below API be updated to only effect the light sources that can be seen by all? 2. How could the below API be updated to only effect only selected tokens? Thanks.
1412443774
The Aaron
Roll20 Production Team
API Scripter
Well, it will only change the selected token, in the regard that you have to select it to make a change to it. If you only want it to affect tokens with other players see light checked, you can add to the if check: && obj.get('light_otherplayers') Note: players that control tokens with out that check set would not have their light sources affected.
Yes, players that control tokens with out that check set would not have their light sources affected, is what I wanted. ok i am going to make the changes and see what happens. Thanks! When is the Roll20 team going to hire you?
1412452292
The Aaron
Roll20 Production Team
API Scripter
You wouldn't believe how often I hear that. :) I'd love to do that, but the simple unfortunate fact is they would need a bunch more supporters. :/. But I'll do what I can whilst still employed elsewhere! :)
Ok Aaron, I am trying to work my way up to script kitty status, I remember a bit of TRS-80 CoCo basic: line 10 Print "Hello World" line 20 goto line 10 something like that. I tried to add to the original script: <a href="https://gist.github.com/5489058.git" rel="nofollow">https://gist.github.com/5489058.git</a> && obj.get('light_otherplayers') but no joy.
1412458356
The Aaron
Roll20 Production Team
API Scripter
Try changing line 5 to: if(obj.get("left") == prev["left"] && obj.get("top") == prev["top"] && !obj.get('light_otherplayers)) return;
1412459958

Edited 1412461379
I have tested it with other scripts disabled "if(obj.get("left") == prev["left"] && obj.get("top") == prev["top"] && !obj.get('light_otherplayers')) return;" Both unchecked tokens and checked tokens light radials are being reduced. I am looking for a way to have the light of a torch fade while letting tokens with low light sight not be effected.
1412469632

Edited 1412469683
@Aaron, <a href="https://gist.github.com/5489058.git" rel="nofollow">https://gist.github.com/5489058.git</a> changing line 5 to: if(!obj.get('light_otherplayers')) return; seems to work!! Thanks for your help! Jim
1412472555
The Aaron
Roll20 Production Team
API Scripter
Ah. Should have been an || instead of an &&, with the existing part in ( ). That will teach me to code one phone. :)