Skip to content

Commit c28a90d

Browse files
paramatkwolekr
authored andcommittedJan 12, 2015
Lua-api.txt: Document that paramtype='light' results in light propagation with attenuation and is essential for a light source to spread it's light
1 parent aed70cb commit c28a90d

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed
 

‎doc/lua_api.txt

+26-14
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,10 @@ node definition:
473473
`param1` is reserved for the engine when `paramtype != "none"`:
474474

475475
paramtype = "light"
476-
^ The value stores light with and without sun in it's
477-
upper and lower 4 bits.
476+
^ The value stores light with and without sun in its upper and lower 4 bits
477+
respectively. Allows light to propagate from or through the node with
478+
light value falling by 1 per node. This is essential for a light source
479+
node to spread its light.
Has a conversation. Original line has a conversation.
478480

479481
`param2` is reserved for the engine when any of these are used:
480482

@@ -1332,7 +1334,8 @@ examples.
13321334
* Position and size units are inventory slots
13331335
* Example for formspec 8x4 in 16x resolution:
13341336
image shall be sized 8 times 16px times 4 times 16px
1335-
* If `true` the background is clipped to formspec size (`x` and `y` are used as offset values, `w` and `h` are ignored)
1337+
* If `true` the background is clipped to formspec size
1338+
(`x` and `y` are used as offset values, `w` and `h` are ignored)
13361339

13371340
#### `pwdfield[<X>,<Y>;<W>,<H>;<name>;<label>]`
13381341
* Textual password style field; will be sent to server when a button is clicked
@@ -1851,7 +1854,8 @@ and `minetest.auth_reload` call the authetification handler.
18511854
* Function cannot be called after the registration period; only initialization and `on_mapgen_init`
18521855
* Takes a table as an argument with the fields `mgname`, `seed`, `water_level`, and `flags`.
18531856
* Leave field unset to leave that parameter unchanged
1854-
* `flags` contains a comma-delimited string of flags to set, or if the prefix `"no"` is attached, clears instead.
1857+
* `flags` contains a comma-delimited string of flags to set,
1858+
or if the prefix `"no"` is attached, clears instead.
18551859
* `flags` is in the same format and has the same options as `mg_flags` in `minetest.conf`
18561860
* `minetest.set_noiseparams(name, noiseparams, set_default)`
18571861
* Sets the noiseparams setting of `name` to the noiseparams table specified in `noiseparams`.
@@ -1940,7 +1944,8 @@ and `minetest.auth_reload` call the authetification handler.
19401944
* Get position of a `pointed_thing` (that you can get from somewhere)
19411945
* `minetest.dir_to_facedir(dir, is6d)`
19421946
* Convert a vector to a facedir value, used in `param2` for `paramtype2="facedir"`;
1943-
* passing something non-`nil`/`false` for the optional second parameter causes it to take the y component into account
1947+
* passing something non-`nil`/`false` for the optional second parameter causes it to
1948+
take the y component into account
19441949
* `minetest.facedir_to_dir(facedir)`
19451950
* Convert a facedir back into a vector aimed directly out the "back" of a node
19461951
* `minetest.dir_to_wallmounted(dir)`
@@ -1989,7 +1994,8 @@ and `minetest.auth_reload` call the authetification handler.
19891994
ground)
19901995

19911996
### Rollback
1992-
* `minetest.rollback_get_node_actions(pos, range, seconds, limit)`: returns `{{actor, pos, time, oldnode, newnode}, ...}`
1997+
* `minetest.rollback_get_node_actions(pos, range, seconds, limit)`:
1998+
returns `{{actor, pos, time, oldnode, newnode}, ...}`
19931999
* Find who has done something to a node, or near a node
19942000
* `actor`: `"player:<name>"`, also `"liquid"`.
19952001
* `minetest.rollback_revert_actions_by(actor, seconds)`: returns `boolean, log_messages`
@@ -2076,8 +2082,8 @@ These functions return the leftover itemstack.
20762082
* If there are two or more entries with the same pos value, the last entry is used.
20772083
* If `pos` is not inside the box formed by `p1` and `p2`, it is ignored.
20782084
* If `probability_list` equals `nil`, no probabilities are applied.
2079-
* Slice probability works in the same manner, except takes a field called `ypos` instead which indicates
2080-
the y position of the slice with a probability applied.
2085+
* Slice probability works in the same manner, except takes a field called `ypos` instead which
2086+
indicates the y position of the slice with a probability applied.
20812087
* If slice probability list equals `nil`, no slice probabilities are applied.
20822088
* Saves schematic in the Minetest Schematic format to filename.
20832089

