Difference between revisions of "settingtypes.txt"

From Minetest Developer Wiki
Jump to navigation Jump to search
(replace deprecated call, point out that the settings API does not use type_args)
 
Line 2: Line 2:
 
The settingtypes.txt file contains mod settings displayed in the settings menu. They are not used for the settings API in Lua or in C++; in particular, the Lua API will return '''nil''' if the setting is not defined in the configuration, regardless of the default value set in this file.
 
The settingtypes.txt file contains mod settings displayed in the settings menu. They are not used for the settings API in Lua or in C++; in particular, the Lua API will return '''nil''' if the setting is not defined in the configuration, regardless of the default value set in this file.
  
Settings can be accessed with the [[Settings]]:getXXX family of methods.
+
For information about the settingtypes.txt format, see [https://github.com/minetest/minetest/blob/master/builtin/settingtypes.txt#L1 builtin settingtypes.txt].
 
 
== General format ==
 
 
 
<source>name (Readable name) type type_args</source>
 
 
 
Note that the parts are separated by exactly one space
 
 
 
'''type''' can be:
 
* int
 
* string
 
* bool
 
* float
 
* enum
 
* path
 
* filepath
 
* key (will be ignored in GUI, since a special key change dialog exists)
 
* flags
 
* noise_params_2d
 
* noise_params_3d
 
* v3f
 
 
 
'''type_args''' can be:  
 
 
 
''int'':
 
 
 
* default
 
* default min max
 
''string'':
 
 
 
* default (if default is not specified then "" is set)
 
''bool'':
 
 
 
* default
 
''float'':
 
 
 
* default
 
* default min max
 
''enum'':
 
 
 
* default value1,value2,...  
 
''path'':
 
 
 
* default (if default is not specified then "" is set)
 
''filepath'':
 
 
 
* default (if default is not specified then "" is set)
 
''key'':
 
 
 
* default
 
''flags'':
 
 
 
Flags are always separated by comma without spaces.  
 
* default possible_flags
 
''noise_params_2d'':
 
 
 
Format is <offset>, <scale>, (<spreadX>, <spreadY>, <spreadZ>), <seed>, <octaves>, <persistance>, <lacunarity>[, <default flags>]
 
* default
 
''noise_params_3d'':
 
 
 
Format is <offset>, <scale>, (<spreadX>, <spreadY>, <spreadZ>), <seed>, <octaves>, <persistance>, <lacunarity>[, <default flags>]
 
* default
 
''v3f'':
 
 
 
Format is (<X>, <Y>, <Z>)
 
* default
 

Latest revision as of 20:51, 24 October 2022

Mbox warning.png This page contains unofficial, low-quality Lua API documentation and is likely to be outdated or wrong. Do not rely on it!
For the official and up-to-date documentation, see Lua API Documentation.
Mbox warning.png This page has been proposed for deletion for the following reason: "Contains unofficial and potentially outdated, redundant and inconsistent Lua API information"
If you don't think that this page should be deleted, please explain why on the talk page.

The settingtypes.txt file contains mod settings displayed in the settings menu. They are not used for the settings API in Lua or in C++; in particular, the Lua API will return nil if the setting is not defined in the configuration, regardless of the default value set in this file.

For information about the settingtypes.txt format, see builtin settingtypes.txt.