We use Cookies to help personalize and improve Roll20. For more information on our use of non-essential Cookies, visit our Privacy Policy here.
Accept
Advertisement Create a free account

Torch API not functioning

1596072997
I am currently trying to set up the torch API but cannot seem to figure it out to save my life. I made sure it was installed, I selected a token and tried plenty of different commands including, but not limited to, "!torch", "!torch 40", "!torch 40 20 yes", and "!torch 40 20 yes" <Token ID>. The script seems like it should be really easy to use but none of these have given me any results. I've tried using flicker to no avail, I've tried selecting different tokens and even creating new ones to select to no avail, even deleted the API from my game and reinstalled with no success. I used the built in token emitting light feature on the token to make sure the dynamic lighting wasn't just messing up, but that functioned properly so I'm assuming it's either the torch API or, more likely, a user error of the torch API. The version that is installed is v0.8.13. Is anyone else having an issue just using the torch API? Anyone know what I may be doing wrong? Thanks in advance.
1596074004
The Aaron
Forum Champion
API Scripter
It currently only works with Legacy Dynamic lighting. Are you using Updated Dynamic Lighting?
1596075979
Oh dang it, I do have Updated Dynamic Lighting. Is there a way to make a macro for Updated Dynamic Lighting that could essentially give a selected token 40 feet light emission with 20 feet dim, and to turn those both back to zero? Or would I have to revert to Legacy Dynamic lighting to use the torch API to have that sort of feature?
1596116507
If you use TokenMod you can use the following parameters to control the Updated Dynamic Lighting with macros: !token-mod --on vision toggle: has_bright_light_vision night vision toggle: has_night_vision bright light toggle:  emits_bright_light low light toggle: emits_low_light --set night vision distance: night_vision_distance#0 bright light distance: bright_light_distance#0 low light distance: low_light_distance#0 As an example, this is someone using a torch: !token-mod --on has_bright_light_vision emits_bright_light emits_low_light --set bright_light_distance#20 low_light_distance#20 and this is when the torch has been put out: !token-mod --on has_bright_light_vision emits_bright_light emits_low_light --set bright_light_distance#0 low_light_distance#0 This is someone with 60ft Darkvision: !token-mod --on has_bright_light_vision has_night_vision --set night_vision_distance#60
1596120759
The Aaron
Forum Champion
API Scripter
As Andrew said!
1596122058
Perfect, thank you so much to both of you! Thank you especially for the examples, I’m very fresh into API’s and coding in general so it’s very handy to see written examples.
1596126367
Any time. I'm fairly new to using the API myself, so am enjoying discovering things like that to enhance the VTT experience.
1596205345
I have another question, since it is still related to lighting I'm hoping it's okay to post in here once more. Well two questions really, first, in the new dynamic lighting, what does the "Sharpen Effect" button do in night vision? I can't seem to find an explanation online. Second, does anyone know how to simulate the 5e Warlock invocation "Devil Sight" in roll20, potentially using tokenmod? Basically, if it's dim light they still see dim light but if it's dark they see it dim also, up to 120 feet. As opposed to night vision, where if it's dim light they see it as bright light. Thanks in advance once more!
1596206479
The Aaron
Forum Champion
API Scripter
1) Sharpen Effect is applied to the area within Night Vision range.&nbsp; They just added a switch to turn that filter on and off, which is nice.&nbsp; Here's a pic: The right token has the sharpness effect applied to it by the night vision of the left token.&nbsp; With it turned off, both should look the same.&nbsp; That said, I couldn't get it to turn off, so there may be a bug with it... 2)&nbsp; Your interpretation of Devil's Sight varies from the common on.&nbsp; The common interpretation is that light is irrelevant in the Devil's Sight radius and everything appears perfectly bright.&nbsp; That and ignoring magical darkness are what make Devil's Sight the best sight in the game. <a href="https://www.sageadvice.eu/2018/04/03/does-warlock-devils-sight-see-in-darkness-as-if-it-were-dim-light-or-as-if-it-were-bright-light/" rel="nofollow">https://www.sageadvice.eu/2018/04/03/does-warlock-devils-sight-see-in-darkness-as-if-it-were-dim-light-or-as-if-it-were-bright-light/</a> That has the added benefit of making it much easier to implement on Roll20, it's just bright vision that only the player can see.&nbsp; For your interpretation, you can just set a dim light of the radius desired that only the player can see (LDL), or set night vision with a black tint (UDL).
1596208085
Oh! Thank you for the clarification Aaron, I appreciate it.
1596208331
DMT
Pro
Thanks for this folks, I just signed up for Pro yesterday and installed the torch API. Thought I'd gone mad when it wasn't functioning.
1596209406
The Aaron
Forum Champion
API Scripter
DMT said: Thanks for this folks, I just signed up for Pro yesterday and installed the torch API. Thought I'd gone mad when it wasn't functioning. I suppose I should roll out UDL support for Torch.&nbsp; Last time I tried it, it had some very very strange behavior.&nbsp; Maybe I can do that this weekend.
1596346888
mAc
Pro
Yeah, I was just going to ask about Torch API and UDL. The Torch API is a lifesaver -- managing light sources in roll20 is a nightmare without it. Having it for UDL would be a dream come true.
1596494858
The Aaron said: DMT said: Thanks for this folks, I just signed up for Pro yesterday and installed the torch API. Thought I'd gone mad when it wasn't functioning. I suppose I should roll out UDL support for Torch.&nbsp; Last time I tried it, it had some very very strange behavior.&nbsp; Maybe I can do that this weekend. I just tried to use Your API for the first time, please keep us all updated when you do get it updated.
1596511429
If you're going to update Torch, I prefer it to TokenMod for setting light sources, because using the !flicker-on option generates an invisible token on the map layer, which means that I don't have to mess with the character's vision at all.&nbsp; My only request would be for both a flicker option and a non-flicker option (e.g., if a player has Light cast on their shield, I see that as being a steady glow instead of a flicker) that both use the invisible token feature.&nbsp; Thanks!
1596514776

Edited 1596515381
Victor B.
Pro
Sheet Author
API Scripter
NO PREFERENCES.&nbsp; We need to cater to the greater good.&nbsp; Not to what you want.&nbsp; There's millions of users here.&nbsp; Come on?&nbsp; Oh and the API developers aren't paid for this.&nbsp; It's a gift.&nbsp; Don't ask for preferences
1596550987
Assuming you are talking to Jarren K, but it seems like a normal QoL desire/suggestion/request. If it can be done, and the dev wants to implement, then great. If not, then also cool. Maybe have a snickers.