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

API Torch stopped working

Hello! I have a problem.  I read that dimming light with a negative number was even more effective. So I thought to try that with the Flickering effect on Torch... it seems that "broke" the API, as now the API is not working and I get this message: " n must be non-negative undefined ". I have tried disabling the Torch API and that makes it stop showing the error (so the rest of the APIs seem to be working all right. But when I activate Torch again, it gives the same issue. Deleting the Torch API and installing it again from scratch has the same result. Can you guys think of a possible solution to this? Thanks in advance for your help. Best, Edward
Ok, I could fix it by removing all the tokens that I had altered. Not a fancy solution (I had plenty of them as it was a big map), but it solved the issue...
1588596256
The Aaron
Roll20 Production Team
API Scripter
Hmm. That's odd. Can you paste the command you ran do I can try and duplicate the issue?
Hi Aaron (I take profit of the opportunity to thank you for all your amazing work here and to congratulate you).  The command was  !flicker-on -5 0  Now I see it didn't have much sense. It could more or less have sense to have a negative on the second item, though, but not on the first one. Sorry about that!!!
1588625562
The Aaron
Roll20 Production Team
API Scripter
Ah, great!  Yeah, -5 / 0 would probably result in no light.  0 / -5 might do something.  It sounds like you have things working for you now?  If that's not the case, definitely let me know.
Yes, everything is working. The weird thing is that  !flicker-off couldn't fix the issue. If I had a token with the "bad instruction", it would "break" the API and Roll20 would disable all the APIs. So, the only solution to solve the issue is to delete all the tokens and put new ones again... Thanks for following up!
1588635776
The Aaron
Roll20 Production Team
API Scripter
Ah, I tracked that down to a bug in randomInteger() which causes it to crash if it gets a value less than 0.  I've fixed that in Torch, but I can't release it yet because it has incomplete UDL changes I need to test.
Wow, that was fast!!! Good work, Aaron!!! Thanks for that!!! I'll be waiting for the update... 😉😉😉 
Aaron, I have a question that you might be able to answer. For modern or futuristic settings, it would be great to have the kind of flickering a fluorescent tube makes.  I think that, if this could be possible, it could be done by having the token use the normal Flicker effect that you have in your Script, but changing the radius value every now and then to 0 and back to the original number again. Now, I think this from a total lack of knowledge of programming, APIs, scripts, etc. I just leave this as an idea just in case you find it appealing... ;) Best!
1588706309
The Aaron
Roll20 Production Team
API Scripter
That is a thing that could be done, pretty much the way you stated.  I'll have to look at adding that at some point.