Page 1 of 1

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

PostPosted: Fri Dec 11, 2015 08:13
by sofar
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)

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

PostPosted: Fri Dec 11, 2015 11:46
by KCoombes
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

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

PostPosted: Fri Dec 11, 2015 21:17
by sofar
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.

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

PostPosted: Thu Dec 24, 2015 12:10
by amadin
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").

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

PostPosted: Fri Dec 25, 2015 20:07
by sofar
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.

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

PostPosted: Sat Dec 26, 2015 05:19
by amadin
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?

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

PostPosted: Sat Dec 26, 2015 13:39
by everamzah
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.

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

PostPosted: Sat Dec 26, 2015 19:44
by sofar
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.

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

PostPosted: Sat Dec 26, 2015 20:32
by amadin
Does this branch from stable 0.4.13 or development version? Can i replace only default mod and doors mod?

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

PostPosted: Sat Dec 26, 2015 20:42
by sofar
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.