2 Block Tall Node?

Post Reply
User avatar
GamingAssociation39
Member
Posts: 858
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

2 Block Tall Node?

by GamingAssociation39 » Post

Question: How do you do a 2 block node where you place it down and 2 blocks appear? I need to create a fridge so can someone help me?
Jesus Is Lord and Savior!!!

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: 2 Block Tall Node?

by hajo » Post

GamingAssociation39 wrote:How do you do a 2 block node where you place it down and 2 blocks appear?
Do you mean like a sapling growing into a tree,
or like corn that looks like it is occupying a 2nd node above the actual plant ?

User avatar
GamingAssociation39
Member
Posts: 858
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

Re: 2 Block Tall Node?

by GamingAssociation39 » Post

Sort of like a bed but vertical so when you place it down 2 nodes are attached to each other
Jesus Is Lord and Savior!!!

User avatar
sorcerykid
Member
Posts: 1847
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: 2 Block Tall Node?

by sorcerykid » Post

There are two options that I am aware of:
  • Define the block as a single node with a nodebox and selection box that occupies the space of two nodes and an appropriately sized texture. This requires automatically placing an invisible second node from an on_place callback, and removing that same node from an after_place_node callback. The second node must be non-pointable and non-diggable, but otherwise walkable. (Example: doors)
  • Define the block as two nodes, each with separate textures and separate nodeboxes. This requires automatically placing the second node from an on_place callback, and removing that same node from an after_place_node callback. The first node must have a selection box that occupies the space of two nodes, whereas the selection box for the second node must be empty. (Example: beds)
Which option you choose is ultimately a matter of personal choice. I know it's a bit confusing, so I'd check out the mods suggested above.

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: 2 Block Tall Node?

by Nathan.S » Post

I don't believe that you actually need an invisible node as Sorcerykid mentioned. I've made nodes that are two nodes tall, and as long as the selection and collision box extend into the second node it is impossible to place anything in that node space. I'm not sure how the engine would handle a falling node, such as sand or gravel that landed on the node, but outside of that I've never had any problems with it.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

Byakuren
Member
Posts: 818
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: 2 Block Tall Node?

by Byakuren » Post

Nathan.S wrote:I don't believe that you actually need an invisible node as Sorcerykid mentioned. I've made nodes that are two nodes tall, and as long as the selection and collision box extend into the second node it is impossible to place anything in that node space. I'm not sure how the engine would handle a falling node, such as sand or gravel that landed on the node, but outside of that I've never had any problems with it.
Is that just a client-side check though? If it is, an user with a modified client could place things there. A mod might also mistakenly treat the space as air and do something with it.
Every time a mod API is left undocumented, a koala dies.

User avatar
TumeniNodes
Member
Posts: 2943
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: 2 Block Tall Node?

by TumeniNodes » Post

just make a model and use node_type = "mesh" ... done
lazy man's way but...
A Wonderful World

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: 2 Block Tall Node?

by Nathan.S » Post

Byakuren wrote:
Nathan.S wrote:I don't believe that you actually need an invisible node as Sorcerykid mentioned. I've made nodes that are two nodes tall, and as long as the selection and collision box extend into the second node it is impossible to place anything in that node space. I'm not sure how the engine would handle a falling node, such as sand or gravel that landed on the node, but outside of that I've never had any problems with it.
Is that just a client-side check though? If it is, an user with a modified client could place things there. A mod might also mistakenly treat the space as air and do something with it.
I believe it is client side. The space is technically air, so yes a mod could possibly place something there.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
TumeniNodes
Member
Posts: 2943
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: 2 Block Tall Node?

by TumeniNodes » Post

this is why there is an "invisible node" in doors.
A Wonderful World

User avatar
sorcerykid
Member
Posts: 1847
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: 2 Block Tall Node?

by sorcerykid » Post

The invisible node is necessary as a placeholder. Excluding it could lead to unwanted side effects since the engine would treat the upper node as air. Some mods (like bones, for example) automatically place nodes wherever there is air.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests