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

issue with the torch script

hey everybody - in looking to circumvent the issues with 5e darkvision, i was looking into the aaron's torch script and the flicker option. unfortunately, when I use it, i am able to give a token a flicker, but it doesn't travel with the token when it moves. additionally, if there is more than one flicker on the map, things start to work very strangely - like the flicker can't be turned off, etc. has anybody run into these issues recently? 
1440255685
The Aaron
Pro
API Scripter
Hmm. I've not run into it. The flicker is a bit processor intensive as it's constantly moving and resizing. What is your browser and general computer specs?
1440256367

Edited 1440258454
Josh A.
Sheet Author
this is at work, chrome Version 41.0.2272.101 m I7 3770 CPU w/ 16gigs of ram I did a little bit of testing too, and im not able to replicate the light not moving with the token now, but I am getting issues with turning it off and on - its not related to there being more than one flicker.  I have 3 tokens set token a - flicker-on 60 30 -> creates light at token a token b - flicker-on 60 30 -> creates light at token b token a - flicker-off -> turns light off (and moves a flicker token to the top left of screen) token a - flicker-on 60 30 -> nothing happens token c - flicker-on 60 30 -> creates light at token c (manually delete flicker token at top left) token a - flicker-on 60 30 -> creates light at token a so basically once a token has a flicker turned off, it can't be turned back on unless the gm finds and manually deletes the old flicker token with testing, it does let you change the light of a flicker that is currently on (i was able to change a token to 60 30, 10 5, and back to 60 30 with no issue)
1440269701
The Aaron
Pro
API Scripter
Weird!  Sounds like a bug. I'll go through and remove the flicker reuse code (it predates the ability of the API to .remove() things) and see if that clears it up. 
1440273163

Edited 1440273474
Kryx
Pro
Sheet Author
API Scripter
I re-wrote Aaron's code as I had similar problems of it not following. <a href="https://github.com/mlenser/roll20/blob/master/modifiedScriptsFromOthers/Torch.js" rel="nofollow">https://github.com/mlenser/roll20/blob/master/modifiedScriptsFromOthers/Torch.js</a> I stopped using it because of conflicts, but I should start using it again now that I've fixed those. It looks like it could use a few touchups.
1440277482

Edited 1440349602
Josh A.
Sheet Author
Kryx that code throws an error immediately upon saving&nbsp; Only other script on at this point is the aaron's IsGM() script
1440278135
Kryx
Pro
Sheet Author
API Scripter
Josh A. said: Kryx that code throws an error immediately upon saving&nbsp; Then go ahead and ignore it. I keep hoping aaron will rewrite his torch in several regards: so that the flicker is much more subtle like I have written. torch is removed instead of moved to top left Daytime/nighttime stuff works (he may have updated this since I wrote my version) flicker follows without problem I don't really want to dedicate time to torch right now as I'm working on other stuff for my campaign.
hopefully he will, we'll see :) a non-animated toggle would be nice too in case people have weak systems - i know i often run it on my ancient laptop lol. if nothing else maybe your code will make it easier for aaron to update it&nbsp;
1440364650
The Aaron
Pro
API Scripter
Josh, try this version: &nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/To" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/To</a>... It now cleans up flickers when they are removed, instead of moving them to the upper left corner of the GM layer. I added a command !global-light which toggles Global Illumination similar to the way !daytime works. &nbsp;Don't really have time to devote to a full rewrite right now, but let me know how that works for you.
I haven't thoroughly tested but an initial pass over it seemed to work great. Thanks!
1440601881
The Aaron
Pro
API Scripter
Good deal! =D
1440629471

Edited 1440629739
Kryx
Pro
Sheet Author
API Scripter
I've rewritten my torch script. I've named it "vision" so I can expand it to other types of vision. Code Youtube of it in action Todo: More cleanup Allow custom torch light radius sizes (may work already) Allow torch to not flicker Add other vision types - darkvision, tremorsense, etc Current commands are "!torch" which turns a torch that follows a token on or off. "!day" which turns globalillumination on "!night" which turns globalillumination off I'll make my own post when it's in a more complete state.
1440638187
vÍnce
Pro
Sheet Author
The Aaron said: Josh, try this version: &nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/To" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/To</a>... It now cleans up flickers when they are removed, instead of moving them to the upper left corner of the GM layer. I added a command !global-light which toggles Global Illumination similar to the way !daytime works. &nbsp;Don't really have time to devote to a full rewrite right now, but let me know how that works for you. Cool. &nbsp;Any reason to use !daytime and !nighttime now?
1440639586
vÍnce
Pro
Sheet Author
Kryx said: I've rewritten my torch script. I've named it "vision" so I can expand it to other types of vision. Code Youtube of it in action Todo: More cleanup Allow custom torch light radius sizes (may work already) Allow torch to not flicker Add other vision types - darkvision, tremorsense, etc Current commands are "!torch" which turns a torch that follows a token on or off. "!day" which turns globalillumination on "!night" which turns globalillumination off I'll make my own post when it's in a more complete state. I'm assuming this is still very close to Aaron's !torch script? &nbsp;I'm an idiot, so It was hard for me to tell what your vid was demonstrating. &nbsp; I would really like access to toggle a token's "Has sight-angle and multiplier". &nbsp;That would be very handy to Blind my players(...and npc's) while keeping them constrained by any DL barriers. &nbsp;I'll throw this suggestion at Aaron's !token-mod script as well.
1440640390
The Aaron
Pro
API Scripter
I think you can adjust those in TokenMod already? &nbsp;Maybe? re: day time/night time -- probably not. They do different things, but they were a poor man's global illumination before it existed.&nbsp;
1440643048
vÍnce
Pro
Sheet Author
The Aaron said: I think you can adjust those in TokenMod already? &nbsp;Maybe? re: day time/night time -- probably not. They do different things, but they were a poor man's global illumination before it existed.&nbsp; I was using them before to simulate global lighting. &nbsp;But now that you've added !global-light it appear they are no longer needed. &nbsp;
1440661026
Kryx
Pro
Sheet Author
API Scripter
Vince said: I'm assuming this is still very close to Aaron's !torch script? &nbsp;I'm an idiot, so It was hard for me to tell what your vid was demonstrating. &nbsp; I would really like access to toggle a token's "Has sight-angle and multiplier". &nbsp;That would be very handy to Blind my players(...and npc's) while keeping them constrained by any DL barriers. &nbsp;I'll throw this suggestion at Aaron's !token-mod script as well. It's quite similar currently, ya. But mine uses his code model in the turn marker to have the torches follow you. That never seemed to work on the torch script.&nbsp;Plus my flicker is quite different. The video shows the flickers - look in the middle where the light meets and you'll see the torches expanding/contracting. Blinding: sight angle and multiplier might be best as no sight people can move through DL as you mentioned in another thread. I can easily add that.