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

New to API - need a script to cause time/distance decay for a torch/lantern token

So, not sure if this is possible. I've seen the Darkness Closes In API script that causes a 10% loss on movement of a token. However, there's no instructions or intuitive manner to assign this to a specific token? Is it a blanket script that causes any moving light source to decay? Or is there some variable in the script to define the name of the token. For example, I have a "Torch" and "Lantern" tokens, which would be my only decaying-over-time light sources right now in my module. Is it possible to run a script that only focuses on those tokens when in use? And how would a time decay work? The PHB says the torch lasts for 1 hour, but of course in real time that wouldn't work well because in-game time isn't quite the same. How does the 10% loss script work for movement? How far does it have to move for it to lose 10% of its light? Thanks for your patience. These are definitely noob questions, but I'm not a programmer. I've been searching around and only found that one script, but not sure how it functions or if it's a blanket decay for all light sources. That wouldn't make much sense because I have a sorcerer who uses the Light spell a lot, and it doesn't decay...it lasts just as bright until she dispells it or the 1 hour time limit runs out. So the script needs to target specific tokens on the board. Thanks in advance! New to Pro, and loving the dynamic lighting and all the amazing things here. Truly a revolutionary system for players who can't get together geographically!
1499373822
The Aaron
Pro
API Scripter
If you're talking about the version I threw out in the repo, you can run: !DarknessClosingIn To toggle it on or off.  It will adjust the radius on any token that is moved. That was a demo script of Riley's, I just converted it to a slightly more useable form as a demonstration to someone quite a few years ago...  As for how you might manage that in a more fit-to-purpose script, that would depend greatly on the interface.  I'd say ideally, you'd create some system that tracks in-game time, then add some time based event notifications that other scripts could subscribe to or create.  It would be a someone large project and a bit subjective, but we could certainly discuss and flesh out the idea, then maybe someone would pick it up as a project.
Awesome thank you so much, Aaron!
The Aaron said: [...] As for how you might manage that in a more fit-to-purpose script, that would depend greatly on the interface.  I'd say ideally, you'd create some system that tracks in-game time, then add some time based event notifications that other scripts could subscribe to or create.  It would be a someone large project and a bit subjective, but we could certainly discuss and flesh out the idea, then maybe someone would pick it up as a project. I'm using  Timetracker for my in-game time. The current time is stored in the state object. So maybe this could be used as a start?