minetest/src/script/cpp_api
Auke Kok e737b1c271 Nodebox: Allow nodeboxes to "connect"
We introduce a new nodebox type "connected", and allow these nodes to
have optional nodeboxes that connect it to other connecting nodeboxes.

This is all done at scenedraw time in the client. The client will
inspect the surrounding nodes and if they are to be connected to,
it will draw the appropriate connecting nodeboxes to make those
connections.

In the node_box definition, we have to specify separate nodeboxes for
each valid connection. This allows us to make nodes that connect only
horizontally (the common case) by providing optional nodeboxes for +x,
-x, +z, -z directions. Or this allows us to make wires that can connect
up and down, by providing nodeboxes that connect it up and down (+y,
-y) as well.

The optional nodeboxes can be arrays. They are named "connect_top,
"connect_bottom", "connect_front", "connect_left", "connect_back" and
"connect_right". Here, "front" means the south facing side of the node
that has facedir = 0.

Additionally, a "fixed" nodebox list present will always be drawn,
so one can make a central post, for instance. This "fixed" nodebox
can be omitted, or it can be an array of nodeboxes.

Collision boxes are also updated in exactly the same fashion, which
allows you to walk over the upper extremities of the individual
node boxes, or stand really close to them. You can also walk up
node noxes that are small in height, all as expected, and unlike the
NDT_FENCELIKE nodes.

I've posted a screenshot demonstrating the flexibility at
    http://i.imgur.com/zaJq8jo.png
In the screenshot, all connecting nodes are of this new subtype.

Transparent textures render incorrectly, Which I don't think is
related to this text, as other nodeboxes also have issues with this.

A protocol bump is performed in order to be able to send older clients
a nodeblock that is usable for them. In order to avoid abuse of users
we send older clients a "full-size" node, so that it's impossible for
them to try and walk through a fence or wall that's created in this
fashion. This was tested with a pre-bump client connected against a
server running the new protocol.

These nodes connect to other nodes, and you can select which ones
those are by specifying node names (or group names) in the
connects_to string array:
      connects_to = { "group:fence", "default:wood" }
By default, nodes do not connect to anything, allowing you to create
nodes that always have to be paired in order to connect. lua_api.txt
is updated to reflect the extension to the node_box API.

Example lua code needed to generate these nodes can be found here:
    https://gist.github.com/sofar/b381c8c192c8e53e6062
2016-03-12 12:08:17 -05:00
..
CMakeLists.txt Add mod security 2015-05-16 18:32:31 -04:00
s_async.cpp Fix server crashing on Lua errors 2015-10-31 13:28:58 -04:00
s_async.h Push error handler afresh each time lua_pcall is used 2015-08-27 01:56:06 +02:00
s_base.cpp Fix C++11 compilability 2016-01-23 05:45:29 +01:00
s_base.h Add minetest.register_lbm() to run code on block load only 2016-03-07 19:54:26 +01:00
s_entity.cpp Push error handler afresh each time lua_pcall is used 2015-08-27 01:56:06 +02:00
s_entity.h Fix class/struct forward declaration inconsistencies (good on ya, MSVC) 2013-06-06 22:57:38 +02:00
s_env.cpp s_env.{cpp, h} cleanups 2016-03-07 19:54:26 +01:00
s_env.h s_env.{cpp, h} cleanups 2016-03-07 19:54:26 +01:00
s_internal.h Fix C++11 compilability 2016-01-23 05:45:29 +01:00
s_inventory.cpp Push error handler afresh each time lua_pcall is used 2015-08-27 01:56:06 +02:00
s_inventory.h Fix class/struct forward declaration inconsistencies (good on ya, MSVC) 2013-06-06 22:57:38 +02:00
s_item.cpp Add on_secondary_use when right clicking an item in the air 2015-12-02 02:18:44 +00:00
s_item.h Add on_secondary_use when right clicking an item in the air 2015-12-02 02:18:44 +00:00
s_mainmenu.cpp Push error handler afresh each time lua_pcall is used 2015-08-27 01:56:06 +02:00
s_mainmenu.h Optional reconnect functionality 2015-07-23 07:38:13 +02:00
s_node.cpp Nodebox: Allow nodeboxes to "connect" 2016-03-12 12:08:17 -05:00
s_node.h Replace instances of std::map<std::string, std::string> with StringMap 2015-05-19 16:10:49 -04:00
s_nodemeta.cpp Push error handler afresh each time lua_pcall is used 2015-08-27 01:56:06 +02:00
s_nodemeta.h Fix class/struct forward declaration inconsistencies (good on ya, MSVC) 2013-06-06 22:57:38 +02:00
s_player.cpp Push error handler afresh each time lua_pcall is used 2015-08-27 01:56:06 +02:00
s_player.h Add minetest.register_on_player_hpchange 2015-06-13 19:40:31 +02:00
s_security.cpp Remove debug.getupvalue from the Lua sandbox whitelist 2016-03-03 00:09:05 -05:00
s_security.h Use LuaErrors in security check macros 2016-03-07 13:37:15 -05:00
s_server.cpp Push error handler afresh each time lua_pcall is used 2015-08-27 01:56:06 +02:00
s_server.h Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu 2013-08-14 21:03:33 +02:00