X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=doc%2Flua_api.txt;h=ebba40fbf2245fbe0e9d35a09e70ad3117ca5274;hb=b850f0f03829cbb024d22672de0af29cab001d86;hp=d3d427d69dff15213dd621839801d3c08cca6166;hpb=53066024f6a91d5f83241b379b94d8557d43a646;p=dragonfireclient.git diff --git a/doc/lua_api.txt b/doc/lua_api.txt index d3d427d69..ebba40fbf 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -421,6 +421,40 @@ The default value is simple, and is currently the only type supported. for example. Can also generate a decoration of random height between a specified lower and upper bound. This type of decoration is intended for placement of grass, flowers, cacti, papyrus, and so on. +- schematic + Copies a box of MapNodes from a specified schematic file (or raw description). Can specify a + probability of a node randomly appearing when placed. This decoration type is intended to be used + for multi-node sized discrete structures, such as trees, cave spikes, rocks, and so on. + +Schematic specifier +-------------------- + A schematic specifier identifies a schematic by either a filename to a Minetest Schematic file (.mts) +or through raw data supplied through Lua, in the form of a table. This table must specify two fields: + - The 'size' field is a 3d vector containing the dimensions of the provided schematic. + - The 'data' field is a flat table of MapNodes making up the schematic, in the order of [z [y [x]]]. + +In the bulk MapNode data, param1, instead of the typical light values, instead represents the +probability of that node appearing in the structure. +When passed to minetest.create_schematic, probability is an integer value ranging from -1 to 255: + - A probability value of 0 means that node will always appear. + - A probability value of -1 means the node will never appear. + - If the probability value p is greater than 0, then there is a (p / 256 * 100)% chance that node + will appear when the schematic is placed on the map. + +If registering a structure in the raw format, however, -1 is not a valid probability value; in order to +have a node that is not placed, it must be CONTENT_IGNORE (the name for which is "ignore"). + +Important note: Node aliases cannot be used for a raw schematic provided when registering as a decoration. + +Schematic attributes +--------------------- +Currently supported flags: place_center_x, place_center_y, place_center_z + - place_center_x + Placement of this decoration is centered along the X axis. + - place_center_y + Placement of this decoration is centered along the Y axis. + - place_center_z + Placement of this decoration is centered along the Z axis. HUD element types ------------------- @@ -849,6 +883,15 @@ background[,;,;] ^ Position and size units are inventory slots ^ Example for formspec 8x4 in 16x resolution: image shall be sized 8*16px x 4*16px +pwdfield[,;,;;