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

Door Knocker v1.211 - Windows

1616283278

Edited 1616449275
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Well, the original thread for Door Knocker automatically closed before I finished testing out the Windows update. So, here's a brand spanking new thread for the brand spanking new version of Door Knocker which was just submitted to the API scripts repo &nbsp;is now live, complete with a new copy of the script's help documentation. Big thanks to Aaron and Andreas for their discoveries that allowed this update, and to Aaron for the window code! Changes of note from the last live version of Door Knocker: Windows! The search behavior has been changed so that it shows the door lines on the map instead of using auras. Custom ranging: You can now specify a range to manipulate or search for doors in Door Knocker v1.211 Welcome to Door Knocker. This script helps quickly open and close doors by controlling the dynamic lighting lines. If you have any questions, comments, or find a bug; please drop by the&nbsp; Door Knocker forum thread . Using Door Knocker The script will move dynamic lighting lines used as doors to the map layer and make them transparent, opening the door. It determines what is a door and a wall based on the stroke color of the polygon and will only open doors within 1 square (default 70px) of the door knocker token. Basic Command Syntax The script uses a standardized API command syntax. All Door Knocker commands will begin with&nbsp; !knock . This will then be followed by a space a double dash preceding a keyword and options group. This looks like this: !knock --keyWord|option1|option2|... Opening and Closing Doors Open and close using the&nbsp; key &nbsp;or&nbsp; push &nbsp;keyword followed by an option to tell the script whether to open doors, close doors, or toggle doors. You can also pass an optional second option to tell the script to open/close/toggle all doors within range of the knocker token, on the page, or in the campaign. These commands look like: Affecting obvious doors !knock --key/push|open/close/toggle|all/page/campaign/range Affecting hidden doors !knock --key|reveal/hide/togglehide|all/page/campaign/range Affecting obvious and/or hidden doors !knock --key|anydooropen/anydoorclose/anydoortoggle|all/page/campaign/range Affecting Windows !knock --key|openwindow/closewindow/togglewindow|all/page/campaign/range Affecting any doors and/or windows !knock --key|anyopen/anyclose/anytoggle|all/page/campaign/range key/push: &nbsp;This is the keyword that tells the script to manipulate door dynamic lighting lines. The&nbsp; key &nbsp;keyword operates on both locked and unlocked doors and is GM only. The&nbsp; push &nbsp;keyword only operates on unlocked doors. open/close/toggle &nbsp;This option tells the script to open, close, or toggle (open closed doors and close open doors) the closest door (or all doors if also using the all option described below). reveal/hide/togglehide &nbsp;This option tells the script to open, close, or toggle the closest hidden door (or all doors if also using the all option described below). anydooropen/anydoorclose/anydoortoggle &nbsp;This option tells the script to open, close, or toggle the closest obvious or hidden door (or all doors if also using the all option described below). openwindow/closewindow/togglewindow &nbsp;This option tells the script to open, close, or toggle the closest window (or all windows if also using the all option described below). anyopen/anyclose/anytoggle &nbsp;This option tells the script to open, close, or toggle the closest obvious door, hidden door, or window (or everything in range if also using the all option described below). all/page/campaign: &nbsp; Optional argument &nbsp;This option tells the script to operate on all doors within range, all doors on a page, or all doors in the campaign. The&nbsp; page &nbsp;and&nbsp; campaign &nbsp;keywords are GM only and do not work with the&nbsp; push &nbsp;keyword. Range and the all/page/campaign keywords can be entered in any order relative to each other. range: &nbsp; Optional argument &nbsp;This option tells the script to operate at a custom range, entered in the units of the map (e.g. ft, meters, kilometers). Range and the all/page/campaign keywords can be entered in any order relative to each other. Setting up the Door Knocker Set the wall, door, and locked door stroke colors in the settings menu using hex color codes (e.g. #000000). You can also set these values by selecting an already created DL line. This functionality is only accessible to the GM. The command syntax for using a selected DL line looks like: !knock --preset|wall/door/unlocked/hidden/window|hex color preset: &nbsp;This is the keyword that tells the script to change it's settings wall/door/unlocked/window: &nbsp;This option tells the script to update the color setting for walls, doors, unlocked doors, and windows hex color: &nbsp; Optional argument &nbsp;Passing a hex color here will set the script to consider all polygons on the Dynamic Lighting layer with a stroke of this color to be doors/walls. If this option is not passed the script will look for a selected polygon to pull a stroke color from. Setting up your maps The only map setup needed is to ensure your dynamic lighting doors are the appropriate color. This functionality is only accessible to the GM. If you are adapting a module or add-on to an already existing door color scheme you can select a door line and run the following chat command: !knock --adapt|door/wall/unlocked/hidden/window|campaign adapt: &nbsp;This is the keyword that tells the script to update all polygons on the dynamic lighting layer with the same stroke color as the selected polygon(s) to have the script's door/wall stroke color wall/door/unlocked: &nbsp;This option tells the script to update the stroke color to that of walls, doors, or unlocked doors campaign: &nbsp; Optional argument &nbsp;adding this optional argument tells the script to update polygons on all pages, not just the current page. Searching for Doors When you search for doors using Door Knocker, it will copy door lines to a visible layer. If a gm initiates the search hidden doors are copied and all door lines are shown on the gm layer. If a player initates the search, hidden doors are not displayed and the door lines are shown on the objects layer. How long door lines are visible for (in seconds) can be set from the settings page. !knock --search|range search: &nbsp;This is the keyword that tells the script to display any nearby doors range: &nbsp; Optional argument &nbsp;Enter the search range, in the units of the map (e.g. feet, meters, kilometers). If you do not provide a range, it will default to the distance of a square on the map. Note that searching does not currently reveal windows due to how the window paths are encoded. This functionality is being worked on. Customizing the Script Door knocker token The script uses a generic key token as the door knocker token. You can customize this by changing the default token of this character. You also can run the script's commands from any selected token. Script created abilities The script also creates six abilities on this character as token actions. These can be disabled as token actions, but should not be deleted as the script will simply remake them. You can also add whatever other macros you want to this character. Attributions The default token image is from&nbsp; <a href="https://game-icons.net/" rel="nofollow">https://game-icons.net/</a> &nbsp;under the&nbsp; creative commons license . Thanks to Keith Curtis for finding this awesome token.
Great update, Scott! I assume the window functionality is UDL only, right?
1616347760

Edited 1616347850
Andreas J.
Forum Champion
Sheet Author
Translator
Jay R. said: I assume the window functionality is UDL only, right? Yes, it's UDL only. Wooh, finally windows! I updated the links on the wiki to this thread. Will there eventually be an options for locked/unlocked "windows"? Could be useful for things like doors made of prison bars, or windows that have actual locks. Ability to open/closes curtains for a window could be the next step. Guess either make "curtain window" a separate thing is better than having a command that convert a window to a door, as it would lose the info of it actually being a window. A command Converting a window to a door or back could also have some niche use.
1616359729
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Something I'm looking into is commands to convert items between all the states (e.g. hidden door to locked door unlocked door).
1616799240

Edited 1616799316
Styx
Pro
Hi Scott, I've been using this script for a few months and love it - thank you - but logged in today to see the above error. Not sure if I'm the only one who has experienced this since the update though EDIT: image didn't post correctly
I should probably also point out that I'm also using One-Way Dynamic Lighting in case that is no longer compatible
1616803245
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm, interesting. Thanks Styx. It looks like the function to update DoorKnocker to a previous version has some issues. It'll take a bit for the code update to hit live, but if you want you can update the code your self by deleting DoorKnocker, then readding it via the "import script" option. Then delete line 159 of the script: getObj('graphic',id).remove(); and copy this in to that line instead: let obj = getObj('graphic',id); if(obj){ obj..remove(); }
I have the same problem with slightly different message.&nbsp; You can see the macro call in the chat box beneath.&nbsp; message is " Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at getSegmentedPaths (apiscript.js:406:40) &nbsp; I have never gotten the script to work, so there may be additional problems.&nbsp; I am using a test game for pre-testing scripts and macros, very basic. I have set up all the colors, but no lines are moved, no doors opened, closed, or toggled. No auras appear on the token regardless of vicinity of doors.&nbsp; Others give great reviews of how useful it is, so I would love to get it going in my games. Any help appreciated.
I’m pretty sure you need to install the dependency scripts. That looks like the same error messages I got the first time I loaded the script.&nbsp;
I am having the same issue as Styx
Dean S. said: I am having the same issue as Styx Have you loaded the dependency scripts? From the main thread: The script has two dependencies: Path Math and Vector Math by Stephen L. Both of them are available from the one-click drop library.
1616899149
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Thanks for the attempts to help Jarren, however the errors being reported do not have to do with the dependencies, these are installed automatically when installed via the one-click. The errors are due to some areas where I did not put proper protections against unfound objects in the script.
Scott C. said: Thanks for the attempts to help Jarren, however the errors being reported do not have to do with the dependencies, these are installed automatically when installed via the one-click. The errors are due to some areas where I did not put proper protections against unfound objects in the script. Ah good to know that the dependencies are automatically loaded.&nbsp; I pretty much always import scripts from the one-click instead of simply using the 'Add Script' button, as there's typically minor things I like to tweak (e.g. the startup log reports, and making sure that GM only whispers from the script have a 'name' and are set to 'no archive', and occasionally other small things).&nbsp; So the first time I imported Door Knocker, I got an error message, because importing does not automatically load the dependencies.&nbsp; Once I use the one-click and added the dependencies, it worked just fine.&nbsp; So it's still potentially an issue... if someone is as stubborn as me to get things looking just they way they like by tweaking other scripts. :)
Apologies for missing this thread (Door Knocker links you to a dead one). I'm getting this error. Any ideas what might be going on? Cannot read property 'r' of null TypeError: Cannot read property 'r' of null at setContrast (apiscript.js:266:31)
1617515371
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm, interesting Craig. What colors do you have set for your various walls?
1617515409
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Also, an unfortunate update: The windows functionality is currently non functional because of the latest UDL update. I'll update as I have new information.
Well, I selected the standard orange lines as the door colors, and the blue lines as the walls (as they come with the Mad Mage module). And I adapted them for the campaign. However, that error message came up even before I was able to do that. I installed the API, started up my game... and that error message came popping out in chat. I tried deleting and reinstalling, but the same error occurs.
Also of note... the Bio/Info tab on the Door Knocker sheet doesn't show me options. It's just blank (not in a pop-out)
Scott C. said: Also, an unfortunate update: The windows functionality is currently non functional because of the latest UDL update. I'll update as I have new information. The windows function of Door Knocker is half-working. I draw a line in the DL layer in the color I chose for windows, and it admits light like a window even though it would ordinarily block light without the script, but it no longer blocks movement. Craig M. said: I'm getting this error. Any ideas what might be going on? Cannot read property 'r' of null TypeError: Cannot read property 'r' of null at setContrast (apiscript.js:266:31) I set up macros to be used from the macro bar when a token is selected. I get similar errors, "cannot read property of ..." every time I try to use the macro as an action of the token that was generated by the script. If I select that token, and activate the macro, I get an error.&nbsp; When any other token is selected, it works, BUT I have to click the button three times. If I enter the command directly in chat, I have to enter it three times.&nbsp; I have seen no other macro/script pair with that peculiarity. macros are just: !knock --search !knock --key|open etc.
Valerie... that is exactly what's happening on my end as well, including the triple-clicking.
This script's windows functionality is working perfectly in my game, as of yesterday. Ellipses block light now with the update, but whatever magic your script does seems to get around that :)
I use the following color codes currently.&nbsp; Red=Walls Green=Unlocked Doors Yellow=Locked Doors Is there a way to have the colors change so a thief who uses pick locks on a yellow locked door can open it without GM involvement? Is there a way for search doors to not be automatically successful?
1617820927
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Handling skill checks is currently beyond the scope of the script. It's something I'm looking at, but I don't have any immediate plans for it. For the searching, make doors you don't want to be automatically visible as hidden doors. The search won't show hidden doors.
1617917726
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
First of all, some good news: The UDL implementation appears to have been updated to allow windows to work! And, then secondly; Thanks for the error reports Valerie and Craig. Can you see if changing to this DoorKnocker code fixes your error issue?
1617917925
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Also, Valerie, you appear to be having bigger issues. Could you DM me an invite to your game so I can look into what exactly is going on there.
Did the one-click script get updated?&nbsp; I didn't load the new one, but the windows are now working and the triple-click problem has disappeared.&nbsp; All that's left is some mysterious errors that only happen when using the door knocker token.
1617939319

