Page 1 of 1

Connecting Nodeboxes

PostPosted: Tue Jun 21, 2016 18:05
by octacian
Looked around but can't find any information on this topic. Didn't thouroughly check the lua_api.txt, but figured I'd ask anyway.

How do the new connecting nodeboxes work? I'm rewriting the jumping mod and want to have trampolines connect like glass when they are next to each other. However, the trampolines are custom nodeboxes, so I can't do it with glasslike_connected_optional. If I have to, I'll write a method myself to do it, but since it's now being done with fences I figure the new method should be simpler.

Thanks.

Re: Connecting Nodeboxes

PostPosted: Tue Jun 21, 2016 18:53
by Byakuren
Check line 633 of the lua_api.txt (in the "Node boxes: section). The doc doesn't say that connected nodeboxes are supported as a drawtype, but I assume that's a mistake since we now have connected nodebox drawing. You basically define some additional nodeboxes in addition to the main one, and these optional nodeboxes only get added if the node is connected in that direction.

Also look at line 3496 and 3500 (connects_to and connect_sides of node definition), which you can use to define how your node connects to other nodes.

Re: Connecting Nodeboxes

PostPosted: Wed Jun 22, 2016 06:04
by sofar
For good examples on how to use connected nodeboxes you can look at the fences in minetest_game, as well as technic cabling.