[MOD]Keys to lockable chests, doors[WIP]

Post Reply
sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

[MOD]Keys to lockable chests, doors[WIP]

by sofar » Post

this mod adds

(Un)Locking keys for lockable objects!

Image

This mod introduces a single new item in the inventory - a skeleton key. The key can be generated from a steel ingot, and then used on a lockable chest, a lockable door (or a lockable trapdoor, if you have my other mod). Any existing locking chest, or door will work.

Once the skeletonkey is used on a lockable item, it is converted to a node-specific key. The node-specific key is yellow, and will from there on only ever fit that one chest or door.

The key can then be given to a friend or other player, allowing them access to the chest contents or allowing them to open and close doors that they otherwise could not. They will have to wield the key and right-click the door or chest to interact with the item.

The key can be recycled in an oven, smelting it back to an ingot.

If the owner of the lockable node destroys that object, and puts a new lockable object back in the same position, the old key will not open the new lockable object. Keys are really specific to the chest they were used, and are useless afterwards.

An issue is currently that there's no way to distinguish keys from each other. oops. Better keep your keys in order. I am working on a method to rename items that will resolve this in the future.

Code: this is a fork from minetest_game:

https://github.com/sofar/minetest_game/tree/keys

License: equal to minetest_game (derivative)
Last edited by sofar on Sat Dec 26, 2015 19:45, edited 1 time in total.

KCoombes
Member
Posts: 427
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

Re: [MOD]Keys to lockable chests, doors[WIP]

by KCoombes » Post

sofar wrote:this mod adds
~snip~
An issue is currently that there's no way to distinguish keys from each other. oops. Better keep your keys in order. I am working on a method to rename items that will resolve this in the future.
There is a 'node ownership' mod that allows editing a node's metadata via a formspec - perhaps that will suit this mod as well?

+10

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [MOD]Keys to lockable chests, doors[WIP]

by sofar » Post

KCoombes wrote:
sofar wrote:this mod adds
~snip~
An issue is currently that there's no way to distinguish keys from each other. oops. Better keep your keys in order. I am working on a method to rename items that will resolve this in the future.
There is a 'node ownership' mod that allows editing a node's metadata via a formspec - perhaps that will suit this mod as well?

+10
There are so many mods that implement mechanisms like that, they all feel somewhat artificial. I chose to do a clean implementation of one that requires no chat commands for that reason. And it should be fun to play as well - instead of typing in some metadata in a form the player can now physically hand a key to a friend - that just has so much more gameplay value.

Under the hood this mod uses node metadata, obviously. It honors the 'owner' field as well (relies on it, even). And yes, if you can edit node metadata, you can indeed look at this mod's variables, although there's nothing to do with that info, really.

The actual issue of keys not being identifiable has nothing to do with node metadata, but with ItemStack names. I should have a solution for it soon, though.

amadin
Member
Posts: 549
Joined: Tue Jun 16, 2015 16:23

Re: [MOD]Keys to lockable chests, doors[WIP]

by amadin » Post

Where is download link?????
Can you add support for protected chest and protected doors from protector-redo mod? Because players already has this items and i don't want to delete them.
About keys names. For the first time you can add to the key name name of chest owner and name of item (for example "Key for sofar's chest").

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [MOD]Keys to lockable chests, doors[WIP]

by sofar » Post

amadin wrote:Where is download link?????
Can you add support for protected chest and protected doors from protector-redo mod? Because players already has this items and i don't want to delete them.
About keys names. For the first time you can add to the key name name of chest owner and name of item (for example "Key for sofar's chest").
This "mod" currently integrates in the default minetest_game, since it's too involved to make it separate (it needs to modify the event handlers for all the doors and chests that lock). I haven't posted the code just yet, that will come soon (once the steel trapdoor merges in minetest_game, I think)

I will _not_ add support for protection mods, mods that add custom lockable items should themselves write the code that make these keys work, not the other way around.

Item names are a core change, and I'm working on code to make that work - see my concept PR for minetest core on github.

amadin
Member
Posts: 549
Joined: Tue Jun 16, 2015 16:23

Re: [MOD]Keys to lockable chests, doors[WIP]

by amadin » Post

Do you mean currently integrates in the default minetest_game 0.4.13 stable????? I don't saw any keys in craft guide. How can i get it with /giveme?

User avatar
everamzah
Member
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [MOD]Keys to lockable chests, doors[WIP]

by everamzah » Post

minetest 0.4.13-dev is the version currently being worked on for minetest 0.4.14, or whatever the next version is. Oddly enough.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [MOD]Keys to lockable chests, doors[WIP]

by sofar » Post

amadin wrote:Do you mean currently integrates in the default minetest_game 0.4.13 stable????? I don't saw any keys in craft guide. How can i get it with /giveme?
It's not in the official minetest_game.

You can get the current code from my personal branch:

https://github.com/sofar/minetest_game/tree/keys

You'll need to replace your copy of minetest_game with this one, or install it as a separate game and choose that in the client.

amadin
Member
Posts: 549
Joined: Tue Jun 16, 2015 16:23

Re: [MOD]Keys to lockable chests, doors[WIP]

by amadin » Post

Does this branch from stable 0.4.13 or development version? Can i replace only default mod and doors mod?

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [MOD]Keys to lockable chests, doors[WIP]

by sofar » Post

amadin wrote:Does this branch from stable 0.4.13 or development version? Can i replace only default mod and doors mod?
development, although it may apply to 0.4.13.

Yes, the patch only changes default and doors mods, so you can omit the rest. You can also just fetch the patch and patch your own minetest_game to get the changeset.

Post Reply

Who is online

Users browsing this forum: Kazooo and 40 guests