Coder Social home page Coder Social logo

rinnocenti / innocenti-openlock Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 3.0 3.57 MB

Modules for opening locks using keys, force or picklock

License: Creative Commons Zero v1.0 Universal

JavaScript 92.78% CSS 0.55% HTML 6.67%
lock lock-trap loot-sheet thieves foundry-vtt foundry dnd5e doors chest

innocenti-openlock's Introduction

Innocenti OpenLock

ko-fi

A simple module to use loot actors and it will be possible to configure traps and locks. It was created for testing and learning purposes with foundry vtt

** FOR FOUNDRY SRIES 0.7.X SEE THAT BRANCH: ** https://raw.githubusercontent.com/rinnocenti/innocenti-openlock/v.0.7.10/module.json

Installation

You can install this module by using the following manifest URL : https://raw.githubusercontent.com/rinnocenti/innocenti-openlock/main/module.json

As GM go to the Manage Modules options menu in your World Settings tab then enable the Innocenti-OpenLock.

Thieves' Tool

Name of the item used as thieves' tools. By default, it always accepts Thieves’ Tools, and/or the name for its translation in the language file and/or the one indicated in these settings.

Maximum distance for perception (in grids)

The maximum grid distance for the perception action to be performed.

Maximum distance to interact (in grids)

the maximum distance for players to interact with the lock in number of grids.

Remove Lock

if enabled, whenever the chest is opened the lock item will be removed from the chest items.

Repeat Check

if enabled, players will be able to repeat the check the same loot.

Dependencies

This module was created to work in a world with other support modules so you don't have to increase your workload.

The module is system dependent:

  • System Dnd5 (v. 0.98 or greater)

And the Modules:

How to Use

the module basically works looking for a feat that has the open lock option enabled in loot sheet with the character's target and macro activation.

  1. Create an NPC using the loot sheet.

  1. Create an item of type Feat and in the tab Open Lock for settings.

If you have a lock trap, set the damage and the actions in this item in detail tab. If you select an **Action Type** it will recognize this trapped lock, if empty it will consider that there are no traps.

How to Use - For Doors

It works the same way as looting, but ideally, use a transparent actor next to the door so that the player can use it as a target. when unlocking a lock if the coordinate door is locked, it will open automatically.

If using thieves' tools, the door goes from locked to closed. If you use force, the door goes directly to the open state.

Enable Lock/Trap

feat to function as locks need to activate the module on the item.

Wall Coordenates

Enter the number of the door coordinates, see the door coordinates field in the wall layer (something like 1100,1200,1000,1100), if any coordinate (or other text) is entered here, the system will recognize it as a door instead of a loot.

Item Key Name

if you want this lock to have a key, fill with the exact name of the item you want to use as a key for that lock.

Disarm Trap DC

the value for the difficulty class to disarm the trap on it, the player will make a dexterity Tool check against this value, it will only be tested if the player has the item thieves' tools in his inventory.

Find Trap DC

the value for the difficulty class to find the trap in close distance, the player will make a perception/investigation test against this value

Passive Find Trap DC

the value for the difficulty class to find the trap in distance, will be tested against the passive perception, if it is not successful a test of the perception or investigation skill will be requested. Passive perception serves to locate secret doors, verify that the player has the right key, and / or display the name and image of the correct key.

Force Lock DC

the value for the difficulty class to force open the lock, the player will make a strength test against this value to open the lock. The lock will only be broken if the player passes the CD + Threshold test.

Open Lock DC

the value for the difficulty class to open the lock, it is necessary to have one thieves'tool in your inventory. the player will make a Tool Dexterity test against this value to open the lock.

Threshold of Tools Break

If the value of the thieves' tools use test is below the threshold indicated, the tool will break and will be removed from the character's inventory.

  1. Place the "Lock" object on the loot sheet.

  2. Create two macros with permission for all your players with the following content:

macro1 - FIND TRAP let actions = new InnocentiOpenLock.Actions('FindLockTrap');

macro2 - OPEN CHEST let actions = new InnocentiOpenLock.Actions('OpenLock');

Advanced: you can also separate the workflow into individual macros, just change the name of the actions in parentheses. 'Breaklock', 'Picklock', 'DisarmTraps'

there are examples in the module pack

5)The player must aim at the token of the chest and choose one of the macro actions.

Macro 1: Find Trap

Find Trap will test the passive perception of the player against the DC, to identify if there is a trap, if there a Key and if lock is blocked.

If the passive perception does not reach the DC, the player will be asked for a perception/investigation check.

