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 move with token?

1429619736

Edited 1429619866
Kryx
Pro
Sheet Author
API Scripter
For Aaron's Torch script is it possible to have the torch move with the token? Similar to how it works on TurnMarker? It says it does: Creates a flickering light that stays with the token But it doesn't seem to move when I move the token.
1429622446
The Aaron
Pro
API Scripter
Hmm. It does for me... I'll have to try it again and make sure nothing is broken by recent changes.
1429623299
Kryx
Pro
Sheet Author
API Scripter
I can drag the invisible torch, but it is not an object in the background that moves automatically like the demonic symbol from the TurnMarker.
1430036306
Kryx
Pro
Sheet Author
API Scripter
Aaron, could you follow up on this? I don't see anywhere in the code that makes it move. registerEventHandlers = function() { on('chat:message', handleInput); on('destroy:graphic', handleTokenDelete); }; Maybe I have an old version? I have 0.7.
1430063176

Edited 1430078316
The Aaron
Pro
API Scripter
Ah, I understand your confusion regarding it moving. It doesn't rely on graphic change for it's move. It turns out, that would be redundant and just caused problems. Since it is effectively an animation, it is always moving (on a given interval). If you look at the bottom of checkInstall(), you'll see: flickerInterval = setInterval(animateFlicker,flickerPeriod); animateFlicker() positions a flicker at a minor random delta from the token it's attached to, so moving the token means the flicker will automatically catch up. the default flickerPeriod is 400ms, I don't think I'd go much lower than that. It seems to be working for me. I uploaded version 0.8.0 just to be sure (minor fixes including better help argument handling, whispered help, and GenSAS). Here's the steps I followed: select token run !flicker-on switch to token view move about a while run !flicker-off
1430078126
Kryx
Pro
Sheet Author
API Scripter
Ah, it does seem to move for you! Cool. Can you link me to the latest code? I still see 0.7 at <a href="https://gist.github.com/shdwjk/342cb67457936702fd8a" rel="nofollow">https://gist.github.com/shdwjk/342cb67457936702fd8a</a>
1430078287
The Aaron
Pro
API Scripter
<a href="https://github.com/shdwjk/Roll20API/blob/master/To" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/To</a>... It's also in the Roll20 official repo, but all my scripts go into my shdwjk/Roll20API repo.
1430078373
The Aaron
Pro
API Scripter
If that doesn't make it work, let me know and I'll jump in your game and figure it out. =D
1430079207

