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

Torch Confusion

So I'm trying to configure Torch and create Macros for it. But the code im using seems to get syntax errors.  Here is the base formula from Aaron's notes:  !torch [<Radius> [<Dim Start> [<All Players> [<Token ID>|<--Angle> ... ]]]] Here is what I configured it to based on my understanding: !torch [40 [20 [Yes [@{selected|token_id}|--360 ... ]]]] And finally here is the resulting Syntax error code:  SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "o" found. My only experience really working with any code is for these macros, so I'm confused. Thanks in advance to whomever can help set me on the right path!
1593602108

Edited 1593602362
David M.
Pro
API Scripter
Don't actually put the brackets or the dotdotdot in there, that is just a coding convention for describing the function arguments. This works for me !torch 40 20 Yes [@{selected|token_id}|--360 EDIT - also, pretty sure the TokenID and radius are not required, as the selected token and 360deg radius are defaults if none are given. This should give the same result: !torch 40 20 Yes
David, I appreciate the expedient responses my friend. SO lets see: When i used the full script you suggested with the Selected tokin ID portion it says no token is selected. So i selected a token and used the command...nothing im afraid. So i tried it with just !torch 40 20, as wel, and it just promted me with the directions in the chat for torch, and did nothing with the token lol So I'm still missing something lol. 
1593635778
David M.
Pro
API Scripter
Is Dynamic Lighting enabled and Global Illumination off? Or are other nearby light sources somehow interfering with your ability to see the light emitting from the token? Also, are you using Legacy DL or Updated DL? I've never tried Torch with UDL. It is generally recommended to use LDL until UDL is ready for prime time. It's effectively in beta testing right now as the kinks are getting worked out. 
1593789785

Edited 1593789879
I've had this API working in a game with legacy DL. They player only needs to select their own token and type: !torch By default, it sets the 40 and 20 values on the selected token. You can see the behaviour of !torch and !snuff by doing "edit token" and looking on the advanced tab for the "Emits Light" boxes. They are set to 40 and 20 for !torch, and cleared of any value for !snuff
1593791479
The Aaron
Roll20 Production Team
API Scripter
Sorry, that's a bit confusing.  The [ ] denote optional parts.  I should probably rewrite the instructions. Here are a bunch of examples: Light: 40, Dim at 20, All Players See it, 360º, on selected tokens !torch Light: 60, Dim at 30, All Players See it, 360º, on selected tokens !torch 60 Light: 60, Dim at 5, All Players See it, 360º, on selected tokens !torch 60 5 Light: 60, Dim at 5, Token only, 360º, on selected tokens !torch 60 5 no Light: 60, Dim at 5, Token only, 90º, on selected tokens !torch 60 5 no --90 Light: 60, Dim at 5, Token only, 90º, on target token !torch 60 5 no --90 @{target|token_id} Light: 40, Dim at 20, All Players See It, 90º, on target token !torch 60 - - --90 @{target|token_id} Light: 40, Dim at 20, All Players See It, 300º, on 3 target tokens !torch 60 - - @{target|Light 1|token_id} @{target|Light 2|token_id} @{target|Light 3|token_id} I think that covers all the permutations.  Let me know if you have more questions. Side note:  If you put questions about  API scripts in the API forum, I'll see them faster.
Hey all, so it seems it may be an issue with my game :( I loaded the API in the other game I had and everything worked 100%...i tried removing torch and re-adding it to the problem game and well...it didnt resolve it. Should i try to copy the game? Any troubleshooting tips? At the moment I just went ahead and built a torch token for them to move as a workaround, but I dont know what other issues I may be having now with this particular game Aaron, copy that sir, will def be sure to put questions in appropriate places oging forward, thanks for the heads up
Copying the game did not resolve. Must be something with my game, and to be honest I also am starting to have issues with the Group Initiative Macro as well. Theyre only 1 session in, i may delete it and import the sheets for the players into a fresh copy of it
1593809678
The Aaron
Roll20 Production Team
API Scripter
If you want to pm me an invite and GM me, I can try and investigate. 
For anyone who may come to read this later: The Aaron graciously helped me address the issue and he discovered my issue to be with the Updated Dynamic Lighting. David M., you were right sir. I just didnt know how to toggle between the two. But all the commands work like a charm now. I'm grateful to all who commented and helped me with my troubleshooting. I learned a lot <3