[Mod] Area Containers [1.7.0] [area_containers]

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

[Mod] Area Containers [1.7.0] [area_containers]

by jwmhjwmh » Post

Image

Image

Description

This mod adds "area containers". These are nodes which a player can enter. Inside is an area in which structures can be built. Items can pass in and out through Pipeworks tubes. The inside and outside can communicate using Mesecons or Digilines.

I was inspired to make this by a mod for Minecraft I saw once a while ago which did a similar thing.

Locking:

Area containers can be locked. To do so, first craft a lock. Then punch a container with the lock (you must be either the one who built the container or one able to bypass protection.)

If a container is unowned and you can bypass protection, you can claim it by locking it.

To let other people in, first craft a blank key. Then punch your container with the key, binding the key to the container. Other people can enter the container while holding the key. The container contents themselves are not protected in any way.

You can unlock your container by punching it with your bare hand. You must remove the lock before breaking the container. All keys to the container will continue to work even if you uninstall and reinstall the lock.

Caveats:
  • Due to an unfortunate technical limitation, area containers cannot be moved by pistons.
  • This mod does not load the insides of containers without players in them. If you need this feature, you can use the world anchor node from Technic.
  • While a container is not diggable until you empty it of nodes and objects, other mods may let you pick it up in order to move it. Doing so will probably lead to loss of the contents. (But teleporter_tool will work.)
  • Only up to 65535 containers may exist at any one time.
  • This mod will not work if Digilines is enabled but Mesecons is not.

Crafting

The items can be crafted in Minetest Game (and similar games) and MineClone 2. The crafting can be disabled in the settings.

Minetest Game and Modpack "Zero":

Container:

Code: Select all

sSs
SMS
sSs

s = steel ingot
S = steel block
M = mese block
Lock:

Code: Select all

s
ms
ss

s = steel ingot
m = mese crystal fragment
Blank key:

Code: Select all

sss
m

s = steel ingot
m = mese crystal fragment
MineClone 2:

Container:

Code: Select all

IdI
drd
IdI

I = iron block
d = diamond
r = redstone dust
Lock:

Code: Select all

i
ri
ii

i = iron ingot
r = redstone dust
Blank key:

Code: Select all

iii
r

i = iron ingot
r = redstone dust
Key recycling:

Whatever other crafting recipes are available, you can recycle a used key back into an blank key. The recipe is shapeless.

License

Code: LGPLv3+
Textures/other assets: CC BY-SA 3.0 Unported

Dependencies

Mod dependencies: none
Optional mod dependencies: default, digilines, mcl_core, mcl_sounds, mesecons, mesecons_mvps, pipeworks, zr_iron, zr_mese, zr_metal

Source Code

Download: https://github.com/TurkeyMcMac/area_con ... s/main.zip
Github: https://github.com/TurkeyMcMac/area_containers
Last edited by jwmhjwmh on Wed Nov 16, 2022 13:10, edited 53 times in total.

SciFurz
Member
Posts: 31
Joined: Tue Jun 01, 2021 22:51
Contact:

An introvert's dream come true :-p

by SciFurz » Post

I'm rewatching Yogscast Minecraft videos again for fun, and they have one space station series playlist where they used the compact storage like microexpansion, and an area spawn machine where areas are stored on similar storage drives of various sizes.

Thinking about that again I did a search and thus found your excellent mod. Now, together with infinite cobblestone generation via Techpack and the use of Void Chests, I don't even have to go outside in Minetest as well. I can be a shut-in in a virtual world too! *lol*

Seeing you make placing areas "within" areas work, this can be made into a near infinite virtual maze. Or a paranormal house with non-obvious portal doorways. Or a different biome in each area, with containers hidden in each for a huge exploration quest (now I want to write a science fiction book based on this idea). Or build one warehouse area full of them and use Travelnet booths to move easily from one stored container to any other.

To have an option of different area sizes would top this complete virtual virtual world off. That would need a good routine which keeps track of blocks the size of the maximum area, and assign new (smaller) areas to blocks which are not fully occupied with existing similar sized areas.

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Re: An introvert's dream come true :-p

by jwmhjwmh » Post

