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

August 22 (9 years ago)
Josh A.
Sheet Author
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? 
August 22 (9 years ago)
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?
August 22 (9 years ago)

Edited August 22 (9 years ago)
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)
August 22 (9 years ago)
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. 
August 22 (9 years ago)

Edited August 22 (9 years ago)
Kryx
Pro
Sheet Author
API Scripter
I re-wrote Aaron's code as I had similar problems of it not following.

https://github.com/mlenser/roll20/blob/master/modifiedScriptsFromOthers/Torch.js

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.
August 22 (9 years ago)

Edited August 23 (9 years ago)
Josh A.
Sheet Author
Kryx that code throws an error immediately upon saving 

Only other script on at this point is the aaron's IsGM() script
August 22 (9 years ago)
Kryx
Pro
Sheet Author
API Scripter

Josh A. said:

Kryx that code throws an error immediately upon saving 
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.
August 22 (9 years ago)
Josh A.
Sheet Author
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 
August 23 (9 years ago)
The Aaron
Pro
API Scripter

Josh, try this version:  https://github.com/shdwjk/Roll20API/blob/master/To...

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.  Don't really have time to devote to a full rewrite right now, but let me know how that works for you.
August 26 (9 years ago)
Josh A.
Sheet Author
I haven't thoroughly tested but an initial pass over it seemed to work great. Thanks!
August 26 (9 years ago)
The Aaron
Pro
API Scripter
Good deal! =D
August 26 (9 years ago)

Edited August 26 (9 years ago)
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.
August 27 (9 years ago)
vÍnce
Pro
Sheet Author

The Aaron said:


Josh, try this version:  https://github.com/shdwjk/Roll20API/blob/master/To...

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.  Don't really have time to devote to a full rewrite right now, but let me know how that works for you.

Cool.  Any reason to use !daytime and !nighttime now?
August 27 (9 years ago)
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?  I'm an idiot, so It was hard for me to tell what your vid was demonstrating.  

I would really like access to toggle a token's "Has sight-angle and multiplier".  That would be very handy to Blind my players(...and npc's) while keeping them constrained by any DL barriers.  I'll throw this suggestion at Aaron's !token-mod script as well.
August 27 (9 years ago)
The Aaron
Pro
API Scripter
I think you can adjust those in TokenMod already?  Maybe?

re: day time/night time -- probably not. They do different things, but they were a poor man's global illumination before it existed. 
August 27 (9 years ago)
vÍnce
Pro
Sheet Author

The Aaron said:

I think you can adjust those in TokenMod already?  Maybe?

re: day time/night time -- probably not. They do different things, but they were a poor man's global illumination before it existed. 

I was using them before to simulate global lighting.  But now that you've added !global-light it appear they are no longer needed.  
August 27 (9 years ago)
Kryx
Pro
Sheet Author
API Scripter

Vince said:

I'm assuming this is still very close to Aaron's !torch script?  I'm an idiot, so It was hard for me to tell what your vid was demonstrating.  

I would really like access to toggle a token's "Has sight-angle and multiplier".  That would be very handy to Blind my players(...and npc's) while keeping them constrained by any DL barriers.  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. 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.