Skip to content

Commit 5316b8f

Browse files
authoredJun 3, 2018
Lua_api.txt: Various improvements (#7402)
Node definition: Clearly document custom selection box/collision box (collision box documentation was missing). Remove incorrect light attenuation statement and duplicated light source statement. Nodes: Document which drawtypes require 'paramtype = "light"' to avoid appearing black. Remove incorrect light attenuation statement. HUD: Remove 'HUD API is experimental' text. Noise params: Spread of every octave must exceed 1. Particles and spawners: Document glow values.
1 parent f4ca830 commit 5316b8f

File tree

1 file changed

+41
-19
lines changed

1 file changed

+41
-19
lines changed
 

Diff for: ‎doc/lua_api.txt

+41-19
Original file line numberDiff line numberDiff line change
@@ -907,9 +907,19 @@ node definition:
907907

908908
paramtype = "light"
909909
^ The value stores light with and without sun in its upper and lower 4 bits
910-
respectively. Allows light to propagate from or through the node with
911-
light value falling by 1 per node. This is essential for a light source
912-
node to spread its light.
910+
respectively.
911+
Required by a light source node to enable spreading its light.
912+
Required by the following drawtypes as they determine their visual
913+
brightness from their internal light value:
914+
torchlike,
915+
signlike,
916+
firelike,
917+
fencelike,
918+
raillike,
919+
nodebox,
920+
mesh,
921+
plantlike,
922+
plantlike_rooted.
913923

914924
`param2` is reserved for the engine when any of these are used:
915925

@@ -1217,6 +1227,7 @@ size of the finest detail you require. For example:
12171227
if `spread` is 512 nodes, `lacunarity` is 2.0 and finest detail required is 16
12181228
nodes, octaves will be 6 because the 'wavelengths' of the octaves will be
12191229
512, 256, 128, 64, 32, 16 nodes.
1230+
Warning: If the 'wavelength' of any octave falls below 1 an error will occur.
12201231

12211232
### `persistence`
12221233
Each additional octave has an amplitude that is the amplitude of the previous
@@ -1506,9 +1517,6 @@ factor!
15061517
Below are the specific uses for fields in each type; fields not listed for that
15071518
type are ignored.
15081519

1509-
**Note**: Future revisions to the HUD API may be incompatible; the HUD API is
1510-
still in the experimental stages.
1511-
15121520
### `image`
15131521
Displays an image on the HUD.
15141522

@@ -5322,11 +5330,7 @@ Definition tables
53225330
^ Only when `paramtype2` supports palettes. ]]
53235331
post_effect_color = "green#0F",
53245332
^ Screen tint if player is inside node, see "ColorSpec".
5325-
paramtype = "none", --[[
5326-
^ See "Nodes".
5327-
^ paramtype = "light" allows light to propagate from or through the
5328-
^ node with light value falling by 1 per node. This line is essential
5329-
^ for a light source node to spread its light. ]]
5333+
paramtype = "none", -- See "Nodes".
53305334
paramtype2 = "none", -- See "Nodes"
53315335
place_param2 = nil, -- Force value for param2 when player places node
53325336
is_ground_content = true,
@@ -5374,10 +5378,26 @@ Definition tables
53745378
^ Tells connected nodebox nodes to connect only to these sides of this
53755379
^ node. ]]
53765380
mesh = "model",
5377-
selection_box = {type="regular"}, --[[
5378-
^ See "Node boxes".
5381+
selection_box = {
5382+
type = "fixed",
5383+
fixed = {
5384+
{-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16},
5385+
},
5386+
},
5387+
^ Custom selection box definition. Multiple boxes can be defined.
53795388
^ If drawtype "nodebox" is used and selection_box is nil, then node_box
5380-
^ is used. ]]
5389+
^ definition is used for the selection box.
5390+
collision_box = {
5391+
type = "fixed",
5392+
fixed = {
5393+
{-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16},
5394+
},
5395+
},
5396+
^ Custom collision box definition. Multiple boxes can be defined.
5397+
^ If drawtype "nodebox" is used and collision_box is nil, then node_box
5398+
^ definition is used for the collision box.
5399+
^ For both of the above a box is defined as:
5400+
^ {xmin, ymin, zmin, xmax, ymax, zmax} in nodes from node center.
53815401
legacy_facedir_simple = false,
53825402
^ Support maps made in and before January 2012.
53835403
legacy_wallmounted = false,
@@ -5946,11 +5966,12 @@ Note that in params, use of symbols is as follows:
59465966
texture = "image.png",
59475967
-- ^ Uses texture (string)
59485968
playername = "singleplayer",
5949-
-- ^ optional, if specified spawns particle only on the player's client
5969+
-- ^ Optional, if specified spawns particle only on the player's client
59505970
animation = {Tile Animation definition},
5951-
-- ^ optional, specifies how to animate the particle texture
5971+
-- ^ Optional, specifies how to animate the particle texture
59525972
glow = 0
5953-
-- ^ optional, specify particle self-luminescence in darkness
5973+
-- ^ Optional, specify particle self-luminescence in darkness.
5974+
-- ^ Values 0-14.
59545975
}
59555976

59565977

@@ -5991,9 +6012,10 @@ Note that in params, use of symbols is as follows:
59916012
-- ^ Playername is optional, if specified spawns particle only on the
59926013
-- ^ player's client.
59936014
animation = {Tile Animation definition},
5994-
-- ^ optional, specifies how to animate the particle texture
6015+
-- ^ Optional, specifies how to animate the particle texture
59956016
glow = 0
5996-
-- ^ optional, specify particle self-luminescence in darkness
6017+
-- ^ Optional, specify particle self-luminescence in darkness.
6018+
-- ^ Values 0-14.
59976019
}
59986020

59996021
### `HTTPRequest` definition (`HTTPApiTable.fetch_async`, `HTTPApiTable.fetch_async`)

0 commit comments

Comments
 (0)