Thanks, I'm glad you like it! I should mention that it probably doesn't work with techpack at the moment, since techpack uses tubelib2. I'm not familiar with the API of tubelib2, but it may be possible to integrate with it. As for the areas of different sizes, that probably wouldn't be too hard to implement. The allocation routine actually works almost how you describe already; the inside chambers are all very spaced out by default. Not too much would need to be changed as long as the port offsets stay the same for all container sizes.

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Re: [Mod] Area Containers [0.3.0] [area_containers]

by jwmhjwmh » Post

Version 0.3.0 stops items going through disconnected ports. It also teleports the player closer to the floor when entering or exiting containers.

SciFurz
Member
Posts: 31
Joined: Tue Jun 01, 2021 22:51
Contact:

Re: An introvert's dream come true :-p

by SciFurz » Post

jwmhjwmh wrote:
Wed Jul 21, 2021 12:16
Thanks, I'm glad you like it! I should mention that it probably doesn't work with techpack at the moment, since techpack uses tubelib2. I'm not familiar with the API of tubelib2, but it may be possible to integrate with it. As for the areas of different sizes, that probably wouldn't be too hard to implement. The allocation routine actually works almost how you describe already; the inside chambers are all very spaced out by default. Not too much would need to be changed as long as the port offsets stay the same for all container sizes.
I wasn't yet thinking of using the pipe connections, just that with a cobblestone generator setup, I can automatically mine minerals inside an area and don't have to go outside into the overworld to mine. ;-)
I already had designed compact setups for generation of minerals and biofuel and farming wood and crops in a closed 14x14x14 cube to align with the forceload blocks. When I saw the internal area size I thought it saved me the trouble of aligning and building the cubes myself.
Techpack has wireless connecting blocks through which to transport items, so it's also not restricted to the specific tiles on the wall.

I noticed the configuration settings and spacing distance. With that default an area of 16x16x16 mapblocks would already fit, yes. Large enough to hold a hidden mini-world inside it. Jules Verne, here we come. :-p
If a list can be stored of generated areas, such a big one could be filled with cubes of 1, 2, 4, or 8 cubic mapblock lengths for efficient storage. Not that I think someone would generate so many areas that they'd already reach the regular world surface with the current settings.

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Re: An introvert's dream come true :-p

by jwmhjwmh » Post

SciFurz wrote:
Wed Jul 21, 2021 14:39
I wasn't yet thinking of using the pipe connections, just that with a cobblestone generator setup, I can automatically mine minerals inside an area and don't have to go outside into the overworld to mine. ;-)
I already had designed compact setups for generation of minerals and biofuel and farming wood and crops in a closed 14x14x14 cube to align with the forceload blocks. When I saw the internal area size I thought it saved me the trouble of aligning and building the cubes myself.
Techpack has wireless connecting blocks through which to transport items, so it's also not restricted to the specific tiles on the wall.
Alright, I see. That sounds like a nice machine!
SciFurz wrote:
Wed Jul 21, 2021 14:39
I noticed the configuration settings and spacing distance. With that default an area of 16x16x16 mapblocks would already fit, yes. Large enough to hold a hidden mini-world inside it. Jules Verne, here we come. :-p
If a list can be stored of generated areas, such a big one could be filled with cubes of 1, 2, 4, or 8 cubic mapblock lengths for efficient storage. Not that I think someone would generate so many areas that they'd already reach the regular world surface with the current settings.
There's actually a limit of 65535 containers in existence at a time that's fundamental to the design of the mod. The way a container is connected to its inside chamber is through its param1 and param2 values, each of which is 8 bits. This makes for 2^16 = 65536 possibilities. But the (0, 0) parameter pair is reserved, leaving 65535 possibilities. Hopefully this is enough for everyone!

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Re: [Mod] Area Containers [0.4.0] [area_containers]

by jwmhjwmh » Post

Version 0.4.0 removes the inside spacing setting, since I don't think there was much use for it.

SciFurz
Member
Posts: 31
Joined: Tue Jun 01, 2021 22:51
Contact:

Re: An introvert's dream come true :-p

by SciFurz » Post

jwmhjwmh wrote:
Wed Jul 21, 2021 17:06
Hopefully this is enough for everyone!
Wasn't there someone who once said 4K RAM was enough for a computer? *sniggers*

Idea for a settings option: set a default light level inside the container.
Althoug the wall node is set to LIGHT_MAX, I still need to place lamps to grow crops inside. That also made me think about how light it is inside. I set light to 0 in nodes.lua, and a new container is dim on the inside and feels more "real". Placing a light adds to the mood of a secret place.
I haven't dug through minetest and other code to see what it takes to make it pitch black, since I think that would make it feel even more exploratory and fun like going into caves. I could alternatively cover all walls with nodes, but that would then reduce the inside volume.

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Re: An introvert's dream come true :-p

