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

Torch Script

1634557742

Edited 1634557868
I am trying to get the torch script running, and currently have the latest version installed (previous release looks to be 0.0.13). I tried to get the torch script running with a super simple flicker-on macro: !flicker-on 40 5 yes @{selected|token_id} But I am not getting anything coming up, and I am not seeing any errors in the logs either. Any idea what I am doing wrong?
1634563643
The Aaron
Roll20 Production Team
API Scripter
I haven't updated Torch for UDL yet. I have a UDL version, but it seems to conflict with UDL in strange ways. I'll try and test that out some more and get it released. 
Will stick with the manual light then. Looking forward to seeing that flickering effect I heard about when it comes out!
1634565697
The Aaron
Roll20 Production Team
API Scripter
Many people use TokenMod for setting lights.  That said, there is currently a bug with UDL settings from the API that causes some issues for that as well.
Is there anyway to get a version of torch api where the flicker is stationary and doesn't cause the flicker effect but still mirrors the tokens movement?
1634570235
The Aaron
Roll20 Production Team
API Scripter
I would actually suggest doing that with TokenCondition .  It's a much newer script and will let you do that sort of thing and much more.  Just make a token with the light properties the way you want them, assign it to a new character named it "Decoration: Torch", and drag it out and drop it on the token you want it to follow.
Nah the whole point is to give a player a button they can press that turns on and off their preferred lightsource.  Torch API does this perfectly in LDL, and Tokenmod pulls it off in UDL(but UDL is a hot mess of garbage I would never run on a live session).  I cannot come up with a single way to use tokencondition to pull this off, especially since the lightsource will be in the token layer instead of DL layer, which makes it selectable which leads to more issues.  My only issue with torch is that flicker causes graphic lag on low end machines and I have a few high quality players at my tables I want to cater to.   For anyone interested in giving players control over lights in LDL with torch api: ?{On or Off?||On,!flicker-on ?{What lightsource?||Candle,10 5 yes 360|Lamp,45 15 yes 360|Moontouched,30 15 yes 360|Light Spell,40 20 yes 360|Torch,40 20 yes 360|Hooded Lantern,60 30 yes 360|Flametongue,80 40 yes 360|Daylight,120 60 yes 360|Bullseye Lantern,120 60 53|Produce Flame,20 10 yes 360} !token-mod --set statusmarkers|+half-haze /em begins to emit light.| Off,!flicker-off !token-mod --set statusmarkers|-half-haze /em snuffs out their lightsource. }
1634599694
The Aaron
Roll20 Production Team
API Scripter
Given those limitations, I think I can help you out. =D
1634652655
Ren
Plus
Marketplace Creator
DM Eddie said: Nah the whole point is to give a player a button they can press that turns on and off their preferred lightsource.  Torch API does this perfectly in LDL, and Tokenmod pulls it off in UDL(but UDL is a hot mess of garbage I would never run on a live session).  I cannot come up with a single way to use tokencondition to pull this off, especially since the lightsource will be in the token layer instead of DL layer, which makes it selectable which leads to more issues.  My only issue with torch is that flicker causes graphic lag on low end machines and I have a few high quality players at my tables I want to cater to.   For anyone interested in giving players control over lights in LDL with torch api: ?{On or Off?||On,!flicker-on ?{What lightsource?||Candle,10 5 yes 360|Lamp,45 15 yes 360|Moontouched,30 15 yes 360|Light Spell,40 20 yes 360|Torch,40 20 yes 360|Hooded Lantern,60 30 yes 360|Flametongue,80 40 yes 360|Daylight,120 60 yes 360|Bullseye Lantern,120 60 53|Produce Flame,20 10 yes 360} !token-mod --set statusmarkers|+half-haze /em begins to emit light.| Off,!flicker-off !token-mod --set statusmarkers|-half-haze /em snuffs out their lightsource. } I am completely new to this. Where should this code go? This is a feature I'd be interested to use on a horror one-shot!
1634654004
The Aaron
Roll20 Production Team
API Scripter
It would go in a macro or character ability most likely.  However, it's using and API Script (TokenMod) which requires a game created by an active Pro Subscriber to access the API Perk.
1634659505

Edited 1634659553
I actually overcomplicate it in my own setup.  You can put it in the macro tab but then it will break everytime you go to view/edit it without repasting it all in.  What I do is I make this macro as an ability on a blank macro mule character sheet, hide this sheet in 3 folders with warnings not to look in the folders or edit the sheet(cause the mule needs to be set to all players so they will see it if they snoop), then set an actual macro in the collections tab that is calling said sheets ability with a %{Charactermulename|Abilityname}.  Then set this new macro from the collections tab as a token action with all players having access to the macro.   Like The Aaron said, you need a pro sub cause its actually using 2 scripts.  Its using Torch API's Flicker command, and also Tokenmod.   If you do it right, the players will see a button at the top of their screen when they have their token selected that you named something like "LightsOnOff" and then they can click it to toggle on and off lights.  If when the players fire the ability it just spits out the name of the mules ability, that means you never set the character sheet mule to all players.  
1634659832

Edited 1634659841
The Aaron
Roll20 Production Team
API Scripter
If you archive a character, its abilities will still be accessible, but it won't show up in the journal.  That's an effective way of giving players access to abilities on a character without letting them monkey with them.  When you need to modify it, you just unarchive it, make changes and archive it again.  =D
The Aaron said: If you archive a character, its abilities will still be accessible, but it won't show up in the journal.  That's an effective way of giving players access to abilities on a character without letting them monkey with them.  When you need to modify it, you just unarchive it, make changes and archive it again.  =D I knew I could, but are you sure they can?  Well I'll find out tonight!
1634662123
The Aaron
Roll20 Production Team
API Scripter
I'm pretty sure. =D