MV SDJB_LockpickSystem

SDJB_Base should be on top (or below YEP_EngineCore) if you use it,
SDJB_LockpickSystem midway (can be bottom).

NWJS and PIXI are just updated version.

MV start with NWJS 0.29.0 and PIXI 4.5.4, so when you update both,
you should have NWJS 0.48.4 and PIXI 4.8.9 (I can't garanteed that
higher nwjs, pixi will break it though, but nwjs 0.29 does.

as 0.48.4 support ES6 JS.
Just downloaded this plugin to give it a test and I have encountered some issues. When I have the lockpicks and the skill level set correctly and select a chest, the game crashes on the two chests on the farthest corner to the right. The other two chests nearer the middle do nothing with the plugin call. The only plugins that I have installed are your base plugin and the lockpick system plugin beneath that. Not sure what I am doing wrong.

Error.PNG
Just downloaded this plugin to give it a test and I have encountered some issues. When I have the lockpicks and the skill level set correctly and select a chest, the game crashes on the two chests on the farthest corner to the right. The other two chests nearer the middle do nothing with the plugin call. The only plugins that I have installed are your base plugin and the lockpick system plugin beneath that. Not sure what I am doing wrong.

do you have my latest SDJB_Base plugin? if so, can you screenshot the
console.log (which has the NWJS and PIXI version).

along how the events looks like?

else I can't replicate it.

I need to make sure you got all the data in place, parameters set up.
should be default if not changed here, to narrow down the issue.
Thank you for getting back to me so soon. Just double checked if I had the latest version of your base plugin. When I tested it yesterday, I just downloaded the files from this thread as prompted, opened a new game and copied the files to their appropriate sections. Today I went to your main Itch page and made sure to pick up the Base plugin there, just to be sure it was up to date. The problem still persists.

Not sure what is happening exactly. It is a brand new game with only your two plugins in it, and the files from this thread. I have attached images below of the events and, I believe, the console log you requested? I have never had to access it before so I am hoping I found the right area.
Thank you for getting back to me so soon. Just double checked if I had the latest version of your base plugin. When I tested it yesterday, I just downloaded the files from this thread as prompted, opened a new game and copied the files to their appropriate sections. Today I went to your main Itch page and made sure to pick up the Base plugin there, just to be sure it was up to date. The problem still persists.

Not sure what is happening exactly. It is a brand new game with only your two plugins in it, and the files from this thread. I have attached images below of the events and, I believe, the console log you requested? I have never had to access it before so I am hoping I found the right area.
this tells a lot as this didn't run either:

console.log(`NWJS Version: ${process.versions.nw}\nPIXI Version ${PIXI.VERSION}`)

which tells me, your version of MV is lower than 1.6.1 else your NWJS is default (0.29)
as PIXI as well.

in my previous post:
you should have NWJS 0.48.4 and PIXI 4.8.9 (I can't garanteed that
higher nwjs, pixi will break it though, but nwjs 0.29 does.

as 0.48.4 support ES6 JS.

which one I use to make it work.

0.29 NWJS don't support "??" shorthand, and there is something missing
of the base that can't be read either.

my latest base is also a bit bigger with some fixes in it and modifications.
only this shouldn't impact for what I used for the demo here.

if you do in fact has the NWJS > 0.48 and PIXI > 4.8.9 what I use, than
report back, and I see what I can do to fix them.

turning back to make it work for 0.29 increase the filesize, but still, unsure if
my base will work, as it parse my params automatic.
Well this is embarrassing! So I already had the current version of MV (1.6.4), and just checked that PIXI was up to date too, but my NWJS was outdated. I had no idea that I had to go in and manually upgrade that. The plugin is working great now. Thank you for pointing me in the right direction, ShadowDragon and apologies for wasting your time on that.

After testing out the lockpick system, I have three questions about it:
* Does the lockpicking skill level up after a successful lock has been picked or is experience also gained on a failed attempt?
* Is there a way to buffer between each confirmation button to pick a lock? I am curious because trying to pick the locks at first level is brutal. I barely tap the confirmation key and the lockpick instantly breaks or is nearly broken before I can get my finger off the button.
* Could a third key type be added for a lockpick that never breaks? My idea was that it would be a late game side-quest item the players could acquire.
Well this is embarrassing! So I already had the current version of MV (1.6.4), and just checked that PIXI was up to date too, but my NWJS was outdated. I had no idea that I had to go in and manually upgrade that. The plugin is working great now. Thank you for pointing me in the right direction, ShadowDragon and apologies for wasting your time on that.
if you use the steam version than the NWJS and PIXI get revert to default (nwjs 0.29)
so you need to manually update it (painful, I know).

I know MV 1.6.3 but no idea what is added in 1.6.4, but I use 1.6.1 which is stable enough.
higher shouldnt matter, but update through steam => nwjs and pixi has to be updated again.

* Does the lockpicking skill level up after a successful lock has been picked or is experience also gained on a failed attempt?
No, it doesn't, as it has no experience curve or skill level curve.
in this case, you need to add the skill level + 1 or variable + 30.
if that variable is 100+ than add +1 skill level (should be manually added).

but I could try to implement something to automate this.

* Is there a way to buffer between each confirmation button to pick a lock? I am curious because trying to pick the locks at first level is brutal. I barely tap the confirmation key and the lockpick instantly breaks or is nearly broken before I can get my finger off the button.
the button required isPressed I believe, so buffer isn't there, and if the skill is lower
than the lockpick (10 levels different or more) it can be indeed brutal, as that is how the
original works, I only heavy modified it with new features and fixes, so put it to
isTriggered if not set like that, it may only check per press, not holding which pressed
is doing (repeat every 6 frames or 24 frames by default).

I could make the buffer if required for adjustment in parameter.

* Could a third key type be added for a lockpick that never breaks? My idea was that it would be a late game side-quest item the players could acquire.
This was on my to do list, but I need time to implement it.

however, I got the change, so it can go slow., but I was planning this as
a Master Lockpick item (never breaks).

but I need a smarter way to store the dataItem for usage, and if that one is used,
it can check the idea, to add automatically skill level up (based on lockpick item).
and if the master lockpick item, nothing is removed (this will be added once I got time).

if you really need it, I try end of this month or somewhere next month closest.
I know MV 1.6.3 but no idea what is added in 1.6.4, but I use 1.6.1 which is stable enough.
higher shouldnt matter, but update through steam => nwjs and pixi has to be updated again.
Before I began the process to update the nwjs, I did have 1.6.1, and after following numerous tutorials trying to update the nwjs, I went through the process of validating my Steam files, and it got updated to 1.6.4. (shrugs) I have no idea how that's going to affect my older games, if at all. I am hoping it doesn't break anything.


No, it doesn't, as it has no experience curve or skill level curve.
in this case, you need to add the skill level + 1 or variable + 30.
if that variable is 100+ than add +1 skill level (should be manually added).

but I could try to implement something to automate this.
Hmm, that's okay. I know how to handle variables but adding a variable just for accessing the chest wouldn't do well. Is there a way to create a conditional branch with a script call to check if the player has succeeded or failed at a lockpick and add the variable then?


the button required isPressed I believe, so buffer isn't there, and if the skill is lower
than the lockpick (10 levels different or more) it can be indeed brutal, as that is how the
original works, I only heavy modified it with new features and fixes, so put it to
isTriggered if not set like that, it may only check per press, not holding which pressed
is doing (repeat every 6 frames or 24 frames by default).

I could make the buffer if required for adjustment in parameter.
I see. I should have tried to test the lockpick on a low level chest to see how it handles. If you could add a parameter for a buffer I believe that would be greatly helpful.


This was on my to do list, but I need time to implement it.

however, I got the change, so it can go slow., but I was planning this as
a Master Lockpick item (never breaks).

but I need a smarter way to store the dataItem for usage, and if that one is used,
it can check the idea, to add automatically skill level up (based on lockpick item).
and if the master lockpick item, nothing is removed (this will be added once I got time).

if you really need it, I try end of this month or somewhere next month closest.
Oh I am in no rush for it at all. Whenever you are able to get around to it. I understand these things can be difficult and time consuming to code.
Hmm, that's okay. I know how to handle variables but adding a variable just for accessing the chest wouldn't do well. Is there a way to create a conditional branch with a script call to check if the player has succeeded or failed at a lockpick and add the variable then?
this can be done on succeed.
like the plugin command: lockpick Wood 20 A

Selfswitch A is only triggered if succeeded, but a work around is what I did on
the other thread that looks like this on 1 page.

Code:
plugin command: lockpick Wood 20 A
if selfswitch A = ON
  text: you lockpicked it
  variable EXP += 2  // or skill level +1 or whater
else
  you failed, try again?
  show choice/jump to label if label is above plugin command
end

something like this, from here, you have more control over selfswitches,
A, B, C, D, E, etc whatever triggers here, so check the original thread
on the last 2 pages to make it more advanced (this works similar, maybe
slightly different on how its set up because more lockpick usages =)

I see. I should have tried to test the lockpick on a low level chest to see how it handles. If you could add a parameter for a buffer I believe that would be greatly helpful.
I will add the buffer parameter to adjust to your needs, however, line 767 and 777 has
the Input.isPressed, and change it to Input.isTriggered is a bad idea.

the reason for that (based on original) it cannot go smooth open, even if buffer is there.
however, I can set a buffer if it cannot rotate smooth or stop on fail turn.
so you can check again on a different angle.

this require a smarter way, because else it will stutter or won't go open if
the buffer is higher.

I can see what I can do about it without breaking the main mechanic.

Oh I am in no rush for it at all. Whenever you are able to get around to it. I understand these things can be difficult and time consuming to code.
It does, specially while I clean it up with new features, removed duplicate codes,
fixed a bunch of bugs, so I can find a way for the lockpick duration which also
still share when going higher.

but the skill level -10 in the demo was an example, but not sure how to automate that yet.
but that's also on my TODO list.

so I work on those first next time I got time as its a really nice lockpick system which
is currently stable.
this can be done on succeed.
like the plugin command: lockpick Wood 20 A

Selfswitch A is only triggered if succeeded, but a work around is what I did on
the other thread that looks like this on 1 page.
Oh I feel silly. I should have made that connection before. Sorry for wasting your time on that.
I will add the buffer parameter to adjust to your needs, however, line 767 and 777 has
the Input.isPressed, and change it to Input.isTriggered is a bad idea.

the reason for that (based on original) it cannot go smooth open, even if buffer is there.
however, I can set a buffer if it cannot rotate smooth or stop on fail turn.
so you can check again on a different angle.

this require a smarter way, because else it will stutter or won't go open if
the buffer is higher.

I can see what I can do about it without breaking the main mechanic.
Oh gosh, if trying to implement it is going to cause that much issues I don't want you to waste your time. As you stated too, as it is done now it does operate smoothly. I finally had more time to sit down today and test the picklocks on a chest with the smaller difficultly (10) and a custom one with a difficulty of (5) and the lockpicking was not so brutal as I had initially thought. When I first tried test playing it a few days ago I tried it on the first chest on the upper left, which after I looked at it later, was a difficulty of 30 while the lockpick skill was at 1. Again, I am feeling pretty silly over here. Can totally see now why it was so brutal. But it is very balanced as it is now. Again, with more time to test play today on the lower level chests, it isn't as bad as I first thought. It is quite balanced.

I did notice though, but every time the lockpick breaks it resets the unlock zone right, even when the screen is set to remain on the screen when set in the plugin parameters?

It does, specially while I clean it up with new features, removed duplicate codes,
fixed a bunch of bugs, so I can find a way for the lockpick duration which also
still share when going higher.

but the skill level -10 in the demo was an example, but not sure how to automate that yet.
but that's also on my TODO list.

so I work on those first next time I got time as its a really nice lockpick system which
is currently stable.
There is no chest in the small demo I downloaded that was set to -10. Can I assume that is in your private testing version?

Once more, thank you so much for responding back to my inquiries, ShadowDragon, being patient and pointing me in the right direction.
Oh I feel silly. I should have made that connection before. Sorry for wasting your time on that.
no worries, it help where I can, and if they didn't check or knew, its for new users
to see this, as not anyone go through all the pages if its in between =)

Oh gosh, if trying to implement it is going to cause that much issues I don't want you to waste your time. As you stated too, as it is done now it does operate smoothly. I finally had more time to sit down today and test the picklocks on a chest with the smaller difficultly (10) and a custom one with a difficulty of (5) and the lockpicking was not so brutal as I had initially thought. When I first tried test playing it a few days ago I tried it on the first chest on the upper left, which after I looked at it later, was a difficulty of 30 while the lockpick skill was at 1. Again, I am feeling pretty silly over here. Can totally see now why it was so brutal. But it is very balanced as it is now. Again, with more time to test play today on the lower level chests, it isn't as bad as I first thought. It is quite balanced.

I did notice though, but every time the lockpick breaks it resets the unlock zone right, even when the screen is set to remain on the screen when set in the plugin parameters?
buffer can be there, but level and lock difficulty indeed matters.

the parameter if "keep scene open" reset the lockpick and try again.
if false, the original way goes (close the scene on fail).

I made that because if you have 4 lockpicks, you need to open the scene 4 times,
but this is the developer choice, to keep it open or close it, so that is the way
the dev can choose the way.
There is no chest in the small demo I downloaded that was set to -10. Can I assume that is in your private testing version?
there is one on Event 8 (if normal, lockpick difficulty = 20, if strong lockpick, diffuculty = 10)

as I use a conditional branching for the lockpick as I also change the lockpick looks.

this is so to make it better.

the original had 1 lockpick, my version can set multiple (level 1, level 2, level 3, master lockpick),
so you need to create lockpicks and conditions to make different levels. (lowest is 1).

even if the master lockpick (which you can make), set the condition to level 1.
(slow drain), and refill the duration to max (fail or succeed).

I may be able to start fixing this week or else week on implementing.
along with some other features.

so the update is rather big and improvements for better experience.

so no worries, I do best to make the best experience out of my plugins for usage.
To all People using this plugin, there is some changes where the old
setup with conditions previously and mostly is used will NOT work
on the newer version.

this version get some crucial changes in how I made and be worked on.

General Setting => item Id
this default item become a list!

this list make the changes FOR you, namely the following:

item id
skill modifier (new)
durability (how strong is this lockpick) not hardcoded to 100 (1-999)
lockpick image (top)
lockpick image (bottom)
unbreakable => this is a boolean, mostly used for a master lockpick

while the default is false, you can set multiple for this,
even a bad lockpick with a duration of 25! or best lockpick of duration of 500.

About the "Skill Modifier" as in the conditional branch, this make the skill level for you.

lockpick Wood 50 A => has skill level of 50 or more needed.
if your modifier is 6, than lockpick Wood 50 A becomes automatically,
Wood 44 A so you don't need to do this manually, but modified for you.

I cap this from level 0 to 50, in case you have 100 level, 50 is max to subtract.

this is being tested, so this is more modifications to make it work for a better
gaming experience, along with some minor bug fix (not directly visible).

font change is going to be added in as well, so it take some time for this release,
as I want it to be as stable as possible.

if you just start using it, don't make it to much as this gonna change some
heavy things and rearrange, some codes are deleted as no longer needed.
Changed:
+ width value to durability (rather than fixed with)
+ new Param => multiple lockpick settings (change lockpick change images as well)
include modifier or make it unbreakable (wont lose durability).
This way, each lockpick has its own durability check, not global or work around
on saving it.
+ lots of code changes to respect the way of lockpicking, but scene is
kept to works the same.

+ event setup is easier, include a new helper for dataItem check, as well optimized
for easier user and only 1 plugin command required instead of multiple!


- removed helper and conditional branch check!

+ Reworked the entire conditional branch check into its own logic and its
own choice window of lockpicks (if you have more than 1!)

this gives you a choice if you have no lockpicks a message (in parameter)
this entire eventing logic becomes now just the plugin command:

Plugin Command: lockpick 40 Wood A
that's it, so what does it:

in short:

does the player has a lockpick? if yes, open the scene
if it has multiple, it open its window (for now, up to 20 (4 colums, 5 rows).
this way, its user-friendly, no more checks, just the plugin command!

how easy do you want it to have it!

TODO:
font settings to use for the lockpick
fix color instant change to gradually change between 4 colors
add buffer if fail, you wont lockpick further (optional in parameter)
Lockpick Data ZIP is replaced.

+ choice options on 2 or more lockpicks (make as many if you like)
+ lockpick modifier and durability (for each one)
+ unbreakable lockpick boolean
+ Font Settings are accessible to configure (name, color, outline, italic)
+ simple plugin command, no more conditional branches.

the last one was lots of error, but paid off, as the branches is done for you.

Enjoy the new improved plugin (with its data), if any has issues, let me know,
make sure your NWJS version is 0.48.4 or better and PIXI 4.8.9 or better.

NWJS is more important in this case, enjoy lockpicking 🙂

@Guardinthena unbreakable lockpicks is added as per request as it is useful 🙂

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