by jwmhjwmh » Post

SciFurz wrote:
Thu Jul 22, 2021 11:33
Idea for a settings option: set a default light level inside the container.
Althoug the wall node is set to LIGHT_MAX, I still need to place lamps to grow crops inside. That also made me think about how light it is inside. I set light to 0 in nodes.lua, and a new container is dim on the inside and feels more "real". Placing a light adds to the mood of a secret place.
I haven't dug through minetest and other code to see what it takes to make it pitch black, since I think that would make it feel even more exploratory and fun like going into caves. I could alternatively cover all walls with nodes, but that would then reduce the inside volume.
This is a good idea. I think I can make it possible to completely remove the light, too.

SciFurz
Member
Posts: 31
Joined: Tue Jun 01, 2021 22:51
Contact:

Re: An introvert's dream come true :-p

by SciFurz » Post

jwmhjwmh wrote:
Thu Jul 22, 2021 12:24
This is a good idea. I think I can make it possible to completely remove the light, too.
Nice, thanks! I just found out that setting light to 0 only meant light level followed the one from outside. The dimness I saw first time was simply because it was nighttime. :-/
Adding and setting sunlight_propagation to false didn't do anything.

SciFurz
Member
Posts: 31
Joined: Tue Jun 01, 2021 22:51
Contact:

Moving the node

by SciFurz » Post

I tested if I could move the node with the mover mod, and the container contents were wiped as I kind of expected.
I was thinking of the situation where one would want to rearrange a storage space with one or more used nodes without the need to empty and rebuild the container contents.
In my test game I have access to one container from the overworld, which holds a few nodes to other containers.

Could the metadata linked to the container location be saved with the node until it is actually trashed?

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Re: [Mod] Area Containers [0.5.0] [area_containers]

by jwmhjwmh » Post

Version 0.5.0 add a setting to change the lighting inside containers.

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Re: Moving the node

by jwmhjwmh » Post

SciFurz wrote:
Thu Jul 22, 2021 13:19
I tested if I could move the node with the mover mod, and the container contents were wiped as I kind of expected.
I was thinking of the situation where one would want to rearrange a storage space with one or more used nodes without the need to empty and rebuild the container contents.
In my test game I have access to one container from the overworld, which holds a few nodes to other containers.

Could the metadata linked to the container location be saved with the node until it is actually trashed?
The containers can be moved by pistons, although that's obviously less convenient.

There are some problems with saving the node contents when it's in item form. First of all, I can't find a callback for when an item is trashed. Secondly, what if there's another player in a container that you pick up and trash? They would be trapped.

I can think of a hypothetical mod that would allow moving containers. It would provide some kind of tool for moving nodes. You would select one node then select a place to teleport it to. The area_containers mod already supports this kind of node movement, as long as param1 and param2 are preserved.

SciFurz
Member
Posts: 31
Joined: Tue Jun 01, 2021 22:51
Contact:

Re: Moving the node

by SciFurz » Post

I read about the mention how a piston breaks the location connection, which is a convoluted way to move the node anyway.
jwmhjwmh wrote:
Thu Jul 22, 2021 15:03
Secondly, what if there's another player in a container that you pick up and trash? They would be trapped.
[insert maniacal laughter]
jwmhjwmh wrote:
Thu Jul 22, 2021 15:03
I can think of a hypothetical mod that would allow moving containers. It would provide some kind of tool for moving nodes. You would select one node then select a place to teleport it to. The area_containers mod already supports this kind of node movement, as long as param1 and param2 are preserved.
That's what the mover mod seems to do when moving a chest, which is why I thought it would be funny if it actually unexpectedly worked. ;-)

I just received the update, and together with the wielding light mod, it's nice and spooky entering the totally dark node holding a torch.
Now to spawn a few scary mobs in there before the player enters the container. *grins deviously*
I can also try setting up a mushroom farm now.

SciFurz
Member
Posts: 31
Joined: Tue Jun 01, 2021 22:51
Contact:

And one more while I'm expanding my lair

by SciFurz » Post

