summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorMuhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>2017-09-10 00:49:12 +0700
committerparamat <mat.gregory@virginmedia.com>2017-10-23 01:28:13 +0100
commita1e1a19ac355dbe7e1a2e060fd6b5fe082298eb6 (patch)
tree871e3058638547b7936a30f661042235110da9b2 /doc/lua_api.txt
parentc60abb2aeccba2920d55a518fcffd2ad57f9f59a (diff)
downloadminetest-a1e1a19ac355dbe7e1a2e060fd6b5fe082298eb6.tar.gz
minetest-a1e1a19ac355dbe7e1a2e060fd6b5fe082298eb6.tar.bz2
minetest-a1e1a19ac355dbe7e1a2e060fd6b5fe082298eb6.zip
Improvements/fixes for noise parameter input in advanced settings
Formspec input for each individual noise parameter and flag. Allow noise flags to be set in advanced settings, previously only settable in minetest.conf. Standardise 'group format' for noise parameters set in minetest.conf, as only these support noise flags. However the older 'single line' format is still accepted to support existing minetest.conf files. Therefore auto-generate minetest.conf.example with noise parameters in 'group format'. Setting 'type' in settingtypes.txt is now either 'noise_params_2D' or 'noise_params_3D', the dimension number is displayed in the advanced settings edit page.
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt14
1 files changed, 9 insertions, 5 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 726c23af6..9e3895d83 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1043,13 +1043,13 @@ Accumulates the absolute value of each noise gradient result.
Noise parameters format example for 2D or 3D perlin noise or perlin noise maps:
np_terrain = {
- offset = 0,
- scale = 1,
- spread = {x=500, y=500, z=500},
+ offset = "0",
+ scale = "1",
+ spread = {x="500", y="500", z="500"},
seed = 571347,
octaves = 5,
- persist = 0.63,
- lacunarity = 2.0,
+ persist = "0.63",
+ lacunarity = "2.0",
flags = "defaults, absvalue"
}
^ A single noise parameter table can be used to get 2D or 3D noise,
@@ -4024,12 +4024,16 @@ It can be created via `Settings(filename)`.
#### Methods
* `get(key)`: returns a value
* `get_bool(key)`: returns a boolean
+* `get_np_group(key)`: returns a NoiseParams table
* `set(key, value)`
* Setting names can't contain whitespace or any of `="{}#`.
* Setting values can't contain the sequence `\n"""`.
* Setting names starting with "secure." can't be set on the main settings object (`minetest.settings`).
* `set_bool(key, value)`
* See documentation for set() above.
+* `set_np_group(key, value)`
+ * `value` is a NoiseParams table.
+ * Also, see documentation for set() above.
* `remove(key)`: returns a boolean (`true` for success)
* `get_names()`: returns `{key1,...}`
* `write()`: returns a boolean (`true` for success)