From eb005ab530e592b7cbe699e8962bbffaa8daeb59 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 26 Oct 2015 00:16:41 +0000 Subject: [PATCH] Update lua_api.html --- lua_api.html | 91 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 63 insertions(+), 28 deletions(-) diff --git a/lua_api.html b/lua_api.html index f5e4d64..d042d44 100644 --- a/lua_api.html +++ b/lua_api.html @@ -21,6 +21,7 @@ layout: default
  • depends.txt
  • screenshot.png
  • description.txt
  • +
  • settingtypes.txt
  • init.lua
  • models
  • textures, sounds, media
  • @@ -197,7 +198,7 @@ layout: default
  • Inventory locations
  • ColorString
  • ColorSpec
  • -
  • Vector helpers
  • +
  • Spatial Vectors
  • Helper functions
  • minetest namespace referenceThis page was last updated 25/September/2015.
    See doc/lua_api.txt for the latest version (in plaintext).
    Generated using a Python script.

    Programming in Lua

    +This page was last updated 26/October/2015.
    See doc/lua_api.txt for the latest version (in plaintext).
    Generated using a Python script.

    Programming in Lua

    If you have any difficulty in understanding this, please read Programming in Lua.

    Startup

    @@ -388,7 +389,9 @@ the init.lua scripts in a shared environment.

    name = Minetest
     

    The game directory can contain the file minetest.conf, which will be used -to set default settings when running the particular game.

    +to set default settings when running the particular game. +It can also contain a settingtypes.txt in the same format as the one in builtin. +This settingtypes.txt will be parsed by the menu and the settings will be displayed in the "Games" category in the settings tab.

    Games can provide custom main menu images. They are put inside a menu directory inside the game directory.

    The images are named $identifier.png, where $identifier is one of overlay,background,footer,header. @@ -435,6 +438,7 @@ empty, except for lines starting with #, which are comments.

    | |-- depends.txt | |-- screenshot.png | |-- description.txt +| |-- settingtypes.txt | |-- init.lua | |-- models | |-- textures @@ -458,6 +462,9 @@ is missing, that does not prevent this mod from being loaded.

    A screenshot shown in modmanager within mainmenu.

    description.txt

    A File containing description to be shown within mainmenu.

    +

    settingtypes.txt

    +

    A file in the same format as the one in builtin. It will be parsed by the +settings menu and the settings will be displayed in the "Mods" category.

    init.lua

    The main Lua script. Running this script should register everything it wants to register. Subsequent execution depends on minetest calling the @@ -642,13 +649,13 @@ from the available ones of the following files:

    { pos = {x=1,y=2,z=3}, gain = 1.0, -- default - max_hear_distance = 32, -- default + max_hear_distance = 32, -- default, uses an euclidean metric } -- Play connected to an object, looped { object = <an ObjectRef>, gain = 1.0, -- default - max_hear_distance = 32, -- default + max_hear_distance = 32, -- default, uses an euclidean metric loop = true, -- only sounds connected to objects can be looped } @@ -812,6 +819,10 @@ paramtype2 == "facedir" 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" +paramtype2 == "degrotate" +^ The rotation of this node is stored in param2. Plants are rotated this way. + Values range 0 - 179. The value stored in param2 is multiplied by two to + get the actual rotation of the node. collision_box = { type = "fixed", fixed = { @@ -1008,14 +1019,13 @@ attribute set, puff ore generation will instead generate the absolute difference noise displacement values. This flag has no effect for ore types other than puff.

    Decoration types

    The varying types of decorations that can be placed.

    -

    The default value is simple, and is currently the only type supported.

    simple

    Creates a 1 times H times 1 column of a specified node (or a random node from a list, if a decoration list is specified). Can specify a certain node it must spawn next to, such as water or lava, for example. Can also generate a decoration of random height between a specified lower and upper bound. This type of decoration is intended for placement of grass, flowers, cacti, -papyri, and so on.

    +papyri, waterlilies and so on.

    schematic

    Copies a box of MapNodes from a specified schematic file (or raw description). Can specify a probability of a node randomly appearing when placed. @@ -1046,8 +1056,8 @@ in the form of a table. This table specifies the following fields:

    placed on the map.

    Schematic attributes

    See section "Flag Specifier Format".

    -

    Currently supported flags: place_center_x, place_center_y, - place_center_z, force_placement.

    +

    Currently supported flags: place_center_x, place_center_y, place_center_z, + force_placement.