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 .
×

[Script]Locksmith

1786725229
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Locksmith - Automatic Lock-Picking & Knock for D&D 5e (Legacy + Beacon) Roll20 doesn't have a native way to trigger "a player interacts with a locked door," so lock-picking has always meant the GM manually comparing a roll to a DC they're keeping track of somewhere else. I built Locksmith to close that gap for my own table, and figured it might be useful to others too. [ Video Demo ] [ Code Until One-Click Merge ] What it does Set a difficulty on a door or window once (or mark it Unpickable, or Magic-only for Knock), and from then on your players just make Thieves' Tools checks as normal - Locksmith automatically finds the nearest locked door/window in range and resolves it. Works with both the legacy (5e) and Beacon (5.5e) character sheets. Automatic Thieves' Tools resolution - success posts an Unlock button Knock spell support, detected automatically, can bypass Magic-only locks No custom data storage for lock state - the DC lives directly in the door/window's  color property A GM setup menu, with on-map status labels (they turn yellow if a key-holder is already on the map) A full keys and keyrings system - hand out keys directly or generate a custom loot macro for treasure. Each player gets a !keyring report to Use/Give/Drop their keys Can optionally create a !keyring token action for players Full in-game documentation via !lock --help Installation One-Click install (search "Locksmith"), or grab Locksmith.js directly from the repo folder. Getting started Select a door or window, run !lock, and use the Set row to configure it. That's it - !lock --help covers everything else, both for you and for your players. Feedback welcome - this has been built and refined through actual play at my table, so if something doesn't work the way you'd expect, let me know. This script was released early for playtesting, for free, on my  Patreon .
Hi Keith! Another great script from the script king! Would it be possible to add penalties to locks? Example, failing a lockpick by 5 damages the picks. Or failing by 10 or more jams the lock, etc... Great script! Thanks for sharing!!!
1786895928
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Pak! Thanks! There is a lot I would like to add to this, but there are some real limitations. The DC is stored in the color code. This makes it possible to set and then copy/paste, transmogrify, or duplicate them along with pages. Doors and Windows do not have many places where data can be stored,so the color code is it. At the same time, I don't want to shift that color too much visually. I want the user to be able to see doors as orange and windows as cyan. Each step away from the pure color indicates a change in DC. This is also why I cap the DC. The harder the door gets to open, the less it keeps its color. So the amount of data is limited. I have advocated that every Roll20 object should have a description or data field, that just holds a string. There is so much stuff that can be done with that. Doors could store descriptions, descriptions of their keys, noises to play when opened, riddles, all kinds of stuff. Right now though, we're about at the limit of data points I find comfortable storing.
Can't wait to add this to our game.  When a character uses the Knock spell, does it have to be cast from their character sheet or can it be called from another script like Tim's Spellbook, which we also use in  our game.
1786908948
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It looks for key words in the template produced by the character sheet. If Tim's Spell book triggers those sheet abilities, it should work.
Nice! I've been looking for something to handle doors with.  What key words are it looking for? Can these terms be in a ScriptCard? So they need to be in the title or text?
1787162409
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks Eric! It looks for the rolltemplate or msg.type produced by the sheet for the thieves tools or knock spells. If your ScriptCards script triggers the sheet abilities rather than constructing from scratch, it should work. I got very specific on the searching because I wanted to reduce the chance of false positives, and the script also needs to know how to find the result numbers accurately in the case of the tools. For instance, if you don't have advantage or disadvantage set on the legacy script, but are simply always rolling two d20s, it's smart enough to ask for comfirmation on the intended result.
Hi Keith, I commented on your locksmith video a few days ago with: "Setting up walls like that in a city environment without blocking the view behind the house from a top-down view? Only block the walls; I've been trying to work around the dynamic lighting and the foreground setting to make it work." I am attempting to set up the hub town of Phandalin with a map of the town for the players to walk throughout and interact with each of the buildings; in doing that, there will be walls and doors leading to different areas. The intention is to use this as a main hub for all of the elements of Lost Mine of Phandelver and other extra aftermath of that campaign. The issue is that with the global illumination and the walls, there is a large chunk of the map that will remain dark and blocked behind the buildings. I have a separate PNG for roofs in the foreground layer and the base is on the map layer. I am using the dynamic light with the walls. I have considered just swapping all of the walls to transparent walls and just using the conditional fade for the roofs to cover that issue; however, the walls within the building wouldn't block vision in that way, and the doors will still block the vision as is. I am stumped on this one. If you have any suggestions or mod recommendations to assist with this, I would greatly appreciate it.
1787926025
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Xtreyu! Would explorer mode help alleviate the issue? I'm sorry, I've read that paragraph several times and am having trouble understanding what you want to happen vs. what is happening.
Explorer mode would make the dark areas go away, yes, however, it would also heavily weigh on the browser and cause a lot of lag. the map is 120 x 120. My apologies if I didn't cover the issue well. My intention is to kind of have the vision of the players be like that top picture, where the players can see the whole town, but when they get close, swap to inside the building and respect the vision inside the buildings. I am having a hard time trying to make something like that work and not cause it to be a laggy mess. I hope that covered what I meant,
Not sure if this is best for you, but what I have done in the past is make up the interior of each building but them on a separate page and then use the Teleport script so that when the players put their token on it they are sent to the proper page. Takes some time to set up, but find that it cuts down on the lag as there is not as much on one page.