Lani's Locks and Keys
#1
[Image: QhCvxoe.png]
Version: 1.2



Introduction
Lani's Locks and Keyrings allows you to create a locking system for doors, chests, and other items that require keys. It does this by creating scripted values rather than having to create actual door-key items in the Item database.

Lani's Combo Locks allows you to require the player to dial a proper combination into a spinning lock.

And Lani's Keypads allows you to require the player to enter a proper password or command code into a keypad to gain access to the same said doors, chests or other items.

All three systems uses script commands to trigger switches or event self-switches so doors or chests may be opened.




Features
  • Eliminate the need for Item Database Keys
  • Use script commands to turn on switches to open simulated doors
  • Package includes combination locks
  • Package includes keypad lock systems



Screenshots
[Image: ORvNqtp.png]
Shot of a keypad in use



Video
(Opening the Combination Lock) -no audio-



Demo
(Open Sesame)



Instructions
Three systems, three sets of instructions in the demo. And the configuration sections have plenty of notes.



Author's Notes
This package has the features where you can add a variety of locking systems. However, it is up to you, the game developer, to implement them. So if you wish to work this system with an accompanying lockpick script, it is up to you to do it.

I recognize that one can make a safe door with the combination lock system, and some safes use a combination of both dial lock and separate key. This option is not within the combination lock system, and will not be updated for inclusion. I leave that to end-users to add it themselves for their own project. There are plenty of notes throughout the scripts to act as a guide.


Credits and Thanks
Thanks to Kyonides-Arkanthes (or kyonides at Save-Point.Org) for pointing out to problematic areas that detected skeleton keys.


Compatibility
Designed for work with RPGMaker XP. And plenty of work to alias any additional content related to 'keys' within the item menu.



Terms and Conditions
Free for use, even in commercial products. Only due credit is required. That includes credit for Kyonides-Arkanthes as well as my own.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#2
Always love me a Demo that comes with a bit of story :D
That opening made me laugh, heh.
And this is a really, really cool system! I did run into a couple issues, though XD'

For one, who's this guy?
Content Hidden

And the final battle kicked my ass. Multible times lol. Got to see the gameover more than once, heh.
That in itself is not an issue. When it came to picking the final lock however I ran into the problem that I could not figure out how to get the system to accept any numbers.
The basic confirmation key did not work and just threw error sounds at me, regardless of what number I was on. And with saving dissabled I couldn't just check the instructions either. And I really did not want to do the battle again, haha. So I left the room, hoping I could save somewhere else, which I could not. So back in I went and...uh...
Content Hidden
Anyway. I made a copy of the project and opened that alongside the original, to read the instructions in the script on how to confirm your lock selection but alas, no luck.
Back in the game I again tried every single key on my keyboard and various options of confirming first and going back and forth between all numbers and... nothing.
So I had to close it without ever discovering the answer or being able to open the last lock, haha.

The key-pad worked like a charm however, and I love the special key menu ^^b
Friendship is born at that moment when one person says to another: "What! You, too? Thought I was the only one." (C.S. Lewis)
For the time you're laughing, there's nothing wrong in the world. (Colin Mochrie)

If it's funny, make sure people laugh. If it's not funny, make it funny (unless it's actually really serious). (silvercheers)

Please don't spell my name "Yamina-chan". It's all small. Thank you =D
Reply }
#3
Who is this guy? There's always someone screwing it up. SETTING 'DIRECTION FIX NOW!'
Leave it to you to find map glitches, you beta-tester you. Winking

Related to the combination dial lock
First, you do realize that you spin the dial with the arrow keys, right?

Oh, and I hated combination locks when I first started using them....
  • Like any combination lock, you must first spin the dial (counter clockwise) past 0 (zero) at least twice before stopping at your first digit (that being 36).
  • Once you choose the first number, that's when you begin to spin it clockwise... setting the first number in the top-left circle. If you didn't spin it all the way and pass 0 twice, it won't set.
  • Now that you are spinning it clockwise for the second digit, you must pass the '36' once, and immediately stop on the next digit (that being 24).
  • The moment you begin turning the dial counterclockwise, the second number will be in the top-center circle.
  • Finally, turn it counterclockwise and immediately stop on the third and final digit, the value of 36.
  • If at any time you screw up in dialing, all the top circles empty and reset. It's kinda the basics of a real combination lock.

Subtleness.... LISTEN to the clicks. The volume of the tumbler when it is the one you want to stop is quieter than the others. Volume differences is a feature.


Regarding the sudden weirdness of exiting/returning to the cave... I'm taking it out. Sorry. Tongue sticking out HOWEVER, if a dynamic maps script (like the one I revised) would prevent that weirdness caused by 'moved/relocated events't from happening.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#4
"Like any combination lock, you must first spin the dial (counter clockwise) past 0 (zero) at least twice before stopping at your first digit (that being 36)."
Now that's the part I didn't find when I was looking up the instructions!
That would be why I couldn't figure this out haha.

(Still can't get any numbers to hold. XD I'm aparently not very good at this type of lock picking haha.)
Friendship is born at that moment when one person says to another: "What! You, too? Thought I was the only one." (C.S. Lewis)
For the time you're laughing, there's nothing wrong in the world. (Colin Mochrie)