@@ -2369,7 +2375,8 @@ This is basically a reference to a C++ `ServerActiveObject`
23692375
* `override_day_night_ratio(ratio or nil)`
23702376
* `0`...`1`: Overrides day-night ratio, controlling sunlight to a specific amount
23712377
* `nil`: Disables override, defaulting to sunlight based on day-night cycle
2372-
* `set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, frame_speed=30)`: set animation for player model in third person view
2378+
* `set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, frame_speed=30)`:
2379+
set animation for player model in third person view
23732380
* stand/idle animation key frames
23742381
* walk animation key frames
23752382
* dig animation key frames
@@ -2484,7 +2491,8 @@ for 2D noise, and it must be must be larger than 1 for 3D noise (otherwise
24842491
with values starting at `pos={x=,y=}`
24852492
* `get3dMap(pos)`: returns a `<size.x>` times `<size.y>` times `<size.z>` 3D array
24862493
of 3D noise with values starting at `pos={x=,y=,z=}`
2487-
* `get2dMap_flat(pos)`: returns a flat `<size.x * size.y>` element array of 2D noise with values starting at `pos={x=,y=}`
2494+
* `get2dMap_flat(pos)`: returns a flat `<size.x * size.y>` element array of 2D noise
2495+
with values starting at `pos={x=,y=}`
24882496
* `get3dMap_flat(pos)`: Same as `get2dMap_flat`, but 3D noise
24892497

24902498
### `VoxelManip`
@@ -2859,7 +2867,9 @@ Definition tables
28592867
alpha = 255,
28602868
use_texture_alpha = false, -- Use texture's alpha channel
28612869
post_effect_color = {a=0, r=0, g=0, b=0}, -- If player is inside node
2862-
paramtype = "none", -- See "Nodes"
2870+
paramtype = "none", -- See "Nodes" --[[
2871+
^ paramtype = "light" allows light to propagate from or through the node with light value
2872+
^ falling by 1 per node. This line is essential for a light source node to spread its light. ]]
28632873
paramtype2 = "none", -- See "Nodes"
28642874
is_ground_content = true, -- If false, the cave generator will not carve through this
28652875
sunlight_propagates = false, -- If true, sunlight will go infinitely through this
@@ -2873,15 +2883,17 @@ Definition tables
28732883
liquid_alternative_source = "", -- Source version of flowing liquid
28742884
liquid_viscosity = 0, -- Higher viscosity = slower flow (max. 7)
28752885
liquid_renewable = true, -- Can new liquid source be created by placing two or more sources nearby?
2876-
leveled = 0, -- Block contain level in param2. value - default level, used for snow. Don't forget use "leveled" type nodebox
2886+
leveled = 0, --[[
2887+
^ Block contains level in param2. Value is default level, used for snow.
2888+
^ Don't forget to use "leveled" type nodebox. ]]
28772889
liquid_range = 8, -- number of flowing nodes around source (max. 8)
28782890
drowning = 0, -- Player will take this amount of damage if no bubbles are left
28792891
light_source = 0, -- Amount of light emitted by node
28802892
damage_per_second = 0, -- If player is inside node, this damage is caused
28812893
node_box = {type="regular"}, -- See "Node boxes"
28822894
mesh = "model",
2883-
selection_box = {type="regular"}, -- See "Node boxes"
2884-
^ If drawtype "nodebox" is used and selection_box is nil, then node_box is used
2895+
selection_box = {type="regular"}, -- See "Node boxes" --[[
2896+
^ If drawtype "nodebox" is used and selection_box is nil, then node_box is used. ]]
28852897
legacy_facedir_simple = false, -- Support maps made in and before January 2012
28862898
legacy_wallmounted = false, -- Support maps made in and before January 2012
28872899
sounds = {

0 commit comments

Comments
 (0)
Please sign in to comment.