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]Door Knocker

Confirmed, manually installing 1.15 fixes the issue. though the log does say it updates back to 1.14 :)
1582695288
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm, thanks. I'll change the update logs to more correctly relate what's going on.
1584830693
Andreas J.
Forum Champion
Sheet Author
Translator
Just gonna say, this is a cool API script, once you figure out how to use it. :D
1584836882
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It's a staple of my games, and it makes running a huge, pre-configured module a breeze.
Echoing the praise for this script. It is absolutely amazing. I particularly love how you can adapt whatever map you just created or bought to be DK compatible with just a few commands.
1585935138

Edited 1585935167
How do you go about disabling the token actions you don't need? I am relatively new to and completely inexperienced in scripting/coding (despite the "Pro" tag I have").
1585935450

Edited 1585935469
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
On the door knocker UI character token? simply go to the attributes & abilities tab and uncheck "Show as Token Action" for each ability that you don't want. Don't delete them as the script will just recreate them. Note, that while the script UI provides a token to use, I find the easiest way to use the script is to simply make a global macro under the macro collection for each command you regularly use, and set each to a token action. Then you can simply select the player's (or NPC's) token that has approached the door that needs manipulating and open it from there. Here's what my global macro looks like:
Scott C. said: On the door knocker UI character token? simply go to the attributes & abilities tab and uncheck "Show as Token Action" for each ability that you don't want. Don't delete them as the script will just recreate them. Note, that while the script UI provides a token to use, I find the easiest way to use the script is to simply make a global macro under the macro collection for each command you regularly use, and set each to a token action. Then you can simply select the player's (or NPC's) token that has approached the door that needs manipulating and open it from there. Here's what my global macro looks like: Oooh, I am totally going to try that! But even so, my love for Door Knocker cannot be overstated. This is a sublime script, Scott. Smooth, easy to use, bug-free, and SO portable to every new map.
1585939237

Edited 1585939434
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Jay R. said:  bug-free Getting to the point where I released a script that someone can say that about it has been a long, hard road!. Thanks for the praise Jay! It means that I hit pretty much all the goals for the script. Also, make sure to let me know if you find any bugs!
is this only for opening doors or is there a lock and trap mechanic as well?
1586279133
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I believe there is a lock mechanism.
1586281152
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Mike, you can designate a door as locked by making it the color of locked doors that is shown in the script's menu handout. Note that this just means only a gm will be able to open the door. There is also a hidden color option that functions like locked, but players doing a search for doors using the script's detection ability won't be notified of these hidden doors.
Hello, Why my players cannot open doors with token? As DM I can. The character "DoorKnocker UI" has "Can be Edited & Controlled By" = "All Players" Another thing is that changing HEX colors of walls and door with !knock --preset and !knock --adapt is not working as well. E.G:  !knock --preset|wall|#00ff00
1586789465

