|
1 | 1 | -- |
2 | | --- Custom Options Definition Table format |
| 2 | +-- Custom Options Definition Table format |
3 | 3 | -- |
4 | | --- NOTES: |
5 | | --- - using an enumerated table lets you specify the options order |
6 | | --- |
7 | | --- These keywords must be lowercase for LuaParser to read them. |
8 | | --- |
9 | | --- key: the string used in the script.txt |
10 | | --- name: the displayed name |
11 | | --- desc: the description (could be used as a tooltip) |
12 | | --- type: the option type |
13 | | --- def: the default value; |
14 | | --- min: minimum value for number options |
15 | | --- max: maximum value for number options |
16 | | --- step: quantization step, aligned to the def value |
17 | | --- maxlen: the maximum string length for string options |
18 | | --- items: array of item strings for list options |
19 | | --- scope: 'all', 'player', 'team', 'allyteam' <<< not supported yet >>> |
| 4 | +-- A detailed example of how this format works can be found |
| 5 | +-- in the spring source under: |
| 6 | +-- AI/Skirmish/NullAI/data/AIOptions.lua |
20 | 7 | -- |
21 | 8 | -------------------------------------------------------------------------------- |
22 | 9 | -------------------------------------------------------------------------------- |
23 | 10 |
|
24 | 11 | local options = { |
| 12 | + |
25 | 13 | { |
26 | | -key="maphack", |
27 | | -name="Activatd Maphack", |
28 | | -desc="does the AI use maphack to find your units?", |
29 | | -type='bool', |
30 | | -def=true, |
| 14 | +key = 'maphack', |
| 15 | +name = 'Activatd Maphack', |
| 16 | +desc = 'does the AI use maphack to find your units?', |
| 17 | +type = 'bool', |
| 18 | +def = true, |
31 | 19 | }, |
| 20 | + |
32 | 21 | { |
33 | | -key="guiactivated", |
34 | | -name="Activate GUI", |
35 | | -desc="Activates GUI. Mostly useful for developers. Make sure to play in windowed mode if this is activated!", |
36 | | -type='bool', |
37 | | -def=true, |
| 22 | +key = 'guiactivated', |
| 23 | +name = 'Activate GUI', |
| 24 | +desc = 'Activates GUI. Mostly useful for developers. Make sure to play in windowed mode if this is activated!', |
| 25 | +type = 'bool', |
| 26 | +def = true, |
38 | 27 | }, |
| 28 | + |
39 | 29 | { |
40 | | -key="debug", |
41 | | -name="Activated debug", |
42 | | -desc="Shows lots of debug info, lines, ghost units and so on, so you can see what the AI is thinking. Turn off for normal usage." |
43 | | -type='bool', |
44 | | -def=false, |
| 30 | +key = 'debug', |
| 31 | +name = 'Activated debug', |
| 32 | +desc = 'Shows lots of debug info, lines, ghost units and so on, so you can see what the AI is thinking. Turn off for normal usage.', |
| 33 | +type = 'bool', |
| 34 | +def = false, |
45 | 35 | }, |
| 36 | + |
46 | 37 | } |
47 | 38 |
|
48 | 39 | return options |
0 commit comments