MV SDJB_LockpickSystem

PluginName: SDJB_LockpickSystem
Author: ShadowDragon (original Author Pixeldrama)

The PXD_Lockpick plugin is really nice, but there are some bugs, and some annoying ones!

While this is a recoded version, and modifications here and there, it goes under SDJB_LockpickSystem.
While not claiming his ownership, it does have various bug fixes, issues, fail-safes, parsing parameters,
missing functions restored.

The following of the plugin are fixed:
- success sound was missing and not used (removed)
- some of the input was rather double and confusing (fixed)
- hide gauge was possible on skill level 101+ but this was not the case (fixed)
- some parameters was parsed wrong (fixed) (parameters are now in struct)
- parameter for "lockpick" plugin command name is removed for the time being.

The following are added:
+ able to change data item + image (so you can have a normal and stronger lockpick)
a nice way if you don't want to increase skill level above 50 (but rest based on lockpicks!)
+ scene stays open while you hold lockpicks (last one used) else it closes when you run out.
+ new parameter to rotate the lockpick speed (some found it to slow)
+ new parameter to turn the lock open (some found it to slow)
+ new parameter to add a list of lockpicks and add a modifier, and is it unbreakable?
+ No more need for conditional branch logic if player has lockpicks!
The plugin logic is optimized to do the heavy work for you!!!! (how cool is that)
This way, you just need the plugin command, drop all the rest.

to be added to the parameters till fully functional for release
- Gauge count before the scene is open, losing durability (still trying to fix this too).
- new parameters for font (if you want too).
- new parameter to be able to name your lockpick items (image usage).
- new parameter to close the scene after losing picklock or not.
- gauge change color from green to red if lockpick is about to break (optional inside parameter).
- block locked chest from opening when you have no lockpicks. (you could event this already).
but you should if you have different lockpicks to determine the skill level to be lower or higher!


there could be lower eventing requirements to make things work.
once done, I share the plugin here, as this is a nice plugin, lots of things is fixed and added.


if you have a suggestion not added yet, please leave it behind.
if you like PXD_Lockpick plugin, this one is a must for a smooth gameplay!

