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

[Script] Any way to create flickering, dynamic light sources?

As the description says. I never made a script on roll20 myself, got no real experience with java, but programmed in C++/C#  But before i sink a lot of hours into something that might not work to begin with, might not be advisable in terms of ressource usage or is already available somewhere. I wanted to shout out if anyone knows if it works, if it is advisable or perhaps if there is something already existing that might fill my needs.
1467368640

Edited 1467370710
Ziechael
Forum Champion
Sheet Author
API Scripter
The Aaron's ' Torch ' script can produce flickering light sources I believe, he based his addition of that to the torch script on Jack Taylor's  Flickering Lights Script .
I gonna try this out right away. Thanks Ziechael!
1467382303
The Aaron
Pro
API Scripter
You're correct on both counts.  The commands are: !flicker-on !flicker-off
Should my players be able to that function?  Aslo, if I use the API does it override the settings on the token?
1467395510
The Aaron
Pro
API Scripter
Players should be able to use those commands.  There are additional arguments to !flicker-on that are the same as !torch.  !flicker-on does not change the settings of the token.  It creates a transparent token beneath the token that moves about randomly beneath it (within some minor threshold), and follows the token when it moves.
1467395597
The Aaron
Pro
API Scripter
Here is the original post:&nbsp;<a href="https://app.roll20.net/forum/post/1104897/script-torch-a-simple-script-for-giving-lights-to-tokens-and-turning-off-and-on-dynamic-lighting" rel="nofollow">https://app.roll20.net/forum/post/1104897/script-torch-a-simple-script-for-giving-lights-to-tokens-and-turning-off-and-on-dynamic-lighting</a>
Hey Aaron. Can you give me some straight macro code for torch? I try to utilize your syntax, but i get errors all the time. (this and that expected, but that found error).&nbsp; both !flicker-on [20 [ 10 [yes [@{target|Target 1|token_id}|--360 ... ]]]] and !flicker-on [20 [ 10 [yes [@{target|Target 1|token_id}|360 ... ]]]] give me: SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "l" found. or SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "o" found. Thanks!
1467640134
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hey Kalle, don't use inline rolls for everything, try this: !flicker-on 20 10 yes @{target|Target 1|token_id} You shouldn't need the --360. This is my torch macro that I made for my game: !flicker-on ?{Radius|40} ?{Dim Start|20} on @{target|token_id} And my darkvision/constant light sources macro: !torch ?{Radius|60} ?{Dim Start|60} ?{Visibile?|off|on} @{target|token_id} Let's me choose what sort of light source I'm making each time.
Thanks Scott! Now we all need to wonder why he put those inline dividers in there in the first place in the examples, when they are not necessary. To me, these looked like necessary to the syntax in the example.
1467649621
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm, didn't notice any dividers in his syntax examples. He's got brackets around the argument descriptors to show that they need to be one argument even though the description is two words (I think)
I copy pasted his example in my macro and replaced the &lt;&gt; stuff with values as described in his documentation. so yeah.
1467808384
The Aaron
Pro
API Scripter
I can't find a better reference from my phone, but basically I try to use standard command line syntax in the help:&nbsp; <a href="https://technet.microsoft.com/en-us/library/cc7710" rel="nofollow">https://technet.microsoft.com/en-us/library/cc7710</a>... [ ] surrounds optional arguments. If an optional argument can be followed by another optional argument, you get nesting: [ optional [optional]], etc Sorry for the confusion, I'm working on a help system this will be easier to understand, out sometime after summer.&nbsp;