Edited 1586790112
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi KokoS, I'm unable to replicate either of your issues. Could you give me some more information? For your player control: Do you get any error messages (either in chat or in the API log on the api script's page)? What command are your players using? !knock --key|... is gm only and will not work for players. Players need to use !knock --push|... For preset and adaptation issue: Do you get any error messages (either in chat or in the API log on the api script's page)? For adaptation, do you have a path (something made with the drawing tools) selected? For adaptation, what is the full command that you are using? And, General questions: Do you have all of DoorKnocker's dependencies installed and enabled? Also, a note, your players don't need control of the DoorKnocker UI. They can initiate door pushes directly from their own tokens. Giving them control of the Doorknocker UI won't cause an issue though.  I outlined this method in this post . Your players can even search for non hidden doors from their own tokens by using the command !knock --search , which will show both locked and unlocked doors.
Firstly I want to say thank you for this amazing API. Bravo Second I have both a question and a suggestion if the question is not possible. I currently have a copy of the "DM" key, set the token to a transparent PNG and changed the interactions to only open and close via "push" actions, for the PC to use. This works as intended. (or at least how i see this working for me) My issue is that because the door is usable by the PCs, it can be selected from far away, leading to unintentional abuse/misuse.  With that said; is it possible to potentially do any of the following? I would like to leave the "transparent token" at the door for the authentic interaction and have the actual player character act as the key, meaning the distance requirement would still be in effect? can this be achieved by some kind of reference tag?  or adding a variable to the character sheet? Or perhaps I am misusing the intent of this API. please let me know your thoughts.  Your work is fantastic. My goal is to allow for some from of player interaction by clicking directly on the "map" or invisible token. Either way thank you again for your amazing work here. 
1586803733
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You can set a player-usable doorknocker token wherever you would like and use the maplock script to lock it into place. In this way you could use a key icon set directly over any given door and lock its movement. In fact, that's a cool idea and I think I will add that functionality to my utility token.
keithcurtis said: You can set a player-usable doorknocker token wherever you would like and use the maplock script to lock it into place. In this way you could use a key icon set directly over any given door and lock its movement. In fact, that's a cool idea and I think I will add that functionality to my utility token. Further more, I think you have created an excellent "on use" feature here, for instance, a labyrinth with a switch that opens a distant hallway or some other puzzle like feature.  Is there any way to restrict the distance away the token can become "usable" by clicking and using the token actions? just curious. beginner at scripting, I can read the scripts and understand intent but by no means can I code.  Thank you again for your hard work. This setup can be used for far more than just doors thats for sure. I see this doubling as a player interactive switch button/system. cheers!
1586808285

Edited 1586808305
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You're welcome, but it's Scott's hard work. I came up with a vague idea last year about how something like this could work, and Scott made it a Real Thing. Like I said, "You know, we could probably burn petroleum to move carriages around, using pistons and stuff". And Scott invented a car and founded General Motors.
1586811652

Edited 1586811698
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
keithcurtis said: Like I said, "You know, we could probably burn petroleum to move carriages around, using pistons and stuff". And Scott invented a car and founded General Motors. Hah, that might be underselling yourself Keith! Obannon, the precise behavior you describe is not possible. However, you can simply have your players use the macro while selecting their own characters and it should do what you are wanting (at least if I'm understanding your request correctly). The use case in your second post is not supported though, and is probably beyond the designed scope for this script.
1587242158

Edited 1587242540
Dear Scott, all my comments are black bold text. Scott C. said: Hi KokoS, I'm unable to replicate either of your issues. Could you give me some more information? For your player control: Do you get any error messages (either in chat or in the API log on the api script's page)? What command are your players using? !knock --key|... is gm only and will not work for players. Players need to use !knock --push|... Well It's embararrassing but I set hex color to wrong color. But that's because actually I cannot adapt|preset correct colors. See below for more details. Now everything is correct, my plaers can open/close doors with --push. For preset and adaptation issue: Do you get any error messages (either in chat or in the API log on the api script's page)? For adaptation, do you have a path (something made with the drawing tools) selected? For adaptation, what is the full command that you are using? Now both adapt and preset works correctly. I used adapt wrongly, I thought it will change hex color e.g doors in script. Instead it's changing DL polyline to corespondent collor. Almost everything works perfectly I even set macro for my players tokens with !knock --push|... so no knocker token needed anymore but !!! Sometimes in DoorknockerUI character in "Bio & Info" I'm clicking on Setting for script color configuration and I'm receiving this: Page Not Found - and that was main reason of all my failures. Instead of Sometimes page display correctly sometimes I have "Page Not Found" error. I tried to figure out when, I think it's when I change some colors of DL polyline and use !knock --preset|... but not quite sure. That's only my assumptions/suspicion. And, General questions: Do you have all of DoorKnocker's dependencies installed and enabled? Yes, Matrix, Vector & Math, all up and running. Also, a note, your players don't need control of the DoorKnocker UI. They can initiate door pushes directly from their own tokens. Giving them control of the Doorknocker UI won't cause an issue though.  I outlined this method in this post . Your players can even search for non hidden doors from their own tokens by using the command !knock --search , which will show both locked and unlocked doors. Also one small enhancement. Whenever we are using !knock --preset|... in chat, it will be nice to have some kind of confirmation in chat that it worked and color changed. Now there is nothing and it can be confusing for new script users. If You have more questions please let me know. Thank You, the script is GREAT. PS. I just noticed when I tried to change color in "Bio&Info" => settings. I clicked on #ff9900 (color for locked doors) and instead of input console it displays "Page Not Found". I refreshed it and then it worked correctly (window with input field).
1587242662
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Glad it's working for you now kokos. I'm not sure what's going on with that page not found, so I'll need to look into that. My guess is that the link is getting set incorrectly at some point. If you get that again, could you post back here with what you were doing when it happened and any reproduction steps you can think of?
I am also getting the page not found error. This was working great for 2 weeks. I make a clone of a game and it was fine. Today for some reason I am getting a page not found error when attempting to config. I am unsure how to fix.
Obannon said: I am also getting the page not found error. This was working great for 2 weeks. I make a clone of a game and it was fine. Today for some reason I am getting a page not found error when attempting to config. I am unsure how to fix. Fixed it, i am assuming i can not have pop out enabled? probably missed this somewhere. sorry. great work.
1587687920
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Obannon said: Obannon said: I am also getting the page not found error. This was working great for 2 weeks. I make a clone of a game and it was fine. Today for some reason I am getting a page not found error when attempting to config. I am unsure how to fix. Fixed it, i am assuming i can not have pop out enabled? probably missed this somewhere. sorry. great work. Yes, unfortunately journal command buttons (which is what the script uses for that interactive handout) don't work with the handout/character popped out. I'll make sure to add that to the help text.
Hey, I've been trying to get this script to work, and it did at first, but now it's not registering anything. The open and close macros and commands don't appear to have done anything, and on the preset it changed the colors I was using on the dynamic lighting layer from pink for walls and green for doors to blue for walls and orange for doors. I've also gotten this error on the API script console:   Error: Firebase.update failed: First argument contains undefined in property 'stroke' Error: Firebase.update failed: First argument contains undefined in property 'stroke' at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:9:49) at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:207) at Aa (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:8:462) at Ea (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:403) at J.update (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:146:318) at TrackedObj._doSave (/home/node/d20-api-server/api.js:864:27) at later (/home/node/d20-api-server/node_modules/underscore/underscore.js:892:31) at Timeout._onTimeout (/home/node/d20-api-server/node_modules/underscore/underscore.js:829:19) at ontimeout (timers.js:386:14) at tryOnTimeout (timers.js:250:5)
1587948430
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
What command are you sending when you get that error message Wishing?
Might not be related, but I did see a message on Roll20 that some API functions were shut down for a while last night. 
Thanks for this, the script is easy to setup and works like a dream. 
Thank you for this script! Do you think it would be possible to have a « unlock » option? To switch from a locked state to unlocked ? 
1589029937
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Darshyne, Perhaps, but 90% of the time wouldn't you as the gm just open the door when a player unlocks a door? Not saying it can't be done, just looking for the use case that is a reason to add to the acrupt's scope.
Scott C. said: Darshyne, Perhaps, but 90% of the time wouldn't you as the gm just open the door when a player unlocks a door? Not saying it can't be done, just looking for the use case that is a reason to add to the acrupt's scope. An example use case: A locked door could be unlocked by a player, then the GM forget this has happened when they come back to the door later. Instead, moving it to an unlocked state would reduce human error as the GM no longer has to remember which locked doors have been successfully unlocked.
i get the api script error   at handleGraphic (apiscript.js:884:19)  , ive tried earlier versions
1590847522
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You'll need to give me the whole error Dan. Otherwise I have no idea what issue you're having.
is there a way to have the open/close door token action only show up when the player is near a door?
1590921935
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
No, the token actions aren't dynamic like that.
is there a way to make door icons bump to the gm layer when dynamic door lines do?
Dan, I use TokenMod to change layers of tokens and Door Knocker to handle the dynamic lighting layer. I store the token IDs in the door knocker bar 1, bar 2, etc.
1595387509

