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

[Help] Issues with Torch API

I'm relatively new as a Roll20 Pro account and I've been messing around with some API.  Generally I've had good luck with creating macros to call scripts (!group-init for example), but for some reason I'm having a couple of issues with !torch. Issue 1:  I don't seem to be able to use "0 feet" for the Dim Start Light field.  The command !torch 20 10 on Works as expected.  However, the command !torch 20 0 on sets the the radius to 20 and the dim start to 10. Interestingly, I find that the command !torch 60 -5 off (which I use for darkvision) does seem to work.  So I can set the Dim Start to any positive or negative integer, just not 0. Issue 2: I am unable to get even the most basic torch command to work in a macro or on a macro button on the macro bar.  Thinking the issue might be with the token selection I also tried the command with an @{target|token_id}.  When that is included I get the targeting prompt and can select the token, but no change is made to the token.  I've tested the exact text from the macro in the chat window and it works there.  For example, !snuff works in the chat window directly but not in a macro containing only that line (and no trailing spaces or <returns>s which I've see can mess with a macro). Using Chrome on a Acer Laptop if that is relevant. Thank you in advance for your help!
1531785615
The Aaron
Pro
API Scripter
Hmm.  That 0 radius dim start is definitely a bug.  I'll have to look at the others.  Honestly, you might be better off using TokenMod as it can do everything Torch can (except flicker) and more.  I use this command for TokenMod: !token-mod --set ?{Vision|Torch, light_radius#40 light_dimradius#20 light_hassight#yes light_angle#360 light_otherplayers#yes|Hooded Lantern, light_radius#60 light_dimradius#30 light_hassight#yes light_angle#360 light_otherplayers#yes|Bullseye Lantern, light_radius#120 light_dimradius#60 light_angle#60 light_hassight#yes light_otherplayers#yes|Lamp, light_radius#30 light_dimradius#15 light_hassight#yes light_angle#360 light_otherplayers#yes|Candle, light_radius#5 light_dimradius#=0 light_hassight#yes light_angle#360 light_otherplayers#yes|Darkvision, light_radius#60 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Darkvision (90'), light_radius#90 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Warlock Devil's Sight, light_radius#120 light_dimradius#=120 light_hassight#yes light_angle#360 light_otherplayers#no|No light source(Dusk), light_radius#120 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Fog, light_radius#200 light_dimradius#=5 light_hassight#yes light_angle#360 light_otherplayers#no|No light source, light_radius#5 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Blinded, light_hassight#no light_angle#360 light_otherplayers#no}
The Aaron, thanks for the suggestion of using TokenMod.  It works great for me in both the chat line and in a macro.  I have used flicker a bit but only for mood lighting, and I don't expect to need it as a macro.  Also, !token-mod --set light_radius#20 light_dimradius#0 worked as expected.  So TokenMod solves the issue.  Thank you!
1531788307
The Aaron
Pro
API Scripter
Great! =D  You can use | or # to separate arguments, BTW.  The | is what you'll usually see, but the # is nice so you don't have to escape them inside something like a Roll Query.
You might want to add: Hooded Lantern(Hood Down), light_radius#60 light_dimradius#5 light_hassight#yes light_angle#360 light_otherplayers#yes| To include when the player has the hood down. Also, Svirfneblin have Superior Darkvision to 120': Darkvision (120'), light_radius#120 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no| Maybe even one for the Darkness spell ?  Not really relevant though as you could just use Blinded.
1531859380
The Aaron
Pro
API Scripter
Nice additions!  I think I have a version with the 120' darkvision somewhere, but I never considered that hooded lantern version, clever!