If it's funny, make sure people laugh. If it's not funny, make it funny (unless it's actually really serious). (silvercheers)

Please don't spell my name "Yamina-chan". It's all small. Thank you =D
Reply }
#5
Well, the first post now has a download linkie showing the combination lock being opened (no audio).

BTW, did you check out the books? Laughing
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#6
Of course I did, haha.
I couldn't decide if I should face palm or laugh at the Dye Hard one, which was the first one I opened, heh.

I'm looking at the video and that is what I did.
I can hear the softer click too, but... riddle me this, what button on the keyboard do I need to press to confirm that one number into the slot? lol
Because I've tried every single one and get one of three results:
1 - Nothing happens
2 - I get a fail sound and no numbers are added
3 - I close the lock menu.

Content Hidden
Friendship is born at that moment when one person says to another: "What! You, too? Thought I was the only one." (C.S. Lewis)
For the time you're laughing, there's nothing wrong in the world. (Colin Mochrie)

If it's funny, make sure people laugh. If it's not funny, make it funny (unless it's actually really serious). (silvercheers)

Please don't spell my name "Yamina-chan". It's all small. Thank you =D
Reply }
#7
No buttons. You just turn the dial. Well, the only buttons you press are [CANCEL] when you want to escape, or [SELECT] when you think you have the combination.

Just like a normal combination lock in real life, this one confirms your selections when you reverse the direction of the dial. You just have to ensure you spin it all the way around as you would a real combination lock.

EDIT: Watches video. Yeah, after you stopped at '36', just start spinning the dial the other way. And make sure you give it a full spin past the 36. I could almost see Lani kicking the chest in frustration.... and I could sprite that too.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#8
I stand by it, that lock is too smart for me, heh.
But now that I know that I don't need to push buttons to accept the numbers before I move on to the next number I was actually able to open it Xb
(Also that ending looks familiar Laughing + Tongue sticking out )

But yes, works like a charm - if you know what to do, haha.
Friendship is born at that moment when one person says to another: "What! You, too? Thought I was the only one." (C.S. Lewis)
For the time you're laughing, there's nothing wrong in the world. (Colin Mochrie)

If it's funny, make sure people laugh. If it's not funny, make it funny (unless it's actually really serious). (silvercheers)

Please don't spell my name "Yamina-chan". It's all small. Thank you =D
Reply }
#9
While running the demo on HiddenChest, it threw the following warnings:

095:Lani's Locks and Keyrings:508: warning: found `= literal' in conditional, should be ==
095:Lani's Locks and Keyrings:790: warning: found `= literal' in conditional, should be ==
098: Lani's Keypads Engine:976: warning: found `= literal' in conditional, should be ==

The methods involved in this buggy case are here just in case you want to take a look at them...

Code:
def test_keys(lock_id)
    # Set Effective
    effective = false
    # Get ID of lock
    @lock_id  = 0
    @lock_id  = LaniLocks::LOCKS[lock_id] if LaniLocks::LOCKS.has_key?(lock_id)
    # Return false if no keys held
    return false if $game_system.keyring.keys == []
    # Sort through all keys held
    for key in $game_system.keyring.keys
      # Acquire array of locks for a given key
      keyset    = $game_system.keyring[key]  
      # Return true if a skeleton key
      unless keyset.is_a?(Array)
        return true if keyset = -1
      end
      # Sort through all locks the key can open
      for lock_id in keyset
        # return true if a key matches
        effective = true if lock_id == @lock_id
      end
    end
    # Return effective
    return effective      
  end

Code:
def loop_locks(key)
    keyset = $game_system.keyring[key]
    # If a sksleton key
    unless keyset.is_a?(Array)
      if keyset = -1
        test_lock_success     # Assume Success
        test_lock_switches    # Turn on proper switches
        lock_defaults         # Restore defaults
        return                # And Esit Method
      end
    end
    # Cycle through all locks the key can open
    for key_id in keyset
      test_lock(key_id)
    end
    # Restore Defaults
    lock_defaults
  end

Code:
def loop_keypads(keycard)
    keyset = $game_system.keyring[keycard]
    # If a skeleton key, always true
    unless keyset.is_a?(Array)
      return true if keyset = -1
    end
    # Cycle through all locks the keycard can open
    for key_id in keyset
      return true if (@key == key_id) == true
    end
    return false
  end

=_= You've stolen my drama's plot! Well, the main issue here is that there's no proof that your demo's story is based on facts!
P.S.
But at the end I can't stand THAT character so I don't know whether or not I should even complain here...
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#10
BUMP
to Version 1.2
For Lani's Locks and Keys
and
to Version 1.1
For Lani's Keypads

Thanks given to Kyonides-Arkanthes for locating three areas that could cause problems, though not readily apparent with RPGMaker XP in general. Such thanks also requires that his name also be included in the credits for any game using the system.

Winking In the meantime, I cleaned up a little of the event code to prevent some goofy visual issues here and there.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Quick Keys blazingamer 0 4,725 03-07-2008, 06:56 AM
Last Post: blazingamer



Users browsing this thread: 4 Guest(s)