The option to label (and edit it) the container node so it shows up in the tooltip as I look at them.
Right now I'm plastering signs on them to keep track which node is linked to which container.

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Re: And one more while I'm expanding my lair

by jwmhjwmh » Post

SciFurz wrote:
Fri Jul 23, 2021 03:34
The option to label (and edit it) the container node so it shows up in the tooltip as I look at them.
Right now I'm plastering signs on them to keep track which node is linked to which container.
This sounds like a job for a separate mod for setting custom tooltips. If it doesn't already exist, maybe it can be the mod I make next.

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Re: And one more while I'm expanding my lair

by jwmhjwmh » Post

It looks like you can set the infotext/tooltip with the craftable "pencil" item from Alternode.

SciFurz
Member
Posts: 31
Joined: Tue Jun 01, 2021 22:51
Contact:

Re: And one more while I'm expanding my lair

by SciFurz » Post

jwmhjwmh wrote:
Fri Jul 23, 2021 12:33
It looks like you can set the infotext/tooltip with the craftable "pencil" item from Alternode.
Unfortunately all nodes are unowned, and it doesn't display values without knowing the key.
I did change something when I added owner as key because when I tried the pencil again it said it unset me as owner.
This in singleplayer mode and server-client mode.

I see in the forum post he's still working on it, so maybe it'll work later if the mentioned mod node_owner doesn't help.

SciFurz
Member
Posts: 31
Joined: Tue Jun 01, 2021 22:51
Contact:

An impression

by SciFurz » Post

To give an impression of the idea I'm working on, this is one of two backbone containers for redundancy, and the kind of gallery I have in mind of all the container nodes in use. The nodes would be grouped by content (living spaces, farms, construction workshops, etc.) in an ideal case.
The areas themselves will be accessed with different travelnet box networks in this case, so this is more like the emergency exit fitting the logo inside the containers. ;-)

I think I can easily fit 448 nodes inside one area like this.
.
container_gallery.jpg
container_gallery.jpg (78.48 KiB) Viewed 3800 times
.

And speaking of exits, this idea just popped up:
In case of emergency, break glass.
.
emergency_escape.png
emergency_escape.png (57.57 KiB) Viewed 3800 times

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Re: An impression

by jwmhjwmh » Post

Nice work! The contrast between light and dark looks good.

SciFurz
Member
Posts: 31
Joined: Tue Jun 01, 2021 22:51
Contact:

Re: An impression

by SciFurz » Post

jwmhjwmh wrote:
Fri Jul 23, 2021 18:28
Nice work! The contrast between light and dark looks good.
Thanks.
It's possible thanks to complete darkness as default which brings about the lamp light more, and the matching grey colours of the nodes and the stairway components. It brings about such a nice science fiction mood. :-)

I might just build the entire thing to see how it looks.

SciFurz
Member
Posts: 31
Joined: Tue Jun 01, 2021 22:51
Contact:

Curiousity won

by SciFurz » Post

I just had to know and built one floor, and ended up with 74 container nodes, This would then make a total of 296 nodes on 4 floors for one backbone container.
I will pick a random node when I need one, and mark it with an overhead light and sign.

It really feels like a late 70s or 80s science fiction movie with the industrial, used future look, and with this amount it's easy to hide a bonus container which is only accessible from here.
.
screenshot_20210724_083908.png
screenshot_20210724_083908.png (252.48 KiB) Viewed 3800 times
screenshot_20210724_083935.png
screenshot_20210724_083935.png (303.13 KiB) Viewed 3800 times
screenshot_20210724_084056.png
screenshot_20210724_084056.png (251.86 KiB) Viewed 3800 times
.
PS: always carry a light during construction, otherwise you'll end up clicking all over the place to find the exit tile in pitch black darkness when accidentally right clicking a node.

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Re: [Mod] Area Containers [0.6.0] [area_containers]

by jwmhjwmh » Post

Version 0.6.0 improves security by protecting the layer of the world where the inside chambers are and by only letting people use exits if they are actually inside. Non-player objects can now also enter and exit containers, theoretically.

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Re: [Mod] Area Containers [0.6.2] [area_containers]

by jwmhjwmh » Post

Version 0.6.2 adds a crafting recipe that works in MineClone 2.

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Re: [Mod] Area Containers [0.7.0] [area_containers]

by jwmhjwmh » Post

Version 0.7.0 increases the crafting difficulty for both possible recipes.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot] and 10 guests