Edited 1430079225
Kryx
Pro
Sheet Author
API Scripter
The Aaron said: <a href="https://github.com/shdwjk/Roll20API/blob/master/To" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/To</a>... It's also in the Roll20 official repo, but all my scripts go into my shdwjk/Roll20API repo. baaaah I have older versions of some of your scripts!!! No wonder my turn marker was being a pain today. You should update <a href="https://wiki.roll20.net/API:Script_Index#Combat_Scripts" rel="nofollow">https://wiki.roll20.net/API:Script_Index#Combat_Scripts</a> to reference the repo if possible. :) I'll test the torch in a bit - just got out of a 6 hr marathon session.
1430079555
The Aaron
Pro
API Scripter
Yeah, that's a forever battle... but I'm working on a system to let me do that update with a script release automatically.. =D
1430089099
Kryx
Pro
Sheet Author
API Scripter
Hmmm I loaded 0.8 and it still doesn't work. Here is my process: Click token on token layer. Type in '!flicker-on' Hit cntrl+L. Token can see like a torch, great!. There is an invisible token created underneath the selected token which is the actual torch. Move token. Invisible Torch token stays behind. ??? If I use 'torch' instead it changes the token's vision itself - which I understand to not be the goal? I mainly intended to use torch to complement the normal vision of a token, but maybe that was mistaken?
1430091001
The Aaron
Pro
API Scripter
If you want to invite and GM me, I'll jump in and take a look.
1430091256
Kryx
Pro
Sheet Author
API Scripter
In bed now. If you're around tomorrow we can do it then.
1430092592
The Aaron
Pro
API Scripter
Sounds good, just PM me.
Hey Aaron, Am I understanding correctly This API should let me add an invisible token to the map "Link it" to a player token and have a light source that moves with the player? If that is correct how do i accoomplish the link?
1431291234
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Robert N. said: Hey Aaron, Am I understanding correctly This API should let me add an invisible token to the map "Link it" to a player token and have a light source that moves with the player? If that is correct how do i accoomplish the link? I am a big fan of tokens stacked with clear PNGs ( <a href="http://i.imgur.com/E1AW0gD.gif" rel="nofollow">http://i.imgur.com/E1AW0gD.gif</a> ).... but why for lighing?
1431291557
Kryx
Pro
Sheet Author
API Scripter
Stephen S. said: I am a big fan of tokens stacked with clear PNGs ( <a href="http://i.imgur.com/E1AW0gD.gif" rel="nofollow">http://i.imgur.com/E1AW0gD.gif</a> ).... but why for lighing? Because roll20 can have only 1 form of vision, while creatures can have multiple. for 5e you can have darkvision, a torch, tremorsense, blindsight, trusight. The most common case is darkvision (which only gives dim vision) and a torch. I redid Torch to attach the token, but I haven't used it because it interacts poorly with another script I use (Blood and Honor). I'll see if I Aaron is open to me committing my changes to his base script.
1431291866

Edited 1431291949
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Not arguing the point (looking for a stacking script I just made to post) but I am curious, does one light source trump? If I have torch on does it overide another? Also... what could be cool is aura... you can light up some things with aura. <a href="http://i.imgur.com/QpEx8Hh.gif" rel="nofollow">http://i.imgur.com/QpEx8Hh.gif</a>
1431292179
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
This is based on Aaron's bump script: <a href="https://gist.github.com/BaldarSilveraxe/c9ae82d9592c2330597f" rel="nofollow">https://gist.github.com/BaldarSilveraxe/c9ae82d9592c2330597f</a>
1431292417
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
(that also has a GM ping in there.... handy for not losing track of clear tokens!)
Stephen S. said: Not arguing the point (looking for a stacking script I just made to post) but I am curious, does one light source trump? If I have torch on does it overide another? Also... what could be cool is aura... you can light up some things with aura. <a href="http://i.imgur.com/QpEx8Hh.gif" rel="nofollow">http://i.imgur.com/QpEx8Hh.gif</a> I can not speak to any rule system other then D&D and even then not as an expert. But from my interpretation the answer to your first question is yes there would be rules for which light 'source" trumps another.Or an the very least effects how another works. In the campaign I am running I have 5 players 4 with dark vision and one with Normal vision. Currently every time they light a torch I have to go to that character and change the light setting. Or use a token for the light. One of the things that happens a lot in the sorceress will cast the light spell on an arrow or small rock and then give it to another character who in turn throws, slings or fires the object into the next area. So I have adopted the practice of including token on the GM layer that I can bring the token layer and then set the vision values. this also requires me to move the token every time the character carrying it moves. I am just looking for a way to stream line the process
1431294107
Kryx
Pro
Sheet Author
API Scripter
Stephen S. said: Not arguing the point (looking for a stacking script I just made to post) but I am curious, does one light source trump? If I have torch on does it overide another? Also... what could be cool is aura... you can light up some things with aura. <a href="http://i.imgur.com/QpEx8Hh.gif" rel="nofollow">http://i.imgur.com/QpEx8Hh.gif</a> A character can have both darkvision and a torch. At which point they'd hava darkvision out to 60 and a torch's bright vision at 40 (20 + the 20 dim turns into bright via Darkvision). Though I don't give that extra 20 of bright vision w/ roll20 cuz it would be a pain.. Regarding your aura craziness - I've never understood it and it seems to require changing the way maps are setup which.. is too much imo.
1431295001
The Aaron
Pro
API Scripter
Mark said: I'll see if I Aaron is open to me committing my changes to his base script. I've got your code for it. I actually want to handle it a different way though, just need to get to it. Perhaps I'll prioritize that with the rest of the time I have this weekend to work on it... I do welcome and appreciate all code suggestions and contributions!!! =D
1431295524

Edited 1431296024
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Mark said: Stephen S. said: Not arguing the point (looking for a stacking script I just made to post) but I am curious, does one light source trump? If I have torch on does it overide another? Also... what could be cool is aura... you can light up some things with aura. <a href="http://i.imgur.com/QpEx8Hh.gif" rel="nofollow">http://i.imgur.com/QpEx8Hh.gif</a> A character can have both darkvision and a torch. At which point they'd hava darkvision out to 60 and a torch's bright vision at 40 (20 + the 20 dim turns into bright via Darkvision). Though I don't give that extra 20 of bright vision w/ roll20 cuz it would be a pain.. Regarding your aura craziness - I've never understood it and it seems to require changing the way maps are setup which.. is too much imo. Its craziness.. but I think it could have a niche application. Secret doors come to mind. Its one of the few ways we have have to create things visible to only certain players on the same map. So, I am always kicking it around. Example.... the secret door in the above is visible only to which ever players can see it... and requires no edits to the map layer. Shrug, something we can do, haven't found the right fit.
1431296381
Kryx
Pro
Sheet Author
API Scripter
The Aaron said: Mark said: I'll see if I Aaron is open to me committing my changes to his base script. I've got your code for it. I actually want to handle it a different way though, just need to get to it. Perhaps I'll prioritize that with the rest of the time I have this weekend to work on it... I do welcome and appreciate all code suggestions and contributions!!! =D I haven't had much time to work on scripts lately. If I do I'll send you a msg on gchat. I'm curious how you'd do it. I'd suggest: Daylight/Darkness use global illumination All torches and flickers are created as different tokens that are attached and follow the token Make Blood and Honor & Torch together stop breaking. Not sure what your plans are.
1431298036
The Aaron
Pro
API Scripter
Pretty much inline with what you've listed, though I'm going to make flicker an option on torch, so no duplicate set of commands. I also have some other user interface changes in mind.
1431332461
Kryx
Pro
Sheet Author
API Scripter
Sweet - same as I envisioned then. I only removed default torch because I was only using flicker and was trying to work through that torch+Blood and Honor issue. I was going to do it the same way you are - all flickers are torches and all torches are separate tokens.
1431350643
The Aaron
Pro
API Scripter
Yup! Great minds and such. :)
I still am not sure how to use this?
1431485427
The Aaron
Pro
API Scripter
Use my Torch script? select one or more tokens execute a command like !torch Type !torch --help for help Basic arguments are: !torch [light radius | - ] [dim radius | - ] [all players see light | - ] [--[Arc Angle]] [[token id] ...]
1433003730

Edited 1433005817
The Aaron said: Use my Torch script? select one or more tokens execute a command like !torch Type !torch --help for help Basic arguments are: !torch [light radius | - ] [dim radius | - ] [all players see light | - ] [--[Arc Angle]] [[token id] ...] I am having a real hard time understanding how to type in the arguments. I get what the arguments should be just not how to type them. Could I get an example as it would be typed in a macro. for a light source that is 20 X 20 X 360 all see and is set on a selected token.? Please EDIT: I got it "!flicker-off [light radius | 20 ] [dim radius | 20 ] [all players see light | true ] [360[Arc Angle]] [[Torch] ...]" Edit 2: I was wrong I still don't get it, LOL If I send "!torch" by it self and I have a token selected that token lights up. Same thing with flicker. Andding arguments has no effect//
1433333907
The Aaron
Pro
API Scripter
Handled over PM, but for other searchers, here's some examples: How to run torch to set: Radius: 40 Dim at: 20 All players see light: on Light arc angle: 180 On a token named: Fred You can't do it by token name (sorry Fred!), but you can do it by selecting the token and executing the command: !torch 40 20 on --180 ...or by executing the command and passing in the token id: !torch 40 20 on --180 --ids @{target|token_id} The default is for dim to be half of bright, so this is the same: !torch 40 - on --180 The default is for all players to see the light, so this is also the same: !torch 40 - - --180 Hope that helps future readers!
Thank you. Just wondering if there would be a way to prompt for a value. For example a hooded lantern where the player wants to open close the hood to control where the light shines. I was hoping to put this in a macro and have it prompt for the arch angle, I have not been successful..... How ever everything else seems to be working great.
1433343690
The Aaron
Pro
API Scripter
You can use the query syntax for dice expressions to do this: !torch ?{Light Radius|60} This would prompt the person that executes it with a dialog that says "Light Radius" and has an input field with the value 60 in it and highlighted. The default dim radius is have the bright radius, and light defaults to visible to other players, so just hitting enter to the dialog would be equivalent to: !torch 60 30 on If you wanted to further prompt for players seeing the light, you might do something like: !torch ?{Light Radius|60} - ?{Darkvision?|no} The - tells it to use the default value for dim (half bright). This would prompt as above, then prompt additionally with "Darkvision?" and a default value of no highlighted. Hitting enter to both dialogs results in the same 60/30/on torch. Bonus Answer: If you want to send your players a button, I added some notes to the wiki about encoding queries and other expanded arguments so that they are expanded for the person that clicks the button, rather than sends it. For example, this would send a torch button to your players, prompting you for the radius, then sending them a button that would configure with that radius: [Set Torch](!torch ?{Light Radius|60}) If you wanted them to get a button that prompted them for the radius, you can send it like this: [Set Torch](!torch &amp;#63; {Light Radius|60}) This would send them a button, and when they individually click on it, it would prompt them for a "Light Radius" with a default value of 60 highlighted.