This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:orx:config:syntax [2010/05/11 20:45 (15 years ago)] – RGB!! iarwain | en:orx:config:syntax [2023/05/15 20:19 (16 months ago)] (current) – sausage | ||
---|---|---|---|
Line 92: | Line 92: | ||
In the section ' | In the section ' | ||
+ | All values can implicitly refer to their own section using the inheritance marker ' | ||
+ | A parent can be removed when overriding a section and using no name after ' | ||
+ | |||
+ | <code ini> | ||
+ | [Object@Template] <= This section now uses ' | ||
+ | [Object@] <= This section now has removed any explicit parent but is still using the implicit default parent if defined | ||
+ | [Object@@] <= This section now has removed any parent and will not use the implicit default parent section either</ | ||
+ | |||
+ | To learn more about the default parent section, please refer to [[en/ | ||
+ | |||
+ | <code ini> | ||
+ | MyKey = @; <= The value for ' | ||
+ | MyOtherKey = @; <= Same here, the value for ' | ||
+ | |||
+ | [Object@Template] | ||
+ | MyNewKey = @; <= The value for ' | ||
+ | MyKey = @Template; <= The value for ' | ||
+ | |||
+ | MyOtherKey will also use the section inheritance and its value will be ' | ||
===== Includes ===== | ===== Includes ===== | ||
Line 113: | Line 132: | ||
Key2 = Var2; <= this will still be added to the ' | Key2 = Var2; <= this will still be added to the ' | ||
+ | |||
+ | ===== Command ===== | ||
+ | The Command module allows you to execute Orx functions from both the console and .ini files. Syntax for .ini files is specified in https:// | ||
Line 118: | Line 140: | ||
==== Basic types ==== | ==== Basic types ==== | ||
+ | |||
+ | Boolean values are expressed with literals '' | ||
+ | |||
+ | <code ini> | ||
Floating points (float) values are expressed using a decimal separator (' | Floating points (float) values are expressed using a decimal separator (' | ||
Line 142: | Line 168: | ||
==== Vector ==== | ==== Vector ==== | ||
- | Vectors are always defined using three components, separated by commas (',' | + | Vectors are always defined using **three** components, separated by commas (',' |
<code ini> | <code ini> | ||
Line 151: | Line 177: | ||
==== Random ==== | ==== Random ==== | ||
- | Whenever numerical values are used ((Ints, Floats and Vectors)), a random generated value can be obtained using the tilde character (' | + | Whenever numerical values are used ((Ints, Floats and Vectors)), a random |
<code ini> | <code ini> | ||
Line 158: | Line 184: | ||
Every time the value for a random defined key is queried in the code, a new random value between the specified boundaries will be generated. | Every time the value for a random defined key is queried in the code, a new random value between the specified boundaries will be generated. | ||
- | |||
- | |||
===== Lists ===== | ===== Lists ===== | ||
Lists of values for a single key are also supported. All the elements are separated using the pound character ('#' | Lists of values for a single key are also supported. All the elements are separated using the pound character ('#' | ||
- | <code ini>ListValue | + | <code ini>ValueList |
- | If spaces are defined around the list separators '#' | + | If spaces are defined around the list separators '#' |
+ | **NB: Spaces around the list delimiter ('#' | ||
**NB: When querying lists using the config API, please look at the functions containing the word ' | **NB: When querying lists using the config API, please look at the functions containing the word ' | ||
- | But let's visualize this with an example. =)\\ | + | But let's visualize this with examples. =)\\ |
Code | Code | ||
- | <code c> | + | <code c>orxVECTOR vMyVector; |
+ | orxConfig_GetVector(" | ||
+ | orxFLOAT fMyFloat = orxConfig_GetFloat(" | ||
INI | INI | ||
- | <code ini> | + | <code ini>MyVector = (1, 2, 3) # (4.0, 5.0, 6.0) |
+ | MyFloat = 1.0 # 2.0 # 3.0</ | ||
- | The function | + | The functions |
- | If the value was defined | + | If the values were defined using a random separator (' |
Please also note that controlled randoms using lists works also with non-numerical values. | Please also note that controlled randoms using lists works also with non-numerical values. | ||
+ | |||
+ | Lists can span multiple lines when using # at the end of the line (line ending comments are allowed).\\ | ||
+ | If you want to define an empty element at the end of a list, use ##\\ | ||
+ | |||
+ | Example: | ||
+ | <code ini>Key2 = Var1 # Var2 # | ||
+ | Var3 #; This list still continues on next line and this comment is valid. | ||
+ | | ||
+ | Key3 = Var1 # Var2 ##; This list will not span on the next line but will contain a 3rd (and last) empty element.</ |