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

I wish I understood any code at all, or roll 20 for that matter.  When I copied and pasted the code in the chat, it gave me all the options to set the colors and everything, but I cant find the token.  I tried making my own token and just setting an the correct color aura but that didnt work either
1569905349
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The token should be in your journals, called DoorKnocker.
keithcurtis said: The token should be in your journals, called DoorKnocker. I have looked through every folder and subfolder, its not there.  Posting the script does ask me for things like aura color and stuff like that but no token has appeared in my journal. 
1569924367
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ansgar, What are you typing in chat when you say that you post the script? The DoorKnocker UI character should just be at the very bottom of your journal (unless you've moved items below it). It looks like this: If you drag that DoorKnocker UI character to the table, it will create a token using the default token for the character (which is the key icon you can see in that screencap by default). The setup can be done from the interactive bio section of that character, and then to use the script, you just need to select a token and run a key or push command.
1569931963

Edited 1569932870
Scott, I posted the script from the repository, the 1.12 beta.  I copied the whole thing and pasted that in chat.  I got a message asking what colors I used for things, posted the proper hex codes, the token however did not appear.   I realize I must be doing something wrong.  This message popped up in chat after entering all the info it asked for   Unrecognized command: /*
1569933785
Sr. K
Pro
Sheet Author
Chat is just for macros, the script goes here: Check this link for info:&nbsp; <a href="https://wiki.roll20.net/API:Use_Guide" rel="nofollow">https://wiki.roll20.net/API:Use_Guide</a>
Thanks Sr K, just figured it out!&nbsp; Perfect!
1569939803
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, that's what I was worried about. The reason you were getting prompted for hex color codes is that those queries do actually exist in the code, but they're supposed to be sent when you click on certain journal command buttons in the UI character's bio. Glad you got it figured out, and don't worry it gets easier ;)
Thanks Scott, and thanks for not making me feel like an absolute dingus for missing that lol.&nbsp; I do have a question, is there a way in the future you could have the knocker token actually move another token to the gm layer?&nbsp; I t would be kinda fun to actually have the doors disappear when the door was opened.&nbsp; Not necessary but it could be cool.&nbsp;
I love how simple this API is, it's already perfect for me :_ I think that this kind of functionality is already possible but via a different API. Check out ' <a href="https://app.roll20.net/forum/post/636123/script-door-control-for-players-includes-locks-and-traps/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/636123/script-door-control-for-players-includes-locks-and-traps/?pagenum=1</a> '
1570110303
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Matt's Doors and Simple Doors have been around a long time. Scott's great script came about from a discussion we had on Discord about what we would like to see in a door script.
1570112801
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You're welcome Ansgar, and no worries, we've all been where you're at. The other script writers can tell you some of the many stupid things I did when I first started (and still do sometimes). As for your request; unfortunately that's beyond the scope of the script. As godthedj and Keith have pointed out, there are several scripts that handle that sort of functionality. Door Knockers goal is to provide easy door control with practically no set up. Right now I can't think of a way to meet that "no set up" goal while manipulating door images.
Ansgar said: Thanks Scott, and thanks for not making me feel like an absolute dingus for missing that lol.&nbsp; I do have a question, is there a way in the future you could have the knocker token actually move another token to the gm layer?&nbsp; I t would be kinda fun to actually have the doors disappear when the door was opened.&nbsp; Not necessary but it could be cool.&nbsp; Matt's Door Script doesn't move things to the GM layer to be honest. Instead it uses doors as tables with one closed and one opened side. Takes a bit of setup but looks nice when used. :)
keithcurtis said: Matt's Doors and Simple Doors have been around a long time. Scott's great script came about from a discussion we had on Discord about what we would like to see in a door script. Just used this and it is so simple, so perfect, exactly what I needed.&nbsp; Thank you!&nbsp;&nbsp;
1570122605
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Simple Doors was my favorite solution until Door Knocker.
If I could have the best of both worlds I would.&nbsp; I love that I could just hide a tiny version of the key next to each door and easily toggle the door, that function is AMAZING.&nbsp; I also like that I could keep my door on the map layer.&nbsp; With simple doors though I was able to give each door the toggle macro so all I have to do is select the door, click the token abillity and not only does the door open but it looks open on the map as well. Having that visualization for an open door isnt the most necessary thing, but it pleases me on a childish level lol.&nbsp;
I have installed the script and i cannot find the token either in my journal. I have installed the script in api but no token in it I am missing something?
1570375696

Edited 1570375792
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Nothing appears in your journal tab when you search for "doorknocker"? Try creating a brand new game with just Doorknocker installed. It should help nail down whether the problem is procedural, or something quirky about that particular game's interaction with the script.
1570376910
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Can you check the archives characters folder? It shouldn't be there but it's all I can think of atm. If it's not there can you reload your API scripts page, then restart the sandbox, and then post what is logged in the API console?
So I am getting this error, on my API&nbsp; If i disable door knocker it works
1570377476

Edited 1570377534
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ok, this is actually caused by another script that you have installed that hasn't properly closed itself. Try adding a semicolon (;) on a new line at the top of Door Knocker. Like so: ; var DoorKnocker = DoorKnocker || ( function () { let scriptStart = new Error ; // Generates an error to localize the start of the script EDIT: This happens because all API scripts get concatenated into one long super script to actually be run, which means that a minor code mistake in a previous script can cascade until it builds to something like this.
Like this? This are the scripts i have on&nbsp;
Still not working The same error pop ups. Or do I nee dthe whole code line you publish before?
1570378272
GiGs
Pro
Sheet Author
API Scripter
It looks like you've copied the wrong part of the code into the script tab.&nbsp; You've copied the contents of the json file, which isnt actually the script. You need this file: <a href="https://github.com/Roll20/roll20-api-scripts/blob/master/Door%20Knocker/1.12/DoorKnocker.js" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/blob/master/Door%20Knocker/1.12/DoorKnocker.js</a>
I tried both ways, both still getting same problem
Ok. Yes that did the trick. I tough that script looked a little bit different than the rest. Thx you so much :)
1574794353
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
And, the script is now available via one-click
1574806714
Ziechael
Forum Champion
Sheet Author
API Scripter
Woohoo! My DM loves this script, great work :)
Does disabling the search auras actually work? I can turn them off from the character bio, and it disables the aura, but if I move the character token they reappear, whether the search auras are enabled or disabled.
1579296385
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm, that certainly shouldn't happen Ty. I'll do some investigating and may ask for some more troubleshooting information.
I made a new campaign and just loaded the Door Knocker script, just to make sure it wasn't being interfered with.&nbsp; Disabling the aura does work as long as you don't move the token after disabling. Then it shows back up while within 1 square, it seems. Other than that, the script works WONDERFULLY, and this isn't a major issue. So thank you so much!
I think I've come across a bug: In the script's settings, the color for hidden doors can't be changed. Clicking on the interface to change the color brings up this query, and then nothing changes after submitting a value. The default color is black, and I'd like to change it to a color I can see more easily.
1579901419
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Thanks for the reports Persephone and Ty. I've started working on fixes for both of these.
1579903046

Edited 1579903080
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Fix is completed and submitted for push on Tuesday. If you want to get the code earlier, you can find it here . Door Knocker v1.14 Search Auras are no longer created on the map layer as they were being hidden by map graphics. They are no created on the objects layer. Currently existing aura tokens will be updated to the proper layer with this update. Search Auras no properly disappear/reappear based on the setting in the script's menu Fix for hidden doors color not being set correctly
1580579170

Edited 1580579722
Stephen D
Pro
Marketplace Creator
I get this error after installing the script to the API library of my game. Any idea what I have screwed up? Cannot read property 'help' of undefined TypeError: Cannot read property 'help' of undefined at handleGraphic (apiscript.js:856:59)
1581010461
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Script Synergy! If you run the Aaron's !Bump script on the Doorknocker token, it becomes invisible to PCs. Bonus, the aura on the bumped token continues to update per Doorknocker rules once it first gets near enough to a door.
1582000447

Edited 1582000480
That's an awesome idea, keith, I'm gonna start doing that in my games! Also Scott, I'm getting this error in chat when I installed from One-Click to a new game, and the UI character isn't being created. Cannot read property 'version' of undefined TypeError: Cannot read property 'version' of undefined at Object.checkInstall [as CheckInstall] (apiscript.js:119:37)
I started to just add the macros for opening and closing unlocked doors to the characters with the menu makers. That way they have control over that and I have control over the locked and hidden ones. Also adding a /desc or /em to say they interacted with the door so I know and can act accordingly.&nbsp;
1582001684
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Nifty!
Kilter said: I started to just add the macros for opening and closing unlocked doors to the characters with the menu makers. That way they have control over that and I have control over the locked and hidden ones. Also adding a /desc or /em to say they interacted with the door so I know and can act accordingly.&nbsp; I have done the same all my PCs have a macro on their tokens to open/close unlocked doors and I have global macro for my NPCs that opens all doors!
1582046751
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi Stephen and Persephone, I apologize for the lateness of responding to your bug reports; work's been a little crazy lately. Once the API server is back up, I'll investigate these error issues.
1582052908
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Stephen and Persephone, I can't replicate the issue you're reporting. Do you have other scripts installed? Is the script working in other games for you?
I do, and it is, but the new game doesn't have any scripts that my current one does not. The only difference is most of the scripts in the new game are one-click installs.
1582056214
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm, ok, can you post a screencap or list of what apis you have installed in the new game? There's probably a character encoding or script end issue going on. If I know which scripts you have installed I can probably narrow down the issue.
1582060002

Edited 1582060076
Here you go. If you need a closer look at any imported scripts you're unfamiliar with, I can PM you an invite. The only one on this list that isn't in my on-going game is Measure, which I tried disabling but it changed nothing.
1582067279
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Thank you Persephone, I'll take a look at those tonight. Just to double check something, could you disable all the non one click scripts between hands up and door knocker, starting with combatmaneuvers?
1582072796

Edited 1582073235
I'm seeing the same error on a brand new game with no other scripts installed (Except the prerequisite math scripts, of course).&nbsp; Cannot read property 'version' of undefined TypeError: Cannot read property 'version' of undefined at Object.checkInstall [as CheckInstall] (apiscript.js:119:37) Steps to recreate: Create a new game, no module/campaigns, 5E OGL char sheet. Install DoorKnocker via 1 click install (and accept the prereq installs). Launch game.&nbsp;
1582684981

Edited 1582688267
Ivo
Pro
Same as above, clean new game, no scripts, same error. Existing games work fine, with same version of DoorKnocker Manually loading version 1.12 solves the issue, looking at 1.14 now to narrow down the problem Re below Ah :) Thx Scott!
1582687604
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Thank you all for your information Persephone, Ivo, and Michael B. I just pushed a fix for this issue to the Roll20 repo. It should go live for one-click next week around 3/3/20. If you'd like to access the update immediately, you can find it in here . Stephen D, this should hopefully fix your issue as well.