Edited 1595388370
AMAZING SCRIPT! Well done sir. Question for the group. If I want to have a hidden door, is there a way to set it so that an investigation or perception roll could pick the door out and change it from hidden to locked/unlocked or is this a GM must go in and change it? Also, I have a player with a skeleton key, is there anyway to make it so his key works like it should?
1595388896
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi Chandler, Glad you like the script. Unfortunately, both of those use cases are beyond the scope of the script. The second one is easily accomplished with some GM actions by just running the open command with the player's character selected.
Hey is there a way to run this when you have no token selected and have it use the target property? Or for you to specify via a token id which token you want to be treated as the key token?
1598246821

Edited 1598248517
Ivo
Pro
Just setup a new page and get this, loaded a previously working page, it also now gets the same error Cannot read property 'r' of null TypeError: Cannot read property 'r' of null at setContrast (apiscript.js:248:31) Just went to another game, seems fine, so game related, will delete and reload doorknocker and see if that fixes it, I had recently added some other scripts but I did delete them. No go now get this with updated version (From Door Knocker Error Handling): Door Knocker v1.16  Error Handling The following error occurred: Cannot read property 'r' of null TypeError: Cannot read property 'r' of null at setContrast (apiscript.js:249:31) Please post this error report to the  Script forum thread . Also getting this now Page Not Found. The page you have attempted to reach does not exist. Please check your URL and try again. When trying to open the help Ok started a new game, loaded just door knocker, all working fine. So i'm guessing something messed up in my current game when I added notes and checkitout. Ok, so copied game, all scripts removed, loaded door knocker, all good.
1598283748
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi Ivo, This is an error that I just dealt with at the end of last week in someone else's game. It's caused when your colors are entered as invalid hex code. Apparently my guards against invalid hex code entry aren't stringent enough. If you PM me an invite to your game, I can fix it for you, but I won't be able to do so till late tonight or sometime tomorrow. Scott
1598286525
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Also, the page not found issue is caused when you have the help handout popped out into its own window. Unfortunately, the journal command buttons it uses don't work when the handout is popped out.
Trying to use this as part of a Powercards script for a rogue's open locks roll. Essentially if the roll succeeds the door opens. Doesn't work. I get:  Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at HandleInput (apiscript.js:939:77) Here is the macro: !power {{ --name|@{selected|token_name} Open Locks --leftsub|Rogue Skill --rightsub|Dexterity + Level --Roll: | [[ [$Open] 1d20 + @{selected|DexterityMod} + @{selected|Level} ]] --?? $Open >= 12 ?? api_knock _key|open }}
Peacekeeper B said: Trying to use this as part of a Powercards script for a rogue's open locks roll. Essentially if the roll succeeds the door opens. Doesn't work. I get:  Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at HandleInput (apiscript.js:939:77) Here is the macro: !power {{ --name|@{selected|token_name} Open Locks --leftsub|Rogue Skill --rightsub|Dexterity + Level --Roll: | [[ [$Open] 1d20 + @{selected|DexterityMod} + @{selected|Level} ]] --?? $Open >= 12 ?? api_knock _key|open }} I believe that's because API's called from another API do not "communicate" the selected token id therefore making the object undefined.
--?? $Open >= 12 ?? api_knock| _key|open Might need the bar after knock... haven't played around too much with internal API calls in a PC But the Wiki and some of the threads I watch, usually have the bar after the API call... just a thought....
1599076903
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi peacekeeper (and thanks to Juan and Bilbo for their answers), Unfortunately, door knocker doesn't support this kind of integration because it requires a selected token which can't be sent as part of an API generated chat message.
ahhhhhh.... Might be an issue elsewhere with others having issues with API calls in PC cards... Thanks a bunch Scott... that kinda explains some things.... :)
SIDE NOTE about Door Knocker though.. I have tried to disable the aura's for the token, via the settings page on the token. And via the chat command to turn it off... Yet nothing seems to turn the aura off... What am I missing...???