Spoiler: Helpfile
Code:
 Parameters are setup as the base parameters as PXD_Lockpicks plugin
 while there are new added ones pre-configured, so it's mostly plug & play.

 However, there are some settings that require attention so let's check
 each one as well as new added parameter and features to get the best out of it.

 You require to configure the Lockpick tools in the GamePlay Settings.

 This overhaul has more features and bugfixes, failsafes, and more customisable.


 Global Lockpick Settings
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 [Keep Scene Open] you can keep it open or close when failed.
 The lockpick is refreshed when it breaks.

 [Rotation Speed] and [Unlock Speed] is to check how fast it turns.
 
 [Max Turnrange] is how far it can turn before opening it, while it has one
 setting before, it is now customisable.


 Control Lockpick Settings
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 [Turn Left] and [Turn Right] is to rotate the lockpick.

 [Unlock Button] to unlock the lock

 [Cancel Buttom] to exit the scene any time.


 Gameplay Settings
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 [Lockpick Skill Variable], this variable is required for your skill to open
 the lock of their strength.

 [Lockpick item Id's] The list of Lockpick items to use and settings.

 [Strength Name] The name of the strength of the lock.

 [Lockpick Name] The name of the lockpicks you carry

 [Lockpick Gauge Level] Lockpick Gauge is hidden until you reach a skill level.
 number 101+ remove the gauge entirely.

 [Name X/Y Position] Name of the Strength and Item base position

 [Number X/Y Position] Number of the Strenght and Items position


 Lockpick Item Settings
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 [Item ID] is the data Item ID you use for the lockpick.
 This can be changed midgame, so reset it on the top of the lockpick event.

 [Skill Modifier] add bonus to the lockpick if desired.
 when the lockpick strength = 40, with a modifier of 8, than the strength
 of the lockpick become 32 automatically!

 [Lockpick Image (top/bottom)] The lockpick image to use which can be changed
 based on the lockpick item (must use scriptcalls for now to change them).

 [Max Durability] set the max durability per lockpick between 1 and 999.

 [Unbreakable] This boolean can make the lockpick unbreakable and does not
 lose any durability, see this as a late game item.


 Gauge Settings
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 [Gauge Width/Height] set the width and height of the gauge

 [Gauge X/Y Position] set X and Y Position for the gauge

 [Gauge Color 1-4] set the gauge colors when it is about to break,


 Lockpick Sound Settings
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 [Open Sound] Set sound when you successfully open the lock

 [Failed Sound] Set sound when you failed to open it

 [Break Sound] Set sound when you break your lockpick

 [Position Sound/Turn Sound] Set the sound effect for position and turning
 the lock, while it's similar to the other sounds, this one have a few extra
 parameters: [Base Volume], [Random Volume], [Count] and [Repeat Timer].

 Repeat Timer can be any that repeat the sound ever x Frames.
 Count require multiple files that choose a random count while checking.
 FileName_0 + 1 makes FileName_01 as sound file.


 Font Settings
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 [Font Name] Set the name to be used for the lock system (strength and number)

 [Font Size] The size to be used

 [Font Color] The color of the font (use RGBA)

 [Font Outline Width] The thickness of the outline width

 [Font Outline Color] The color of the outline (use RGBA)

 [Font Italic] use italic font (boolean)


 Plugin Commands:
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 To use the plugin command, use the following call:
 
 lockpick strength background selfwitch

 Example:
   lockpick 30 Wood D

 The above example have a lock strength of 30, background image "Wood"
 and set the SelfSwitch "D" when succeed.

 In addition of multiple lockpicks, use the same, as if you have more
 than 2 lockpicks, you get the choice which one you like to use of the
 available lockpicks in your inventory.

 It is recommended to use the "strongest" strength.
 Reason for this is the the modifier that the lockpick can have, which
 lower the strength.

 Example:
   lockpick 40 Metal A

 You have lockpick A (weak)
 and you have lockpick B (stronge4, modifier: 5)

 weak: 40 = 40, as the default strength
 stronger: 40 = 35 as its a better set.

 Lockpick modifier = optional in this part, as you can keep it at 0,
 but you can increase the durability from 100 to 150, which is also better.

 However you set your lockpicks is up to you.


 Scriptcalls:
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 There is 1 scriptcall that is required to use for each chest in order to make sure
 it has the correct locks on them:

   $gameSystem.changeLocks(main, background, cover);

 => main:          The front of the lock
 => background:    The background of the lock
 => cover:         The cover that cover on the main (left half).

 Example:
   $gameSystem.changeLocks("Lock", "LockBG", "LockCover");

 Use the scriptcall before the Plugin Command.

=== TERMS OF USE ===
Free for Non-Commercial and Commercial use when credit is given.
credit one of the following:
Pixeldrama (it's not on his page, but would be nice if you did)
ShadowDragon
ShadowDragonJB

Version + UPDATE'S
21-01-2025 Version 1.0.0 first release
xx-01-2026 Version 2.0.0 Heavy optimized, improved lockpick logic


=== WARNING ===
YOU ARE NOT ALLOWED TO REDISTRIBUTE OR SELL IT OR TAKE CODE FOR YOUR OWN.
DO NOT REMOVE THE HEADER.

(file is below as it require my base plugin (SDJB_Base or SDJB_BaseMVZ (minified version))
leave Feedback and or suggestions.

Plugin coming soon when the helpfile is ready, but not all features would be available right away,
but do my best to add them when I got time.

=== ATTENTION ===
Data files are for download (almost everything is implemented, need some more adjustments)
Create a new project, copy the files to the corresponding Project and try it out.
(I use NWJS 0.48.4 and PIXI 4.8.9) 0.29 probably doesn't play nice!

if you encounter any bugs, let me know (same for suggestions/feedback).
Small Preview on lockpicking if your lockpick is getting damaged.
based on 4 colors (will be set in parameters later.
prevLP.png


there are some other changes to make it more organized.

Data-files, plugin are later available (but not everything are set yet)
but is more customisable and will be updated upwards and add suggestions
when possible and able.

fully customisable require knowledge, for now, default assets,
which you can change.

keep in mind by default (PXD plugin), 1 tool, 1 lock, multiple backgrounds.

this version can change tools, locks (but require eventing to be effective)!
some will be in the demo as sample (I make a few ways to show).

screenshots once base is ready will be showed, so expect that parameters
can be there, but not functional yet based on changes to it.
looks awesome @ShadowDragon, keep going!
Added Data files for a new project.

I use NWJS 0.48.4 and PIXI 4.8.9 for testing.

Enjoy (I try to add all features when able and update the plugin).
same for bug fixes to maintain this cool plugin.

Data have small examples what you can do, just be warned that changing
lockpicks share the other items durability!

I might fix this based on variables (each id, their own value which you need
to keep track off!.
Amazing work, working great so far. Thanks again for doing this!
Amazing work, working great so far. Thanks again for doing this!
anytime 🙂

hope you try the scene keeping open and closed, but change this
based the chest you want to check (like the mimic one to turn off)
or by user preference as long the scene is open, the lock array are
the same (I removed the debug for it, as it works correctly).

but also unnecessary code are removed or changed/combined as it
was not really needed, so it cleaned up the code as well 🙂

if there are suggestions, leave them behind.
I am trying to start the example setting, and nothing happens. The character turns to me for a split second, meaning - the plugin command gets activated, but game resumes instantly and nothing happens.
I tried giving character the lockpicks, and standard settings for everything. Both options not working. Am i setting up event correctly?
1741869009453.png
Am i setting up event correctly?
your settings is correct (for the very basic which always open it up)

with a condition check if the player has the item, it keeps the window closed
with a message (also a basic setting), this is automatic and possible (next update).

the advanced to make it more interesting is changing them, but check the demo
in the data and see if it works there, so there are some folder changes from
the old one and new one, so make sure those are correct.

otherwise, I need to know if there is any error in the console log.
your settings is correct (for the very basic which always open it up)

with a condition check if the player has the item, it keeps the window closed
with a message (also a basic setting), this is automatic and possible (next update).

the advanced to make it more interesting is changing them, but check the demo
in the data and see if it works there, so there are some folder changes from
the old one and new one, so make sure those are correct.

otherwise, I need to know if there is any error in the console log.
I don't know where i can find the demo.
Tried console, it shows this from the start -
1741875962399.png

But shows nothing new when i interact with event in game.
That, unless i have to type something in it, because i don't know.
what version of MV do you use? if 1.5.x than it explain the lockpick error.
if 1.6.1+ than its weird as its ternarly and shortway using code with ??.

on pc, it works, but on android, it can have a bad behavior, need probably revert
it to the longer way that way.

the demo is on download on the bottom, that should be placed in a new project.
what version of MV do you use? if 1.5.x than it explain the lockpick error.
if 1.6.1+ than its weird as its ternarly and shortway using code with ??.

on pc, it works, but on android, it can have a bad behavior, need probably revert
it to the longer way that way.

the demo is on download on the bottom, that should be placed in a new project.
Maker version 1.6.1
Could not find the demo, but noticed that your lockpick folder has a data file with various settings document. That need to be installed too for plugin to work? Will it overwrite my current settings, like common events, items, etc?
data has the folder, which are required (those are re-ordered) for organizing).
so the img/lockpick/ has 3 folders, those are required (might explain the crash).
but really hard to tell.
data has the folder, which are required (those are re-ordered) for organizing).
so the img/lockpick/ has 3 folders, those are required (might explain the crash).
but really hard to tell.
I copied js, picture and se folder files, but omitted the data ones.
Data does not have folders in it, only this files:
1741884278865.png

But i am not sure if they related to lockpicking at all, looks like they were placed for some kind of demo. I am afraid that if i will overwrite mine with these, a lot of things might break.
data (specially Map001) has the map info's and events places there.
so you can check the 4 chests that are places.

the system/items hold the variables and items data that I used.
tileset (main) as default map layout.

so in clean project, you can easy check how the system is used 🙂

if you know how to use it before, than only img/pictures/lockpick
should suffices and the SE sounds because those are used.

so make sure you have a vanilla project for it (data in your current breaks everything!).

so don't do that (only in vanilla).

if you keep having issues, please DM me.
anytime 🙂

hope you try the scene keeping open and closed, but change this
based the chest you want to check (like the mimic one to turn off)
or by user preference as long the scene is open, the lock array are
the same (I removed the debug for it, as it works correctly).

but also unnecessary code are removed or changed/combined as it
was not really needed, so it cleaned up the code as well 🙂

if there are suggestions, leave them behind.

I'm not being able to get the "keep scene open" to work. I have the SDJB_Base and SDJB_LockpickSystem plugins under the PXD_Lockpick plugin.
I'm not being able to get the "keep scene open" to work. I have the SDJB_Base and SDJB_LockpickSystem plugins under the PXD_Lockpick plugin.
turn off PXD_Lockpick as you don't require it.

this is an overhaul of that plugin, so its has rewritten portions to work better
and added features.

turn it off and it should work.

if PXD_Lockpick is below, it overwrite my function, if you put it above,
it might break more in the way I rewrote things 😉

so remove PXD_Lockpick, but credit him as its was his base 🙂
turn off PXD_Lockpick as you don't require it.

this is an overhaul of that plugin, so its has rewritten portions to work better
and added features.

turn it off and it should work.

if PXD_Lockpick is below, it overwrite my function, if you put it above,
it might break more in the way I rewrote things 😉

so remove PXD_Lockpick, but credit him as its was his base 🙂
Ok I did try that and wasn't able to get the plugin commands to work, so I may be missing something. I'll try it out and come back and edit this port with the result. Thanks for the quick response!
Ok I did try that and wasn't able to get the plugin commands to work, so I may be missing something. I'll try it out and come back and edit this port with the result. Thanks for the quick response!
use the data that is able to download in a clean project, and see if it works.
if it work there and not on your main project, show event page, plugin manager.

so I could try to figure out why it fails or why the plugin command doesn't work.
as I didn't mess with it to much.

take your time.
use the data that is able to download in a clean project, and see if it works.
if it work there and not on your main project, show event page, plugin manager.

so I could try to figure out why it fails or why the plugin command doesn't work.
as I didn't mess with it to much.

take your time.
Updated NWJS and PIXI and it's working now! Thanks for your help!
So basicaly, Pixi and NWJS are an extension for javascript ? you need only to activate as .JS in plugin TAB, first position ? it's the first time i see one plugin use it

Original thread: https://forums.rpgmakerweb.com/threads/sdjb_lockpicksystem.174784/