A short tutorial about making a lockpicking system in-game which doesn't require scripts etc.

  • Milos
  • 04/10/2012 09:57 PM
Hello everybody, and welcome to my first tutorial.

This tutorial describes a simple lockpicking system that is not too difficult to add to your game, which doesn't require any graphics, scripts etc. It's RTP-usable.

Here's an example of which this could be implemented :

The player wakes up in a cold, dirty cell. He can't remember anything, and he finds out that there is a door leading out of the cell. Unfortunately, it is locked. The player has to find out how to unlock it.

So, after the initial panic, the player walks around the cell, looking for a metal object to pick the lock. After a few moments of searching, the player finds a lockpick(Or a shiv, hairpin...). Yay!

So now you figure you should make a lock system. Since you know nothing, you look on the net. After searching and searching(depending on your luck), you find a old thread on some Japanese site about a lock tutorial. You download the tutorial, and after looking at it, your first reaction would be :
What kind of sorcery is this?
As you open the file, you find out what a fool you have been. It's just a bunch of variables. (Damn them!)
(This s**t happened to me)

I will now explain it to you.
You want to set a lock. I will set a lock with 4 tumblers for this tutorial.
First step:
Create a event on the door you want the lock to be on.
Set up a variable for each of the four tumblers (Tumbler 1, Tumbler 2...etc.)
Second step:
To spice things up, make 3 positions(3 additional variables per 1 main variable) for each tumbler.
That means for each tumbler you place, you have 3 positions. Total = 12 Variables
Name them like Tumbler 1 High ,Tumbler 1 Low ,Tumbler 1 Medium (High meaning like if the tumbler can be picked to place go higher, medium, or down.)
Now if you are not entangled up in until now, continue. If not, read again.
Third Step:
Now place each Tumbler variable to be random.
That means: Tumbler 1 ~ (1...3) and so on.
Then place Tumbler 1 Low = 1, Tumbler 1 Medium = 2, Tumbler 1 High = 3.
Do this for all the tumblers.
Then place a Conditional Branch if the Variables Tumbler 1 and Tumbler 1 Low(and for the rest too)meet, that the tumbler gets picked. Repeat this process for all of
the 4 tumblers.
Now you should have something like this:
----------/ Tumbler 1 High
Tumbler 1 - Tumbler 1 Medium
----------\ Tumbler 1 Low

----------/ Tumbler 2 High
Tumbler 2 - Tumbler 2 Medium
----------\ Tumbler 2 Low

----------/ Tumbler 3 High
Tumbler 3 - Tumbler 3 Medium
----------\ Tumbler 3 Low

When you wish to use a tumbler, you set its value to be random (1~3), so the correct position will be different each time.

I hope this helps you!
If you still can't understand something, write me a message. I will do my best to explain it again!
Pages: 1