source: branches/BAR/engineoptions.lua @ 5877

Revision 3397, 3.6 KB checked in by Bluestone, 5 years ago (diff)

merge ba into bar

Line 
1--  Custom Options Definition Table format
2
3--  NOTES:
4--  - using an enumerated table lets you specify the options order
5
6--
7--  These keywords must be lowercase for LuaParser to read them.
8--
9--  key:      the string used in the script.txt, must be lower case
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:    'global', 'player', 'team', 'allyteam'
20--
21
22--------------------------------------------------------------------------------
23--------------------------------------------------------------------------------
24--
25--  Example EngineOptions.lua
26--
27
28local options =
29{
30  {
31    key="bar_others",
32    name="BAR - Other Settings",
33    name="BAR - Other Settings",
34    type="section",
35  },
36 
37  {
38    key    = 'MaxUnits',
39    name   = 'Max units',
40    desc   = 'Maximum number of units (including buildings) for each team allowed at the same time',
41    type   = 'number',
42    def    = 500,
43    min    = 1,
44    max    = 10000, --- engine caps at lower limit if more than 3 team are ingame
45    step   = 1,  -- quantization is aligned to the def value, (step <= 0) means that there is no quantization
46    section= "bar_options",
47
48  },
49  {
50    key     = "pathfinder",
51    name    = "Pathfinder",
52    desc    = "Switch Pathfinding System",
53    type    = "list",
54    def     = "normal",
55    section = "bar_others",
56        items={
57          {key="normal", name="Normal", desc="Spring vanilla pathfinder"},
58          {key="qtpfs", name="QuadTree", desc="Experimental quadtree based pathfinder"},
59        },
60  },
61  {
62    key    = "startmetal",
63    name   = "Starting metal",
64    desc   = "Determines amount of metal and metal storage that each player will start with",
65    type   = "number",
66    section= "StartingResources",
67    def    = 1000,
68    min    = 0,
69    max    = 10000,
70    step   = 1,
71  },
72  {
73    key    = "startenergy",
74    name   = "Starting energy",
75    desc   = "Determines amount of energy and energy storage that each player will start with",
76    type   = "number",
77    section= "StartingResources",
78    def    = 1000,
79    min    = 0,
80    max    = 10000,
81    step   = 1,
82  }, 
83  {
84    key    = 'LimitSpeed',
85    name   = 'Speed Restriction',
86    desc   = 'Limits maximum and minimum speed that the players will be allowed to change to',
87    type   = 'section',
88  },
89  {
90    key    = 'MaxSpeed',
91    name   = 'Maximum game speed',
92    desc   = 'Sets the maximum speed that the players will be allowed to change to',
93    type   = 'number',
94    section= 'LimitSpeed',
95    def    = 3,
96    min    = 0.1,
97    max    = 100,
98    step   = 0.1,
99
100  },
101
102  {
103    key    = 'MinSpeed',
104    name   = 'Minimum game speed',
105    desc   = 'Sets the minimum speed that the players will be allowed to change to',
106    type   = 'number',
107    section= 'LimitSpeed',
108    def    = 0.3,
109    min    = 0.1,
110    max    = 100,
111    step   = 0.1, 
112  },
113  {
114    key    = 'DisableMapDamage',
115    name   = 'Undeformable map',
116    desc   = 'Prevents the map shape from being changed by weapons',
117    type   = 'bool',
118    def    = false,
119    section= "bar_options",
120
121  },
122--[[
123-- the following options can create problems and were never used by interface programs, thus are commented out for the moment
124
125  {
126    key    = 'NoHelperAIs',
127    name   = 'Disable helper AIs',
128    desc   = 'Disables luaui ai usage for all players',
129    type   = 'bool',
130    def    = false,
131  },
132--]]
133}
134
135return options
Note: See TracBrowser for help on using the repository browser.