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

Setting an angle of dim within an angle of sight?

I like restricting sight for both the tactical implications as well as the aesthetic effect. I also really like the dim effect implemented in this game for the same reasons. It looks much more natural and there are often situations where "I can tell something's there, but I can't tell what". Similarly, I like experimenting with limited angle of sight (depending on the system - restricted sight makes more sense when the time scale is reduced). Anyway, I find the sudden shift from full sight to black at the angle of sight to be jarring. I think a dimming effect within the line of sight (for example, sight at 160 and dimming at 80 degrees), would feel really cool, representing peripheral vision in a natural way. I know we have access to the angle and distance variables for light, vision and dimming, listed in the API:Objects section, but I was wondering if there was a way to program a dim effect at angle as well as distance. My understanding of programming is pretty elementary, so I can't tell if this is within the range of doable. Any guru's out there have some ideas?
1453302964
The Aaron
Pro
API Scripter
So, there is nothing natively in the API to allow you to do that.  There is a hack you could do to simulate it, though it would only add 2 jarring transitions (full light to dim, dim light to black).  You'd need to have a second token which the API manages following your primary token around, and put a light source on it which is the same radius, but dim starting somewhere like -5, and a slightly larger field of view angle.  You'd need to keep various control and sight options in sync and some other details, but it would be scriptable.  I'd suggest manually setting up some tokens like that and see how you feel about the effect before trying to get the script written.  =D
1453305291

Edited 1453305334
The Aaron said: So, there is nothing natively in the API to allow you to do that.  There is a hack you could do to simulate it, though it would only add 2 jarring transitions (full light to dim, dim light to black).  You'd need to have a second token which the API manages following your primary token around, and put a light source on it which is the same radius, but dim starting somewhere like -5, and a slightly larger field of view angle.  You'd need to keep various control and sight options in sync and some other details, but it would be scriptable.  I'd suggest manually setting up some tokens like that and see how you feel about the effect before trying to get the script written.  =D I had a hunch that this was a no-go. Though your solution is very clever, and I'm a little ticked I didn't think of it myself :/ I just took a look, and it certainly isn't as smooth as the gradient dimming with distance. It looks more like a flashlight then peripherals lol. There's also the inconsistency when you add dim on distance - the peripheral field goes full black several feet before your center field does. I suppose this is actually appropriate for peripherals, but again, the result is a bit blocky - two arches that don't align when they meet (wheras a realistic example would be a perabola???? This is making me analyze my perception in weird ways XD). Anyway, I can't decide if it's worth it or not, but I am learning JS, and looking for some challenges so maybe I'll tackle this one. Edit: I didn't give a proper thank you for the response. Thanks!
1453315142

Edited 1453315157
The Aaron
Pro
API Scripter
No worries. =D  If you want to look at scripts that do similar things, look at my Torch, Bump, and Facing scripts.  They all feature API created tokens that follow other tokens around.  And definitely ask if you have any questions! =D
The Aaron said: No worries. =D  If you want to look at scripts that do similar things, look at my Torch, Bump, and Facing scripts.  They all feature API created tokens that follow other tokens around.  And definitely ask if you have any questions! =D Will do. Thanks for the advice!