[Gameplay Mechanic] Lockpicking

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

[Gameplay Mechanic] Lockpicking

Post by Neikun »

So I recently designed an alcove that gives the illusion that a key is physically in a lock.
I think it is a perfect way to create a lock picking system.
Lets use this thread to discuss best ways of implementing a lock system.
We could also post lock picking specific assets and scripts within this thread.
SpoilerShow
Image
Currently specific for Ornate Keys in Ornate locks.

To use, place a ornate lock on the wall
Place this alcove socket on top.

Code: Select all

defineObject{
	name = "ornate_key_socket",
	class = "Alcove",
	anchorPos = vec(-0.01, 1.37, -0.13),
	anchorRotation = vec(0,90,90),
	targetPos = vec(-0.01, 1.37, -0.13),
	targetSize = vec(0.3, 0.3, 0.3),
	placement = "wall",
	onInsertItem = function(self, item)
		return item.name == "ornate_key" and self:getItemCount() == 0 
end,
	editorIcon = 8,
}

With these kinds of locks, it opens the way for lockpicking as well.
(You could use the lock underneath as normal, and have the socket on top take only your lockpicking tool)
The way I see a lockpicking system working in Grimrock with my new alcove is like this:

Because the lock behind the alcove still functions normally, you can have options for both a key and a lockpick to toggle the door.
So lets say you have the lock opened by an iron key, and the alcove only takes a lockpick.
If the player can't find the key, but has a lockpick, he can open the lock. There could be a random chance that the lockpick breaks (Destroy the lock pick and have hudPrint("Your lockpick snapped")
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
crisman
Posts: 305
Joined: Sat Sep 22, 2012 9:23 pm
Location: Italy

Re: [Gameplay Mechanic] Lockpicking

Post by crisman »

A simple solution is to place two lock, one working with the key and one working with the lockpick, on the same spot
so there won't be any alcove.
The one with the key must be connected to a door, for example.
The one with the alcove must be connected to a script.

function lockpicking()

if math.random <= 0.7 then
setMouseItem = ("lockpick")
*open something*
playSound("key_lock")
else
hudPrint("You broke the lockpick")
end
end

Haven't tested yet

EDIT: of course the opposite lock must disappear - so even the one working with the key must be connected to a simple destroy() script.
So if I open the lock with the key, the lock opened by the lockpick must disappear and viceversa.
User avatar
Wolfrug
Posts: 55
Joined: Wed Oct 03, 2012 6:56 pm

Re: [Gameplay Mechanic] Lockpicking

Post by Wolfrug »

Further suggestions:

Change the % chance of lockpick breaking by: rogue presence in party (-50%) and highest dexterity in party (-1%/dex) or somesuch? Yay for class-ism :D

Problem: people will save-load to retry broken lockpicks ad-infinitum. Solution: pre-roll a d100 for every lockpick present, and take the rolls from there one by one (this is what they do in the Total War series for spy/assassination checks to avoid this exact problem).

This could really change the dynamics of some dungeons/puzzles, I think, by giving the option of either bypassing it quickly or then finding the key every time...but having to think carefully about using up limited lockpicking resources as well. Hm hmm!

-Wolfrug
Try my Mordor: Depths of Dejenol LoG-ification. Feedback much appreciated!
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: [Gameplay Mechanic] Lockpicking

Post by Neikun »

Hmm. One good feature with the alcove is that the item sits in the "lock".
You could then design doors with a lock on each side of it so that you can lock the door from either side and never destroy keys.

An alternate method to the lock picking and regular key use would be to have the lock on the wall with nothing in the opened by field. You could then place two sockets on top of it. (One for the key, one for the lockpick)

The way I see the new locking system operating is, you place the key in the hole to unlock the door. You can then take the key from the hole and the door stays open. If you place the key in the hole again, the door locks.
If we use this format in lockpicking, Grimrock will feature the only gameplay mechanic where you can actually lock AND unlock things with a lockpick. How cool is that?

@Wolfrug: I prefer the stick randomness of lockpicks breaking myself, but I understand that not everyone would. I would like to see both formats.
You raise a good point with the quicksave and load, but that really falls on the hands of the player.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
crisman
Posts: 305
Joined: Sat Sep 22, 2012 9:23 pm
Location: Italy

Re: [Gameplay Mechanic] Lockpicking

Post by crisman »

#Neikun Okay, I got your point with keys!
@Wolfrung I'll stick with the 0.7, the details about classes and others things can be discussed
later, but I really like those kind of stuff! For the d100... I really don't know what it is! If you can explain it a bit, thank you! :)

Then, I'll rewrite the code

You already defined the lock_alcove, so I'll define a lockpick_alcove.

*defineObject lockpick_alcove*
onUseItem = function (self, item)
return item.name == "lockpick" and self:containedItems() == 0
end,

script connected to the alcove, something like this - cannot test it right now! -:

Code: Select all

function alcove_lockpick()
for i in lockpick_alcove:containedItems() do
if i.name == "lockpick" then
i:destroy()
end
end
if math.random <= 0.7 then
*do stuff*
setMouseItem("lockpick")
else
hudPrint("You broke the lockpick!")
end
end
so no need to destroy locks!
basically you place the lockpick in the alcove, destroy the lockpick and if the lockpicking is successfully you will retrieve the lockpick, otherwise nothing happens!
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: [Gameplay Mechanic] Lockpicking

Post by cromcrom »

I created a lockpicking system for TLC, or at least the illusion of it. It uses hidden pressure plates in front of the doors, and orientation of the pressure plate. The player then uses a lockpick in his inventory. It checks for the hidden plate, and the proper party orientation. IF all is correct, a few checks (lockpick quality, lockpicking skills, and so on), and the door opens :-)
A trip of a thousand leagues starts with a step.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: [Gameplay Mechanic] Lockpicking

Post by Neikun »

Mmh. It's good to have many versions of the same thing.

For now I have a request by any model artist and icon artist.
A lockpick model and icon (with atlas) would be really awesome.
I think you would probably be able to use the iron_porticullis in-game material as a texture. (So no need for more files than needed)
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: [Gameplay Mechanic] Lockpicking

Post by Isaac »

Wolfrug wrote:Further suggestions:

Change the % chance of lockpick breaking by: rogue presence in party (-50%) and highest dexterity in party (-1%/dex) or somesuch? Yay for class-ism :D

-Wolfrug
That's how I was doing it in my EoB mod; except that the check would hinge on having a rogue at all, and that they must be conscious. (No Rogue = No lock Picking).

This would mean that no crucial area could be locked without a proper key.
Neikun wrote:For now I have a request by any model artist and icon artist.
A lockpick model and icon (with atlas) would be really awesome.
I will have one of those soon... I switched projects when animation became an option, but I have been working on a lockpick method, and it requires the Lockpick model & icon. When I have it, I will post links.
Last edited by Isaac on Sun Oct 28, 2012 5:40 am, edited 1 time in total.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: [Gameplay Mechanic] Lockpicking

Post by Neikun »

Haha. I'm picturing the party using the dead rogue mannequin-style to pick locks
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
Post Reply