diff options
author | kwolekr <kwolekr@minetest.net> | 2015-05-09 01:38:20 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-05-09 18:44:00 -0400 |
commit | 2b99d904f6b8197931954772b6466d8ee56cafc9 (patch) | |
tree | b4d75968c5d0b4072c0110de82aa35d62a1e36df /doc | |
parent | d59e6ad004b64d37ac10dddd61a7b35e7baa1f89 (diff) | |
download | minetest-2b99d904f6b8197931954772b6466d8ee56cafc9.tar.gz minetest-2b99d904f6b8197931954772b6466d8ee56cafc9.tar.bz2 minetest-2b99d904f6b8197931954772b6466d8ee56cafc9.zip |
Schematics: Add per-node force placement option
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lua_api.txt | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index cb8b8848f..93387ef0b 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -782,30 +782,27 @@ 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]]]`. - -**Important**: The default value for `param1` in MapNodes here is `255`, -which represents "always place". - -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 `0` to `255`: - -* A probability value of `0` means that node will never appear (0% chance). -* A probability value of `255` means the node will always appear (100% chance). -* 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 +in the form of a table. This table specifies the following fields: + +* The `size` field is a 3D vector containing the dimensions of the provided schematic. (required) +* The `yslice_prob` field is a table of {ypos, prob} which sets the `ypos`th vertical slice + of the schematic to have a `prob / 256 * 100` chance of occuring. (default: 255) +* The `data` field is a flat table of MapNode tables making up the schematic, + in the order of `[z [y [x]]]`. (required) + Each MapNode table contains: + * `name`: the name of the map node to place (required) + * `prob` (alias `param1`): the probability of this node being placed (default: 255) + * `param2`: the raw param2 value of the node being placed onto the map (default: 0) + * `force_place`: boolean representing if the node should forcibly overwrite any + previous contents (default: false) + +About probability values: +* A probability value of `0` or `1` means that node will never appear (0% chance). +* A probability value of `254` or `255` means the node will always appear (100% chance). +* If the probability value `p` is greater than `1`, then there is a + `(p / 256 * 100)` percent chance that node will appear when the schematic is placed on the map. -**Important note**: Node aliases cannot be used for a raw schematic provided - when registering as a decoration. - Schematic attributes -------------------- |