Address issues related to refactoring the_game
[oweals/minetest.git] / doc / lua_api.txt
index 131a63fa55f480b2ddf1df398367bbeb91aa4911..698efbe8af2d0ad98e7b8485df392ddd55ecc79c 100644 (file)
@@ -103,6 +103,7 @@ mods
 |   |-- screenshot.png
 |   |-- description.txt
 |   |-- init.lua
+|   |-- models
 |   |-- textures
 |   |   |-- modname_stuff.png
 |   |   `-- modname_something_else.png
@@ -137,6 +138,9 @@ init.lua:
   minetest.setting_get(name) and minetest.setting_getbool(name) can be used
   to read custom or existing settings at load time, if necessary.
 
+models:
+       Models for entities or meshnodes.
+
 textures, sounds, media:
   Media files (textures, sounds, whatever) that will be transferred to the
   client and will be available for use by the mod.
@@ -404,8 +408,16 @@ param2 is reserved for the engine when any of these are used:
     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
-
+  collision_box = {
+       type = "fixed",
+       fixed = {
+                       {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
+                       },
+  },
+  ^ defines list of collision boxes for the node. If empty, collision boxes
+       will be the same as nodeboxes, in case of any other nodes will be full cube
+       as in the example above.
+                       
 Nodes can also contain extra data. See "Node Metadata".
 
 Node drawtypes
@@ -430,6 +442,7 @@ Look for examples in games/minimal or games/minetest_game.
 - fencelike
 - raillike
 - nodebox -- See below. EXPERIMENTAL
+- mesh -- use models for nodes
 
 *_optional drawtypes need less rendering time if deactivated (always client side)
 
@@ -469,6 +482,12 @@ A box of a regular node would look like:
 
 type = "leveled" is same as "fixed", but y2 will be automatically set to level from param2
 
+Meshes
+-----------
+If drawtype "mesh" is used tiles should hold model materials textures.
+Only static meshes are implemented.
+For supported model formats see Irrlicht engine documentation.
+    
 Ore types
 ---------------
 These tell in what manner the ore is generated.
@@ -1246,6 +1265,12 @@ ColorString
 #RRGGBBAA
 ^ defines a color in hexadecimal format and alpha channel
 
+Named colors are also supported and are equivalent to "CSS Color Module Level 4"
+(http://dev.w3.org/csswg/css-color/#named-colors). To specify the value of the
+alpha channel, append #AA to the end of the color name (e.g. colorname#08). For
+named colors the hexadecimal string representing the alpha value must (always)
+be two hexadecimal digits.
+
 Vector helpers
 ---------------
 vector.new([x[, y, z]]) -> vector
@@ -2405,7 +2430,7 @@ Node definition (register_node)
 
     drawtype = "normal", -- See "Node drawtypes"
     visual_scale = 1.0,
-    ^ Supported for drawtypes "plantlike", "signlike", "torchlike".
+    ^ Supported for drawtypes "plantlike", "signlike", "torchlike", "mesh".
     ^ For plantlike, the image will start at the bottom of the node; for the
     ^ other drawtypes, the image will be centered on the node.
     ^ Note that positioning for "torchlike" may still change.
@@ -2439,6 +2464,7 @@ Node definition (register_node)
     light_source = 0, -- Amount of light emitted by node
     damage_per_second = 0, -- If player is inside node, this damage is caused
     node_box = {type="regular"}, -- See "Node boxes"
+    mesh = "model",
     selection_box = {type="regular"}, -- See "Node boxes"
     ^ If drawtype "nodebox" is used and selection_box is nil, then node_box is used
     legacy_facedir_simple = false, -- Support maps made in and before January 2012