Edited 1617941059
Scott, thanks! I've installed... so far so good... no errors back, and the UI character sheet is correctly populated... kicking the tires now.... ETA: Works like a charm! I'm basically just using the toggling function as a token macro, so I can't speak for every aspect of functionality (or the error Valerie mentioned), but the functionality I wanted is there, and there are no more errors getting kicked back. Bravo!
1617941620
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Craig, Great to hear! Valerie, The one-click code has not update as I wanted to see if the code fixed your's and Craig's errors. The windows functionality was fixed by Roll20 changing how the UDL processed DL lines. The triple click issue was probably caused by some lag on the API server end. Can you install the beta code linked just above and see if it fixes the errors that are being thrown for you?
Question, Setting up the Door Knocker Set the wall, door, and locked door stroke colors in the settings menu using hex color codes (e.g. #000000). You can also set these values by selecting an already created DL line. This functionality is only accessible to the GM. The command syntax for using a selected DL line looks like: The previous statement seems to suggest that one can setup the Door Knocker in the settings menu, but where can one find the settings menu, I would love to set everything one time for the entire campaign, rather than going through and adapting every page. Can anyone help a newbie in understanding what I'm doing wrong with this script?
Door Knocker will create a character called 'DoorKnocker UI' (it has a token that looks like a key with a red &amp; black background). Find that character and open up the character sheet. On the Bio &amp; Info page, you'll see two tabs in the middle named 'Instructions' and 'Settings'.&nbsp; Click on 'Settings' to see the current colors of walls and doors.
1618065103

Edited 1618065122
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Welcome to DoorKnocker ez2rpg, Jarren got the right of it. In addition, you can quickly change the colors of DL lines across your entire campaign with the adapt keyword described in "setting up your maps".
Thanks Jarren K. and Scott C. sometimes the obvious is so obvious I miss it.
Since the last update my players and even the Doorknocker must be nearly inside the door to work peoperly. Is there a way to change the distance for activation?
1618148953
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi Rholan. Yes. The range defaults to 1 square (or 70 pixels if there is no grid). But you can specify a range for searching and door manipulation. See the range keyword in the help doc.
Scott C. said: Hmm, interesting. Thanks Styx. It looks like the function to update DoorKnocker to a previous version has some issues. It'll take a bit for the code update to hit live, but if you want you can update the code your self by deleting DoorKnocker, then readding it via the "import script" option. Then delete line 159 of the script: getObj('graphic',id).remove(); and copy this in to that line instead: let obj = getObj('graphic',id); if(obj){ obj..remove(); } I'm having the same issue, but don't know where to get the actual script to "import script" to make the changes. Any help would be wonderful! c: Also, THANK YOU &nbsp;for this awesome script. It's a game changer. ♥
1618153752
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi Sassy, I'll be sending the updated code to the repo today and it should go live on Tuesday/Wednesday. If you need the fix quicker than that you'll need to disable your current version of Door Knocker. And then, since that post you quoted, there is now a gist of the updated code that you can just copy in as a new custom script on your API scripts page (see this post for details)
I like the new search function, but in UDL the visible doors can be hard to see without making the lines super thin. Is there a way to make the visible lines thicker, or perhaps a transparent token could be created with a visible aura to show the location of the door?
1618199287
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
It's something I'll look into Persephone. The lines revealed by search should be extremely thick as is.
1618257556

Edited 1618258240
Door Knocker v1.211 error when clicking the Settings option on the Door Knocker character sheet.
1618258959
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm. Interesting. Thanks Keith. I'll take a look and see if I can replicate.
1618261434

Edited 1618261458
Also receive the following error when trying to set the window option.
1618262068
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Thanks for the report Mike. For your first error, are you using the one-click or did you copy the code in from the repository? I ask because I can't replicate the issue. For your second, what command are you sending when you trigger that?
Hey Scott, That was copied from the repository, the second error is when i open the door knocker character sheet and click on the settings option to see the color hexcode.
Getting this error when I try using !knock --search with the DoorKnocker token selected:
1618357270
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm. Interesting. Can you post a screen cap of what the DL lines look like around the token?
Here's one area, but it happens no matter where on the map the Knocker token is. The command works fine with any other token in any area, so it's not an issue for me, just thought the info may be useful for you in case you wanna sort the bug out. I did notice one unrelated small issue with the above door specifically, it can only be opened/closed from the left side, not the right. I tried changing it to a straight line in case the branching shape was causing issues, but that made no difference. I have several other doors like the one above and the one below, but only the one above has this issue. All others can be opened from either side.
1618368008
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
mike k. said: Hey Scott, That was copied from the repository, the second error is when i open the door knocker character sheet and click on the settings option to see the color hexcode. Thanks Mike, Could you try adding the script from the one-click and see if the problem persists? I think that you may be missing some lines of code.
Hi guys, I have asked this question before and got the answer to look in the description but I'm obviously too dumb to do it right. I've asked how to change the range for open/close/toogle doors. &gt;Since I updated the API my players have to stand nearly inside the door to use the open command. Can someone please put an example command line here how to set the range? TIA
1618589267

Edited 1618589292
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
No worries Rholan, There's a lot in the help doc. The relevant section for you is this: Searching for Doors When you search for doors using Door Knocker, it will copy door lines to a visible layer. If a gm initiates the search hidden doors are copied and all door lines are shown on the gm layer. If a player initates the search, hidden doors are not displayed and the door lines are shown on the objects layer. How long door lines are visible for (in seconds) can be set from the settings page. !knock --search|range search: &nbsp;This is the keyword that tells the script to display any nearby doors range: &nbsp; Optional argument &nbsp;Enter the search range, in the units of the map (e.g. feet, meters, kilometers). If you do not provide a range, it will default to the distance of a square on the map. Note that searching does not currently reveal windows due to how the window paths are encoded. This functionality is being worked on. So, to search within 10 ft (or whatever units your map uses) of a token the command would be: !knock --search|10
1618598825

Edited 1618599499
@Scott, not sure if you saw my last post, but last night I noticed a lot more doors that can only be opened from one side. These are doors that I'd set up and interacted with before the last big update you made, and was not having this issue with them before. Any ideas why this might be happening? I've even tried deleting the door paths and redrawing them. Here's a couple more screenshots for some visual context: This door can only be opened/closed from the northeast side. This door can only be opened/closed from the south side.
1618599402
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
It's something I'm trying to figure out. And actually, would you be willing to let me hop in and dig around a little?