I want to be able to make multi block nodes. That means, a structure build of more than one node, but acts like a single node.
One example is the blast furnace from a Minecraft Mod. The furnace only works if it is build with predefined blocks in a certain pattern. And when it is active, the entire structure behaves like a single node. I can open the furnace inventory by rightclicking each of the nodes. All nodes share the same formspec and inventory
Any idea how this can be implemented in Minetest?
Multi Block Nodes
Re: Multi Block Nodes
Doors are 2 blocks high but are a single node, so you can easily enlarge a node and when hit acts like a single block.
Re: Multi Block Nodes
Didn't thought about that, but I'm not sure if this works as I expect. Will take a look at itTenPlus1 wrote:Doors are 2 blocks high but are a single node, so you can easily enlarge a node and when hit acts like a single block.
Re: Multi Block Nodes
It seems that doors simply expand the selection box. But that's not what I want, because I can't select the other nodes. If I try to dig a node the expanded node would be digged first. And I don't know if I can attach things like pipes.
I think I need to add some kind of controller node and the other nodes just mirror the inventory of the controller.
I think I need to add some kind of controller node and the other nodes just mirror the inventory of the controller.
- BirgitLachner
- Member
- Posts: 393
- Joined: Thu May 05, 2016 10:18
- In-game: Bibs
Re: Multi Block Nodes
I read with interest, because that's what I've always wanted to know.
- GreenXenith
- Member
- Posts: 1356
- Joined: Wed Oct 28, 2015 01:26
- GitHub: GreenXenith
- Location: UTC-8:00
- Contact:
Re: Multi Block Nodes
You can take a look at Wuzzy's large chest in MineClone2 for an example of this.
YouTube | Mods | Patreon | Minetest Discord @greenxenith
You should not be able to read this message.
You should not be able to read this message.
Re: Multi Block Nodes
I assume that the chest is one mesh like the door. Doesn't work with multiple nodes. I tried it.
EDIT: nope, I'm sorry. Is not a mesh. I'll take a look
EDIT: nope, I'm sorry. Is not a mesh. I'll take a look
-
- Member
- Posts: 818
- Joined: Tue Apr 14, 2015 01:59
- GitHub: raymoo
- IRC: Hijiri
- In-game: Raymoo + Clownpiece
Re: Multi Block Nodes
I have thought about this before, there could be a couple ways to do it. Both boil down to keeping track in the node what multiblock they are part of.
One way would be to pick a "central" node and put all the data there. Then in the non-central nodes you put in their metadata a reference to the central node, and in the central node you put a reference to all the non-central nodes. Then when you break one of the nodes you can find all the other ones and make them not part of a multiblock.
Another, maybe cleaner way would be to put the multiblock data in a lua table or mod storage instead of in a central node. Then every node would have a metadata entry that is a key used to find that data.
This is for keeping track of an already created multiblock structure. You would also need to be able to tell when a new structure needs to be created. I have a library (link) that is supposed to handle the "pattern matching" part, but it does not currently have any functionality to help with having all the nodes act as one multiblock thing. In any case you will probably want a generic implementation of multiblocks (I am guessing Minecraft Forge provides something like this in Minecraft).
EDIT: Forgot to mention how you would handle formspecs. Instead of using node formspecs, you would use show_formspec based on the multiblock data. In the first case, you would create the formspec based on the central node, and in the second case you would do it based on the stored data.
One way would be to pick a "central" node and put all the data there. Then in the non-central nodes you put in their metadata a reference to the central node, and in the central node you put a reference to all the non-central nodes. Then when you break one of the nodes you can find all the other ones and make them not part of a multiblock.
Another, maybe cleaner way would be to put the multiblock data in a lua table or mod storage instead of in a central node. Then every node would have a metadata entry that is a key used to find that data.
This is for keeping track of an already created multiblock structure. You would also need to be able to tell when a new structure needs to be created. I have a library (link) that is supposed to handle the "pattern matching" part, but it does not currently have any functionality to help with having all the nodes act as one multiblock thing. In any case you will probably want a generic implementation of multiblocks (I am guessing Minecraft Forge provides something like this in Minecraft).
EDIT: Forgot to mention how you would handle formspecs. Instead of using node formspecs, you would use show_formspec based on the multiblock data. In the first case, you would create the formspec based on the central node, and in the second case you would do it based on the stored data.
Every time a mod API is left undocumented, a koala dies.
- TechNolaByte
- Member
- Posts: 465
- Joined: Wed May 10, 2017 21:00
- GitHub: TechNolaByte
Re: Multi Block Nodes
this is little known but an old magic mod(I think alcemtinker) has a alter that you create by building a 3x3 of a certain block then clicking on the middle one with a wand and it turns into a alter
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.
Who is online
Users browsing this forum: No registered users and 12 guests