Connecting Nodeboxes

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

Connecting Nodeboxes

by octacian » Tue Jun 21, 2016 18:05

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.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: Connecting Nodeboxes

by Byakuren » Tue Jun 21, 2016 18:53

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.
Every time a mod API is left undocumented, a koala dies.
 

sofar
Member
 
Posts: 781
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Connecting Nodeboxes

by sofar » Wed Jun 22, 2016 06:04

For good examples on how to use connected nodeboxes you can look at the fences in minetest_game, as well as technic cabling.
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 5 guests

cron