if you succeed in any of the perception tests the option to "disarm the trap" will appear when trying to open the loot(player need to have the thieves'tools in your inventary).

A chat card will be created with the results, including the indication if player has the key (if the lock has one, the player has the correct one and passed the perception test for looking for).

Update: Now whenever an attempt to search for a lock is made, a roll will be requested, even if it does not have a lock, so that the player does not know on the first attempt that there is not a lock.

Macro 2: Open Chest

  • Makes an attempt to open the chest.
  • If the player has permission for that chest or has the key to it, the chest will be opened immediately. Otherwise, a dialog will be displayed for ways to open the chest, using stranght check or using thieves'tools(player need to have in your inventary).
  • If the player closes this dialog and the lock has a trap, it will be fired.
  • If the player succeeds in the strength check, the lock will break and will not activate the trap. Otherwise it cannot open lock and if it has a trap it will be activated.
  • If the player succeeds in the dexterity check (with tool), the lock will not break and will not activate the trap. Otherwise it cannot open lock and if it has a trap it will be activated.
  • A trap is considered disarmed when the "Action Type" field of the lock is empty, otherwise it is considered an active trap.

Future Features

  • More accurate chat messages to identify successes in opening locks.

Support

If you like this module and would like to help or found a bug or request new features call me on discord @Innocenti#1455 or create a issue here.

Troubleshooting

If you do all the steps and are unable to activate thives' tools (no rolls happens).

Check the spelling of the name Thivies's tools. In some cases the apostrophe used in the name of the compendium is different, some use ' others use depending on the font used in the layout, the two may look identical. The SRD use which is the default. In any case, copy and paste exactly the text of your item (ctrl + c and ctrl + v) in module settings.

License

This Foundry VTT module, writen by Innocenti, is licensed under a Creative Commons Attribution 4.0 International License.

innocenti-openlock's People

Contributors

rinnocenti avatar tallon159 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

innocenti-openlock's Issues

Reset trap after being disarmed

I was testing with a player the lock on a trap door. They used the thieves' tools to disarm the trap and the check worked great. Now I want to go back and reset the trap so that it is ready to go for the campaign. But the same player token shows that the trap has already been disabled.

Module is broken / Macros give not a function error in the console.

When trying to use the Open lock or Find Trap Macro nothing is executed. (no more chat messages or options) Not sure what dependencies your module needs but something has broken your module within the past 2 weeks. The console presents the following error:

behaviors.js:132 Uncaught (in promise) TypeError: lootToken.actor.items.getFlag is not a function
at new LootLock (behaviors.js:132)
at new FindLockTrap (behaviors_FindLockTrap.js:5)
at ActionLock.Actions (actions.js:26)
at new ActionLock (actions.js:18)
at Macro.eval (eval at callScriptMacroFunction (Macros.js:176), :5:31)
at Macro.callScriptMacroFunction [as callScriptFunction] (Macros.js:179)
at Macro.renderMacro [as renderContent] (Macros.js:197)
at Macro.executeMacro (Macros.js:221)
at CONFIG.ui.hotbar._onClickMacro (foundry.js:20566)
at HTMLLIElement.dispatch (jquery.min.js:2)
LootLock @ behaviors.js:132
FindLockTrap @ behaviors_FindLockTrap.js:5
Actions @ actions.js:26
ActionLock @ actions.js:18
eval @ VM12939:5
callScriptMacroFunction @ Macros.js:179
renderMacro @ Macros.js:197
executeMacro @ Macros.js:221
_onClickMacro @ foundry.js:20566
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2
behaviors.js:132 Uncaught (in promise) TypeError: lootToken.actor.items.getFlag is not a function
at new LootLock (behaviors.js:132)
at new OpenLock (behaviors_OpenLock.js:6)
at ActionLock.Actions (actions.js:26)
at new ActionLock (actions.js:18)
at Macro.eval (eval at callScriptMacroFunction (Macros.js:176), :5:31)
at Macro.callScriptMacroFunction [as callScriptFunction] (Macros.js:179)
at Macro.renderMacro [as renderContent] (Macros.js:197)
at Macro.executeMacro (Macros.js:221)
at CONFIG.ui.hotbar._onClickMacro (foundry.js:20566)
at HTMLLIElement.dispatch (jquery.min.js:2)

Traps not activating / detonating

Hi,

I believe I have everything set up correctly, I can get the checks to work, the boxes to pop up for Break lock, pick lock and unset trap, but, I'm unable to get the trap to actually detonate / trigger on a failed attempt. I've added the following into the 'details' sheet of the "lock' feat:

1 Action
Melee Attack
2d6 piercing damage

When I run the 'Find Trap' macro I can see that it is registering the trap, but its not firing. Can you please advise the correct settings to use to create a workable trap effect eg. 2d6 Piercing?

Thanks,

Tatonker

Sometimes after loading cannot open Actors or Items

Sometimes when loading Foundry with this mod active with its dependencies I get errors trying to open Actors and Items. Without the mod, the issue never occurs even if I still have the dependencies active.
image

If I am able to access Actors and Items. I can no longer adjust the size of the window of Features. Spells, Weapons, Backpacks, etc still allow me to adjust the size of the window.
image

How do you make Locks more reusable?

If i edit the location of one lock it edits them all (of the same lock feature). I'm new to Foundry and if I've done something wrong I'm sorry but is this by design?

No "Open Lock" in feature

I have non any window for setuping my lock.
I created a feature with name Lock , but...there is no section Open Lock((
image
image
Особенность - means feature (russian localization)
image
image

Not recognizing thieves' tools in inventory

Love this module super cool function! For some reason my rogue is only getting the strength option to open locks. I have "Thieves' Tools" equipped.
Edit: Also the lock is being removed even when that feature is not checked off.

trouble using this

I followed the instruction on a few videos, and your post here. I have actors set up and items created. I can place a lootsheet transparent token, which can then be given a lock. When the players use the open lock macro or find trap, it say not a valid loot. Am I missing something?

Feature Request: Toggle Automatic Door Opening on "Find Traps"

It would be nice if you could put an option in for how you want keys to work on doors.
Currently if you use a key, it automatically opens.
But there are times when the players will unlock the door, but not open it.
Especially if the party is just inspecting the door, but not planning on opening it at all.

A tickbox option for choosing one or the other would be great!

Seems to not work

Hi,

I cannot get this module to work properly.
All seems functional except the fact that after successful check I cannot open the chest.
Seems like permissions are not changed automatically.

obraz_2022-06-15_111041264

Feature Request: Support of other systems

How about pathfinder 1 support?

It would be very cool if the midi-qol dependent features where optional so other systems thatn DD5 could work with it as well.

BTW: Great module, but wrong system (for my player base)

Not working in 0.8.8?

Hiya, thanks for the mod. I can't get it working with the latest version of Foundry though. The chests stay closed even if the characters succeed on their rolls. I wonder if there are any updates coming? It's a good mod. I would hate to see it abandoned.

Cannot fill the Open Lock tab

Hello !

I have been trying to use this module with version 0.8.8 of Foundry VTT. I don't know if it is related to this specific version, but I cannot fill any field of the open lock tab.
The tab is re-rendered on the onchange event, and all modifications are lost.
After I commented the render call in the onchange event listener, I managed to have a lock working properly, but I am still facing a second issue : the trap isn't triggering when a check fails.

Do you have any insights of this issue ?
Kind regards.

Trap is always found.

When an actor searches the door or chest, the trap's presence is always detected regardless of the find traps DC. Am I doing something wrong?

I love this Foundry module and I'm excited to use it. Thank you for your hard work!

Reset the sate of the lock for a token

Currently when a token goes up to a door and does the OpenLock action if they are able to get the lock open the same token can come back and the door just opens. Is there a way to reset the lock on the door so that if the same token comes back but the door is locked it will not just open automatically?

Find Traps Macro Auto Unlocks Doors

As the title states I have been playing around with the locked doors feature and realized that when you run the find traps macro it auto opens the locked door is connected to.

Multiple issues

I had high hopes but it seems broken.

  • Foundry V9
  • Build 280
  • DnD5e 1.6.3
  • Active modules 93
  • IOL versions tested 0.7.9 from the manifest and 0.4.6 from the foundry load.

I loaded Innocenti Open Lock and all required dependencies. Attempted to create an item of the type Feature as instructed. The "Open Lock" tab is missing. I would assume this may be a conflict with one of my other mods. However, considering they are all working as expected, I'm not going to disable them to get this one mod working.

The second issue that I ran into was the macros. They are nowhere to be found in the compendium.

The third issue encountered when clicking update in the Foundry Virtual Tabletop - Configuration Setup, the mod downgrades to 0.4.6.

Feature suggestion

Instead of wall coordinates for doors, allow targeting via tags. This would allow your module to work for players building prefabs and removed the requirement to set a target every time an object is placed.

no open lock is shown

hello,

after creating a new item (feature) and open it, no open lock menu is shown.

foundry 0.8.6
dnd 1.3.3
all needed modules are installed and enabled

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.