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

The Darkness is Closing In...Script

How do I enable or disable this function during game play? I inserted it into my campaign however it works immediately. is there a way for the Dm to trigger the script to start or can their be a duration set with the script when a character lights a torch? Thanks, Bobby
1418794862
The Aaron
Roll20 Production Team
API Scripter
I can write you one tomorrow morning.
1418922810
The Aaron
Roll20 Production Team
API Scripter
Ok. Sorry for the delay. Here is a version that you can toggle on and off with: !dci It will whisper to you to tell you if it is on or off. It will persist across campaign restarts, so if you turn it on, it will be on until you turn it off. It uses my isGM script, which you will need to install ( 1. copy in the isGM script, 2. speak as yourself in open chat ). This will prevent your players from being able to execute the command (and prepares you if you use any of my other scripts which require it). Dependencies : This script uses my isGM script, see it for install instructions. GIST: <a href="https://gist.github.com/shdwjk/d67c07ba49e1a57a1c0" rel="nofollow">https://gist.github.com/shdwjk/d67c07ba49e1a57a1c0</a>...
Aaron, Thanks a bunch..I will give it a try. Will I need to re-insert every script into each new campaign or does the scripts transfer to each campaign? If they do not stay as a "Standard Set". Roll20 may want to make that an option if possible. There is no telling how many scripts will be installed. Thanks, Bobby
1418935775
The Aaron
Roll20 Production Team
API Scripter
Scripts are setup on a campaign basis. New campaigns need to have their scripts added manually. You are right, iIt could get a little crazy...
Aaron, I got an error message: Dynamic Lighting Layer must be free of paths. I removed the dynamic lighting walls (I am using the Dungeon Ready script). After I removed the walls and I type in !dsi. nothing happens.
1418936819
The Aaron
Roll20 Production Team
API Scripter
Did you install the isGM script? And then speak as yourself (with the (GM) after your name) to allow it to detect you as a GM?
Aaron, I got it to work..I forgot to set GM. That works well. Is there any way that this could be added to the macro bar as I know as time goes on and I accumulate several scripts, I will need a script code sheet in order to remember the commands. Thanks..
1418937699
The Aaron
Roll20 Production Team
API Scripter
sure, just make a macro that has !dci in it, and set it to show on your macro bar. (and make sure your macro bar is turned on).
1418939004

Edited 1418939297
I created the Macro this is what I get: Bobby G. (GM): log('--------------------------------------------------------------'); log('DarknessClosingIn requires the isGM module to work.'); log('isGM GIST: <a href="https://gist.github.com/shdwjk/8d5bb062abab18463625" rel="nofollow">https://gist.github.com/shdwjk/8d5bb062abab18463625</a> '); log('--------------------------------------------------------------'); } }); I placed your script into the Actions Box within the Macro editor. I also created a GM Set Macro by doing the same.. Where did I go wrong?
1418941909
The Aaron
Roll20 Production Team
API Scripter
You don't put the API script in the macro, only the command !dci macros are simply a collection of what you would otherwise put in the chat entry.
Okay..Got it. Now a new problem...Say I have a group of three. (2) rangers and one dwarf. They are in a unlit dungeon. The torch carried by the ranger goes out and they have no more. The dwarf should still have night vision. Can this be character/token applied?
1418947291
Ziechael
Forum Champion
Sheet Author
API Scripter
Sure, in the token details&gt;advanced tab set the 'emits light' to 60 feet to highlight that the dwarf can see 60 feet regardless, make sure 'all characters can see light' is unchecked though so that only the dwarf sees the light he/she is 'emitting'. That way when the torches go out the dwarf will still see with darkvision and can guide the blind. I also tend to set my characters to 'has sight' checked and 240 degree angle to allow for them using their peripheral vision but not always looking behind themselves but that is personal preference, you can leave them with 360 vision or even a narrower 140 'tunnel vision' if you are mean ;) Hope that helps.
Ziechael, Yes I have set the emits light for the dwarf in my scenario above. The issue is that when the torch light starts going out so does the dwarf's night vision when the dwarf should not loose their night vision. I am sure I can find a workaround. I was hoping the tokens could have the "Darkness is Closing In" applied to them individually.
1418971517
The Aaron
Roll20 Production Team
API Scripter
Ah, that would be a much more complicated script. However, you could only apply the darkness closing in to lights all players can see. Add this after line 46 ( just the bold and underlined text): gettingDarker = function(obj, prev) { if( state.DarknessClosingIn.gettingDarker && ( obj.get("left") !== prev.left || obj.get("top") !== prev.top ) && obj.get('light_radius') && obj.get('light_otherplayers') ) { obj.set({ light_radius: Math.floor(obj.get('light_radius') * 0.90) }); } },