-
Notifications
You must be signed in to change notification settings - Fork 2
/
ModOptions.lua
138 lines (124 loc) · 3.81 KB
/
ModOptions.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
-- $Id: ModOptions.lua 4642 2009-05-22 05:32:36Z carrepairer $
-- Custom Options Definition Table format
-- NOTES:
-- - using an enumerated table lets you specify the options order
--
-- These keywords must be lowercase for LuaParser to read them.
--
-- key: the string used in the script.txt
-- name: the displayed name
-- desc: the description (could be used as a tooltip)
-- type: the option type ('list','string','number','bool')
-- def: the default value
-- min: minimum value for number options
-- max: maximum value for number options
-- step: quantization step, aligned to the def value
-- maxlen: the maximum string length for string options
-- items: array of item strings for list options
-- section: so lobbies can order options in categories/panels
-- scope: 'all', 'player', 'team', 'allyteam' <<< not supported yet >>>
--
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--
-- Example ModOptions.lua
--
local options = {
-- do deployment and tactics even work?
{
key = 'gamemode',
name = 'Game Mode Configuration',
desc = 'Configure game settings.',
type = 'section',
},
{
key = 'waterlevel',
name = 'Water Level',
desc = 'Adjusts the water level of the map',
type = 'number',
section= 'mapsettings',
def = 0,
min = -2000,
max = 2000,
step = 1,
},
{
key = 'MetalMult',
name = 'Metal Extraction Multiplier',
desc = 'Multiplies metal extraction rate. For use in large team games when there are fewer mexes per player.',
type = 'number',
section= 'mapsettings',
def = 1,
min = 0,
max = 100,
step = 0.05, -- quantization is aligned to the def value
-- (step <= 0) means that there is no quantization
},
{
key = 'EnergyMult',
name = 'Energy Production Multiplier',
desc = 'Useful for speed games without relying on map units.',
type = 'number',
section= 'mapsettings',
def = 1,
min = 0,
max = 100,
step = 0.05, -- quantization is aligned to the def value
-- (step <= 0) means that there is no quantization
},
{
key = 'minwind',
name = 'Minimum Wind',
desc = 'Minimum wind strength. Entering a negative value will use map\'s default.',
type = 'number',
section= 'mapsettings',
def = 0,
min = -0.1,
max = 20,
step = 0.1, -- quantization is aligned to the def value
-- (step <= 0) means that there is no quantization
},
{
key = 'maxwind',
name = 'Maximum Wind',
desc = 'Maximum wind strength. Entering a negative value will use map\'s default.',
type = 'number',
section= 'mapsettings',
def = 2.5,
min = -0.1,
max = 20,
step = 0.1, -- quantization is aligned to the def value
-- (step <= 0) means that there is no quantization
},
{
key = "pathfinder",
name = "Pathfinder type",
desc = "Sets the pathfinding system used by units.",
type = "list",
def = "standard",
section = "experimental",
items = {
{
key = 'standard',
name = 'Standard',
desc = 'Standard pathfinder',
},
{
key = 'qtpfs',
name = 'QTPFS',
desc = 'New Quadtree Pathfinding System (experimental)',
},
-- {
-- key = 'classic',
-- name = 'Classic',
-- desc = 'An older pathfinding system without turninplace or reverse',
-- }
},
},
}
--// add key-name to the description (so you can easier manage modoptions in springie)
for i=1,#options do
local opt = options[i]
opt.desc = opt.desc .. '\nkey: ' .. opt.key
end
return options