[Mod] locks [locks]
-
- Member
- Posts: 4289
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
[Mod] locks [locks]
Update: (Version 1.20) Added support for pipeworks. Shared locked chests and furnaces can now connect to tubes - just like normal chests and furnaces.
Update: Made minor change to make it runnable with newer versions of Minetest and added shared locked furnaces.
This is how the modified locked xdoors2 look. It also shows a list of available commands:
This mod adds functionality to lock and share objects that have been adopted to this mod. The owner (=the one who placed the object) can grant other players usage of the object. Thus, the object may be shared by several players while beeing inaccessible to others.
Sample usage of a shared locked chest:
A modified chest, sign (both from the default game) and doors2 (a mod from xyz) come with the mod as sample objects. Other objects for which this mod might be of intrest could be protector, furnances, teleporters, batteries (technic) or whatever you need.
The chest is most likely the most useful object: If you want to give something to a player who isn't online or roams around elsewhere, you can just put it into a shared locked chest and add the player as one of those allowed to use that chest. He can then pick the stuff up whenever he's close to the chest.
Locked doors seem quite popular as well, though I have mixed feelings about them. They where one of the reasons this mod was created in the first place; still, placing locked doors requires to think about it. It is not that good if there are too many locked doors (multiplayer servers are there so that other people can have a look at your house!), so use with care.
Another way of granting access to a shared locked object is by setting a password with the /set command. If none is set then no one can gain access that way. If a password is set and someone types it in, that player gets access to the object. Thus you can create simple puzzles if you like.
Other ways of getting acces to such objects are the diglocks priv (anyone who has that priv can do the same things with the object as the original owner) and the openlocks priv (acts as if the player has been added by the owner as a legitimate user).
I'm working on a mod called "playergroups" that allows the player to create groups of playernames so that he/she can e.g. create a group "friends" and then do "/add :friends" on each shared locked object instead of typing all the names in for every object. That mod works to a degree, but there's no guarantee. The playergroups mod has not been tested extensively.
The textures (lock, key, keychain, door with lock) have been provided by Addi. Please consult textures/licence.txt.
Download: https://github.com/Sokomine/locks/zipball/master
Browse code: https://github.com/Sokomine/locks
Version: 1.20 Added support for pipeworks
1.16 Pressing ESC in newer MT versions aborts input again (as in older versions)
1.1 first Version
Licence: GPLv3
Supports: * Pipeworks
TODO: Add textures for shared locked signs, chests and furnaces. Help wanted!
In order to use your own shared locked objects, you do need a key:
The keychain is necessary to acces shared locked objects of other players. May also be used for your own objects instead of a key. One keychain is enough for all shared locked objects you encounter:
The lock is a craftitem used to craft shared locked objects:
Shared locked chest:
Shared locked sign:
Shared locked xdoor2:
Shared locked furnace:
The mod can be seen in action on King Arthurs Land.
Update: Made minor change to make it runnable with newer versions of Minetest and added shared locked furnaces.
This is how the modified locked xdoors2 look. It also shows a list of available commands:
This mod adds functionality to lock and share objects that have been adopted to this mod. The owner (=the one who placed the object) can grant other players usage of the object. Thus, the object may be shared by several players while beeing inaccessible to others.
Sample usage of a shared locked chest:
A modified chest, sign (both from the default game) and doors2 (a mod from xyz) come with the mod as sample objects. Other objects for which this mod might be of intrest could be protector, furnances, teleporters, batteries (technic) or whatever you need.
The chest is most likely the most useful object: If you want to give something to a player who isn't online or roams around elsewhere, you can just put it into a shared locked chest and add the player as one of those allowed to use that chest. He can then pick the stuff up whenever he's close to the chest.
Locked doors seem quite popular as well, though I have mixed feelings about them. They where one of the reasons this mod was created in the first place; still, placing locked doors requires to think about it. It is not that good if there are too many locked doors (multiplayer servers are there so that other people can have a look at your house!), so use with care.
Another way of granting access to a shared locked object is by setting a password with the /set command. If none is set then no one can gain access that way. If a password is set and someone types it in, that player gets access to the object. Thus you can create simple puzzles if you like.
Other ways of getting acces to such objects are the diglocks priv (anyone who has that priv can do the same things with the object as the original owner) and the openlocks priv (acts as if the player has been added by the owner as a legitimate user).
I'm working on a mod called "playergroups" that allows the player to create groups of playernames so that he/she can e.g. create a group "friends" and then do "/add :friends" on each shared locked object instead of typing all the names in for every object. That mod works to a degree, but there's no guarantee. The playergroups mod has not been tested extensively.
The textures (lock, key, keychain, door with lock) have been provided by Addi. Please consult textures/licence.txt.
Download: https://github.com/Sokomine/locks/zipball/master
Browse code: https://github.com/Sokomine/locks
Version: 1.20 Added support for pipeworks
1.16 Pressing ESC in newer MT versions aborts input again (as in older versions)
1.1 first Version
Licence: GPLv3
Supports: * Pipeworks
TODO: Add textures for shared locked signs, chests and furnaces. Help wanted!
In order to use your own shared locked objects, you do need a key:
The keychain is necessary to acces shared locked objects of other players. May also be used for your own objects instead of a key. One keychain is enough for all shared locked objects you encounter:
The lock is a craftitem used to craft shared locked objects:
Shared locked chest:
Shared locked sign:
Shared locked xdoor2:
Shared locked furnace:
The mod can be seen in action on King Arthurs Land.
- Attachments
-
- locks.090514.zip
- Current version (from 09.05.2014)
- (33.18 KiB) Downloaded 379 times
-
- locks.zip
- Deprecated. Please ignore.
- (33.03 KiB) Downloaded 208 times
-
- locks.zip
- Deprecated. Please ignore.
- (31.76 KiB) Downloaded 243 times
Last edited by Sokomine on Sun Mar 20, 2016 19:36, edited 5 times in total.
A list of my mods can be found here.
- InfinityProject
- Member
- Posts: 1009
- Joined: Sat Mar 17, 2012 00:52
- Location: World of Infinity, US
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Awesome!
I have been waiting for ages to get a shared locked chest.
I thought about doing this a while ago, but i have no idea how FormSpec works
Can you make this mod into a mod pack, so server owners can chose which parts to add?
IE: Shared Locked boxes but not locked doors
I have been waiting for ages to get a shared locked chest.
I thought about doing this a while ago, but i have no idea how FormSpec works
Can you make this mod into a mod pack, so server owners can chose which parts to add?
IE: Shared Locked boxes but not locked doors
Last edited by rubenwardy on Wed Nov 07, 2012 13:23, edited 1 time in total.
- webdesigner97
- Member
- Posts: 1328
- Joined: Mon Jul 30, 2012 19:16
- GitHub: webD97
- IRC: webdesigner97
- In-game: webdesigner97
- Location: Cologne, Germany
- Contact:
Sounds very cool!
Visit me: webD97.de | @GitHub | @DeviantArt
Mods: StreetsMod | Vehicles
Featured from my blog: Dockerize the Minetest server
On my own behalf: Chameleon - A PHP image manipulation library built around GD
Mods: StreetsMod | Vehicles
Featured from my blog: Dockerize the Minetest server
On my own behalf: Chameleon - A PHP image manipulation library built around GD
-
- Member
- Posts: 4289
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Removing unwanted shared locked objects is quite easy: Just delete or comment out those lines at the end of init.lua that you don't want:
After that you can (but don't have to) delete the corresponding file as well, i.e. shared_locked_xdoors2.lua.
FormSpecs are quite useful. It is even possible to change them during the lifetime of the object. Unfortionately there is no way to react to a player right-clicking and to change the menu at that time. Thus I went for a simple FormSpec input line for the handling of the locks.
Code: Select all
dofile(minetest.get_modpath("locks").."/shared_locked_chest.lua");
dofile(minetest.get_modpath("locks").."/shared_locked_sign_wall.lua");
dofile(minetest.get_modpath("locks").."/shared_locked_xdoors2.lua");
FormSpecs are quite useful. It is even possible to change them during the lifetime of the object. Unfortionately there is no way to react to a player right-clicking and to change the menu at that time. Thus I went for a simple FormSpec input line for the handling of the locks.
A list of my mods can be found here.
Locked doors are only useful if you incorporate node protection around them, but only the ones that use can_dig(). Protection mods that user after_place or on placenode, people have time to fly through before the nodes reappear.
Ideally, you could have protection built-in so that when player places a locked door, it has the effect of protecting the whole dwelling? save the server admins the trouble of setting up small zones :-)
Ideally, you could have protection built-in so that when player places a locked door, it has the effect of protecting the whole dwelling? save the server admins the trouble of setting up small zones :-)
-
- Member
- Posts: 4289
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Right, without some sort of node protection the doors can be digged around and are more or less symbolic. Using them as tools to define protected areas is something I don't want - because that would lead to too many locked doors and inaccessible buildings. But the idea might be extended to another node - a node that can be placed as easily as a protector node and help define a larger area as protected.
A list of my mods can be found here.
-
- Member
- Posts: 57
- Joined: Sun Sep 30, 2012 03:18
- Location: Philippines
-
- Member
- Posts: 57
- Joined: Sun Sep 30, 2012 03:18
- Location: Philippines
Try:clarksallador wrote:C:\Users\user\Downloads\minetest=0.4.3-win32\bin\..\games\minetest_game\mods\Sokomine-locks-4d336b5\init.lua
this also im using 0.4.3
C:\Users\user\Downloads\minetest=0.4.3-win32\bin\..\games\minetest_game\mods\locks\init.lua
Works for most mods with a name/version number/master in the foldername.
If it doesn't work, consider upgrading/installing the latest minetest version. But you still need to rename those kind of folders.
-
- Member
- Posts: 4289
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Ah, yes, sorry. All mods from github do carry a version number. Some people work around this by turning their mods into a modpack. But other mods will need renaming anyway. For my local singleplayer game, I do have a directory with a lot of mods and symlink those I want to have for the current game to the appropriate folder.
A list of my mods can be found here.
[EE] No License found
Please fix these Mistakes and report this post, a moderator will delete it
If you believe I have made a Mistake contact sfan5
Please fix these Mistakes and report this post, a moderator will delete it
If you believe I have made a Mistake contact sfan5
My source code: gist.github.com/sfan5/4642453
-
- Member
- Posts: 4289
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Fixed a minor bug that caused the mod not to run with some recent versions.
Added shared locked furnaces.
Textures for the shared locked objects (sign, chest, furnace - maybe similar to the door?) are welcome!
License added. Re-added images after they where lost due to the disappearance of zimg.eu.
Added shared locked furnaces.
Textures for the shared locked objects (sign, chest, furnace - maybe similar to the door?) are welcome!
License added. Re-added images after they where lost due to the disappearance of zimg.eu.
Last edited by Sokomine on Wed Jul 10, 2013 20:52, edited 1 time in total.
A list of my mods can be found here.
Does this work with homedecor's doors?
[BitChute: https://www.bitchute.com/channel/fCcBQxrYQjNX/] [Rumble: https://rumble.com/user/HPoorHMagentaHChildH]
-
- Member
- Posts: 4289
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
No, it only works with the doors it comes with - the ones shown in the first screenshot. The mod is built so that adapting it to new objects is pretty easy. The doors from homedecor could be adopted if homedecor where to depend on the locks mod (not very likely) or if new versions of them with support for the locks mod where created. The doors need some technical changes to support the lock-functionality (i.e. adding a configuration line in a formspec, checking if they're allowed to be opened etc.)
A list of my mods can be found here.
- addi
- Member
- Posts: 666
- Joined: Thu Sep 20, 2012 03:16
- GitHub: adrido
- Location: Black-Forest, Germany
Here a short instruction how to add a optional dependence on this mod and execute your own functions if it is installed.
you must only change 2 things
first:
add locks? to depends.txt
depends.txt
!important dont forgett the ? after the locks
it makes a optional dependence to the locks mod. if it is installed it is loading first.
the next step is:
add this function to init.lua (or somewhere other)
!important you must check if the locks api is registered! only to check with minetest.get_modpath("locks") will crash the server if you forgett to add the locks? into depends.txt
step 3:
create the file shared_locked.lua
and register the nodes in it and using the locks api
you must only change 2 things
first:
add locks? to depends.txt
depends.txt
Code: Select all
default
locks?
it makes a optional dependence to the locks mod. if it is installed it is loading first.
the next step is:
add this function to init.lua (or somewhere other)
Code: Select all
if locks then
local MODPATH = minetest.get_modpath(minetest.get_modname());
dofile(MODPATH.."/shared_locked.lua")
end
step 3:
create the file shared_locked.lua
and register the nodes in it and using the locks api
Who is online
Users browsing this forum: No registered users and 13 guests