Skip to content

Commit 0c99da4

Browse files
committedJul 26, 2017
Create_schematic documentation: Update for per-node force-place
The probability list has to also encode per-node force-place.
1 parent f61928d commit 0c99da4

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed
 

Diff for: ‎doc/lua_api.txt

+12-5
Original file line numberDiff line numberDiff line change
@@ -2847,18 +2847,25 @@ These functions return the leftover itemstack.
28472847
### Schematics
28482848
* `minetest.create_schematic(p1, p2, probability_list, filename, slice_prob_list)`
28492849
* Create a schematic from the volume of map specified by the box formed by p1 and p2.
2850-
* Apply the specified probability values to the specified nodes in `probability_list`.
2850+
* Apply the specified probability and per-node force-place to the specified nodes
2851+
according to the `probability_list`.
28512852
* `probability_list` is an array of tables containing two fields, `pos` and `prob`.
28522853
* `pos` is the 3D vector specifying the absolute coordinates of the
28532854
node being modified,
2854-
* `prob` is the integer value from `0` to `255` of the probability (see: Schematic specifier).
2855+
* `prob` is an integer value from `0` to `255` that encodes probability and
2856+
per-node force-place. Probability has levels 0-127, then 128 is added to
2857+
encode per-node force-place.
2858+
For probability stated as 0-255, divide by 2 and round down to get values
2859+
0-127, then add 128 to apply per-node force-place.
28552860
* If there are two or more entries with the same pos value, the
28562861
last entry is used.
28572862
* If `pos` is not inside the box formed by `p1` and `p2`, it is ignored.
28582863
* If `probability_list` equals `nil`, no probabilities are applied.
2859-
* Slice probability works in the same manner, except takes a field
2860-
called `ypos` instead which
2861-
indicates the y position of the slice with a probability applied.
2864+
* Apply the specified probability to the specified horizontal slices according to the
2865+
`slice_prob_list`.
2866+
* `slice_prob_list` is an array of tables containing two fields, `ypos` and `prob`.
2867+
* `ypos` indicates the y position of the slice with a probability applied,
2868+
the lowest slice being `ypos = 0`.
28622869
* If slice probability list equals `nil`, no slice probabilities are applied.
28632870
* Saves schematic in the Minetest Schematic format to filename.
28642871

0 commit comments

Comments
 (0)
Please sign in to comment.