summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2013-06-22 20:48:19 -0400
committerkwolekr <kwolekr@minetest.net>2013-06-22 20:49:01 -0400
commit309c5f3641dccaf1260953f098ccd593396dee64 (patch)
tree575c12c6956a4e9c0b375972e6cadc65547f9b5e /doc
parent130464c2688fc2c9cd39d16568c12f17c105cb89 (diff)
downloadminetest-309c5f3641dccaf1260953f098ccd593396dee64.tar.gz
minetest-309c5f3641dccaf1260953f098ccd593396dee64.tar.bz2
minetest-309c5f3641dccaf1260953f098ccd593396dee64.zip
Decoration: Add support for zero probability, fix breakage from last commit
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt18
1 files changed, 13 insertions, 5 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 7be94ac03..8231364fb 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -432,14 +432,22 @@ Schematic specifier
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. It is an integer with a value from 0-255; 0 means
-that node will always appear. If the probability value p is non-zero, then there is a
-(p / 256 * 100)% chance that node will appear when the schematic is placed on the map.
+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.
@@ -1281,7 +1289,7 @@ minetest.create_schematic(p1, p2, probability_list, filename)
^ Apply the specified probability values to the specified nodes in probability_list.
^ probability_list is an array of tables containing two fields, pos and prob.
^ pos is the 3d vector specifying the absolute coordinates of the node being modified,
- ^ and prob is the integer value from 0 to 255 of the probability (see: Schematic specifier).
+ ^ and prob is the integer value from -1 to 255 of the probability (see: Schematic specifier).
^ If there are two or more entries with the same pos value, the last occuring in the array is used.
^ If pos is not inside the box formed by p1 and p2, it is ignored.
^ If probability_list is nil, no probabilities are applied.