X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=doc%2Flua_api.txt;h=67ff823dad0af065d155b868da3dff18e697a45e;hb=45589fae58157c8a66c640a1db5795a42a86fc1c;hp=0027b1c863ba812bfc538f64809e87fb86428b1b;hpb=c1b829077a3518f3a129eee11887b2358a53f20b;p=minetest.git diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 0027b1c86..67ff823da 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -322,6 +322,8 @@ param2 is reserved for the engine when any of these are used: facedir modulo 4 = axisdir 0 = y+ 1 = z+ 2 = z- 3 = x+ 4 = x- 5 = y- facedir's two less significant bits are rotation around the axis + paramtype2 == "leveled" + ^ The drawn node level is read from param2, like flowingliquid Nodes can also contain extra data. See "Node Metadata". @@ -353,7 +355,7 @@ Node selection boxes are defined using "node boxes" The "nodebox" node drawtype allows defining visual of nodes consisting of arbitrary number of boxes. It allows defining stuff like stairs. Only the -"fixed" box type is supported for these. +"fixed" and "leveled" box type is supported for these. ^ Please note that this is still experimental, and may be incompatibly changed in the future. @@ -381,6 +383,8 @@ A box is defined as: A box of a regular node would look like: {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, +type = "leveled" is same as "fixed", but y2 will be automaticaly setted to level from param2 + Ore types --------------- These tell in what manner the ore is generated. @@ -432,14 +436,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. @@ -499,8 +511,7 @@ Representations of simple things -------------------------------- Position/vector: {x=num, y=num, z=num} -Currently the API does not provide any helper functions for addition, -subtraction and whatever; you can define those that you need yourself. +For helper functions see "Vector helpers". pointed_thing: {type="nothing"} @@ -875,6 +886,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[,;,;;