Forbidding building next to a node

Post Reply
User avatar
Wuzzy
Member
Posts: 3922
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Forbidding building next to a node

by Wuzzy » Post

Hi! I have a suggestion for the core node definitions:

Add a new field to the node definition table and call it “attachable_sides”.
It takes a table of the format

Code: Select all

{ +Y, -Y, +X, -X, +Z, -Z }
(pseudocode)

where each of the arguments is a boolean. The argument names denote the side of the node. This definition is similar to that of “tiles”; the same sides are meant with that.

If a field is true, it is possible to place a node ONTO that corresponding side (default). If it is false, it is not possible. Additionally, any node which has the group “attached_node = 1” can not attach itselves towards a “false” side of a neighbor node. It either can not be built to it or it will fall down if it was already there, but the node to which the attached node was attached changed.

By default, it is possible to build next to all sides of a node.

Possible use cases:
  • Better ladder building behaviour. In current minetest_game it is possible to place a ladder or almost every node in FRONT of another ladder, which kinda looks awkward. For ladders, the “attachable sides” can be changed to false for every side except up and down. In Lua code: “attachable_sides = { false, false, true, true, true, true }”
  • Hanging chains. Again, you wouldn’t expect you can build to the (mostly empty) sides of a hanging chain, so again everything except up and down is unattachable.
  • Book nodeboxes, yeah, nodeboxes that have the shape of books. I suppose you wouldn’t expect to build anything next to it, no matter the side.
  • Nodeboxes. There are probably many use cases for this.
  • Nodes to which you can’t build anything next to. That might have interesting gameplay implications.
Please note that my proposal is different from the existing buildable_to = true. With this one, nodes get replaced when you try to place something on them. If buildable_to is true, the property “attachable_sides” is to be ignored by the engine.

That’s the proposal. I hope it is realistic and understandable while still being formal enough.

User avatar
Krock
Developer
Posts: 4499
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Forbidding building next to a node

by Krock » Post

It's a nice idea but your pseudocode wouldn't work on rotated nodes. X, Y and Z are static, better would be Front, Back, Top, Bottom, Left, Right.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
rubenwardy
Moderator
Posts: 6072
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Forbidding building next to a node

by rubenwardy » Post

Krock, the engine defines tiles in the same way. It is the face direction if the node is not rotated.

User avatar
Wuzzy
Member
Posts: 3922
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Forbidding building next to a node

by Wuzzy » Post

Oh, yes. Of course everything should be rotated accordingly when facedir is used. Not static, that would be useless.
I totally forgot facedir.
Thanks for reminding me of facedir.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests