-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinfo.nut
More file actions
387 lines (352 loc) · 15.5 KB
/
Copy pathinfo.nut
File metadata and controls
387 lines (352 loc) · 15.5 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
/*
* This file is part of Renewed Village Growth, a GameScript for OpenTTD.
* Credits Firrel (original Renewed Village Growth), keoz (Renewed City Growth), Sylf (City Growth Limiter)
*
* It's free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the
* Free Software Foundation, version 2 of the License.
*
*/
require("src/version.nut");
class MainClass extends GSInfo
{
function GetAuthor() { return "AngriestBird"; }
function GetName() { return "Expanded Village Growth + Economics"; }
function GetShortName() { return "EVGE"; }
function GetDescription() { return "Towns require various cargo deliveries to grow. Required cargos can be randomized. Town growth is limited by percentage of transported specific cargos. Supporting most Industry NewGRF sets."; }
function GetURL() { return "https://angriestbird.github.io/expanded-village-growth-economics/"; }
function GetVersion() { return SELF_VERSION; }
function GetDate() { return SELF_DATE; }
function GetAPIVersion() { return "14"; }
function MinVersionToLoad() { return SELF_MINLOADVERSION; }
function CreateInstance() { return "MainClass"; }
function GetSettings() {
AddSetting({ name = "town_info_mode",
description = "Town info display mode",
easy_value = 1,
medium_value = 1,
hard_value = 1,
custom_value = 1,
flags = CONFIG_INGAME, min_value = 1, max_value = 5 });
AddLabels("town_info_mode", {
_1 = "Automatic",
_2 = "Category deliveries",
_3 = "Cargo list",
_4 = "Combined",
_5 = "Full cargo list" });
AddSetting({ name = "goal_scale_factor",
description = "Difficulty level (easy = 60, normal = 100, hard = 140)",
easy_value = 60,
medium_value = 100,
hard_value = 140,
custom_value = 100,
flags = CONFIG_INGAME, min_value = 1, max_value = 50000, step_size = 20 });
AddSetting({ name = "use_town_sign",
description = "Show growth rate text under town names",
easy_value = 1,
medium_value = 1,
hard_value = 1,
custom_value = 1,
flags = CONFIG_BOOLEAN | CONFIG_INGAME });
AddSetting({ name = "eternal_love",
description = "Eternal love from towns",
easy_value = 1,
medium_value = 3,
hard_value = 0,
custom_value = 0,
flags = CONFIG_INGAME, min_value = 0, max_value = 3 });
AddLabels("eternal_love", { _0 = "Off",
_1 = "Outstanding",
_2 = "Good",
_3 = "Poor" });
AddSetting({
name = "cargo_6_category",
description = "Cargo: Use 6 cargo categories for supported economies",
easy_value = 1,
medium_value = 1,
hard_value = 1,
custom_value = 1,
flags = CONFIG_BOOLEAN | CONFIG_INGAME });
// Values map 1:1 to the Economies enum in cargo.nut; the last value forces generated categories
AddSetting({ name = "force_economy",
description = "Cargo: Force economy (instead of auto detection)",
easy_value = 0,
medium_value = 0,
hard_value = 0,
custom_value = 0,
flags = CONFIG_INGAME, min_value = 0, max_value = 49 });
AddLabels("force_economy", {
_0 = "Auto detect",
_1 = "Base Temperate",
_2 = "Base Arctic",
_3 = "Base Tropical",
_4 = "Base Toyland",
_5 = "FIRS 1 FIRS",
_6 = "FIRS 1 Temperate",
_7 = "FIRS 1 Arctic",
_8 = "FIRS 1 Tropic",
_9 = "FIRS 1 Hearth Of Darkness",
_10 = "ECS",
_11 = "FIRS 2 Temperate",
_12 = "FIRS 2 Arctic",
_13 = "FIRS 2 Tropic",
_14 = "FIRS 2 In A Hot Country",
_15 = "FIRS 2 Extreme",
_16 = "YETI",
_17 = "FIRS 3 Temperate",
_18 = "FIRS 3 Arctic",
_19 = "FIRS 3 Tropic",
_20 = "FIRS 3 Steeltown",
_21 = "FIRS 3 In A Hot Country",
_22 = "FIRS 3 Extreme",
_23 = "NAIS North America",
_24 = "Improved Town Industries",
_25 = "FIRS 4 Temperate",
_26 = "FIRS 4 Arctic",
_27 = "FIRS 4 Tropic",
_28 = "FIRS 4 Steeltown",
_29 = "FIRS 4 In A Hot Country",
_30 = "FIRS 5 Temperate",
_31 = "FIRS 5 Arctic",
_32 = "FIRS 5 Tropic",
_33 = "FIRS 5 Steeltown",
_34 = "FIRS 5 In A Hot Country",
_35 = "FIRS Forked: Oil Town",
_36 = "XIS The Lot",
_37 = "AXIS Steel City",
_38 = "AXIS Tropical Paradise",
_39 = "AXIS Extreme Classic",
_40 = "OTIS",
_41 = "Industries of the Caribbean",
_42 = "Lumberjack Industries",
_43 = "Wannaroo Basic Industries",
_44 = "Improved Town Industries 2",
_45 = "Real Industries",
_46 = "Minimalist Industries",
_47 = "Pikka's Industries Redux Set (PIRS 2022)",
_48 = "DefaultIndustriesPlus Temperate",
_49 = "Generated categories" });
AddSetting({ name = "cargo_randomization",
description = "Randomization: Type",
easy_value = 1,
medium_value = 7,
hard_value = 10,
custom_value = 10,
flags = CONFIG_INGAME, min_value = 1, max_value = 15 });
AddLabels("cargo_randomization", {
_1 = "None",
_2 = "Industry descending",
_3 = "Industry ascending",
_4 = "1 per category",
_5 = "2 per category",
_6 = "3 per category",
_7 = "5 per category",
_8 = "7 per category",
_9 = "1-2 per category",
_10 = "1-3 per category",
_11 = "2-3 per category",
_12 = "3-5 per category",
_13 = "3-7 per category",
_14 = "Descending",
_15 = "Ascending" });
AddSetting({ name = "near_cargo_probability",
description = "Randomization: Probability to use nearby cargo types [%]",
easy_value = 100,
medium_value = 50,
hard_value = 0,
custom_value = 50,
flags = CONFIG_INGAME, min_value = 0, max_value = 100, step_size = 10});
AddSetting({ name = "display_cargo",
description = "Randomization: Show town cargos from start",
easy_value = 1,
medium_value = 0,
hard_value = 0,
custom_value = 0,
flags = CONFIG_BOOLEAN | CONFIG_INGAME});
AddSetting({ name = "raw_industry_density",
description = "Industry stabilizer: Raw industry density",
easy_value = 0,
medium_value = 0,
hard_value = 0,
custom_value = 0,
flags = CONFIG_INGAME, min_value = 0, max_value = 5});
AddLabels("raw_industry_density", {
_0 = "Funding only",
_1 = "Minimal",
_2 = "Very Low",
_3 = "Low",
_4 = "Normal",
_5 = "High" });
AddSetting({
name = "limit_min_transport",
description = "Limit Growth: Minimum percentage of transported cargo from town",
easy_value = 40,
medium_value = 50,
hard_value = 65,
custom_value = 50,
flags = CONFIG_INGAME, min_value = 0, max_value = 100, step_size = 5});
AddSetting({
name = "town_size_threshold",
description = "Limit Growth: Minimum size of town before the limit rules kicks in",
easy_value = 800,
medium_value = 550,
hard_value = 350,
custom_value = 350,
flags = CONFIG_INGAME, min_value = 0, max_value = 50000, step_size = 25});
AddSetting({
name = "town_monitoring_timeout",
description = "Monitoring: Keep towns active for this many days without pick-up (0 = never)",
easy_value = 365,
medium_value = 365,
hard_value = 365,
custom_value = 365,
flags = CONFIG_INGAME, min_value = 0, max_value = 3650, step_size = 5});
AddSetting({
name = "limiter_delay",
description = "Limit Growth: Stop growth after set amount of months",
easy_value = 3,
medium_value = 1,
hard_value = 0,
custom_value = 1,
flags = CONFIG_INGAME, min_value = 0, max_value = 12, step_size = 1});
AddSetting({
name = "subsidies_type",
description = "Subsidies: Create subsidies for contributed towns",
easy_value = 1,
medium_value = 1,
hard_value = 1,
custom_value = 1,
flags = CONFIG_INGAME, min_value = 0, max_value = 3});
AddLabels("subsidies_type", {
_0 = "None",
_1 = "All",
_2 = "Passenger",
_3 = "Cargo"});
AddSetting({
name = "tax_enable",
description = "Taxes: Charge companies a monthly infrastructure tax",
easy_value = 0,
medium_value = 0,
hard_value = 0,
custom_value = 0,
flags = CONFIG_BOOLEAN | CONFIG_INGAME});
AddSetting({
name = "tax_rate",
description = "Taxes: Rate per rail/road infrastructure piece",
easy_value = 2,
medium_value = 3,
hard_value = 5,
custom_value = 3,
flags = CONFIG_INGAME, min_value = 0, max_value = 1000, step_size = 1});
AddSetting({
name = "tax_dock_rate",
description = "Taxes: Rate per dock station",
easy_value = 2,
medium_value = 3,
hard_value = 5,
custom_value = 3,
flags = CONFIG_INGAME, min_value = 0, max_value = 1000, step_size = 1});
AddSetting({
name = "tax_airport_rate",
description = "Taxes: Rate per airport station",
easy_value = 2,
medium_value = 3,
hard_value = 5,
custom_value = 3,
flags = CONFIG_INGAME, min_value = 0, max_value = 1000, step_size = 1});
AddSetting({
name = "tax_canal_rate",
description = "Taxes: Rate per canal infrastructure piece",
easy_value = 2,
medium_value = 3,
hard_value = 5,
custom_value = 3,
flags = CONFIG_INGAME, min_value = 0, max_value = 1000, step_size = 1});
AddSetting({
name = "tax_big_town_bonus",
description = "Taxes: Extra percentage per contributed town over 500 population",
easy_value = 5,
medium_value = 5,
hard_value = 10,
custom_value = 5,
flags = CONFIG_INGAME, min_value = 0, max_value = 100, step_size = 1});
AddSetting({
name = "tax_rating_discount",
description = "Taxes: Max rating-based discount from contributed towns",
easy_value = 30,
medium_value = 30,
hard_value = 30,
custom_value = 30,
flags = CONFIG_INGAME, min_value = 0, max_value = 100, step_size = 1});
AddSetting({
name = "tax_growth_rebate",
description = "Taxes: Rebate per population your towns gained last month",
easy_value = 0,
medium_value = 0,
hard_value = 0,
custom_value = 0,
flags = CONFIG_INGAME, min_value = 0, max_value = 1000, step_size = 1});
AddSetting({
name = "tax_growth_boost",
description = "Taxes: Days of town growth per 1000 tax per contributed town",
easy_value = 0,
medium_value = 0,
hard_value = 0,
custom_value = 0,
flags = CONFIG_INGAME, min_value = 0, max_value = 1000, step_size = 1});
for (local i = 1; i <= 6; i++) {
AddSetting({
name = "category_" + i + "_min_pop",
description = "Category " + i + ": Minimum population demand (-1 = default)",
easy_value = -1,
medium_value = -1,
hard_value = -1,
custom_value = -1,
flags = CONFIG_INGAME, min_value = -1, max_value = 100000, step_size = 100});
}
AddSetting({ name = "town_growth_factor",
description = "Expert: town growth factor",
easy_value = 50,
medium_value = 100,
hard_value = 200,
custom_value = 100,
flags = CONFIG_INGAME, min_value = 20, max_value = 50000, step_size = 20 });
AddSetting({ name = "supply_impacting_part",
description = "Expert: minimum fulfilled percentage for TGR growth",
easy_value = 30,
medium_value = 50,
hard_value = 70,
custom_value = 50,
flags = CONFIG_INGAME, min_value = 0, max_value = 100, step_size = 5 });
AddSetting({ name = "exponentiality_factor",
description = "Expert: TGR growth exponentiality factor",
easy_value = 3,
medium_value = 3,
hard_value = 3,
custom_value = 3,
flags = CONFIG_INGAME, min_value = 1, max_value = 5 });
AddSetting({ name = "lowest_town_growth_rate",
description = "Expert: slowest TGR if requirements are not met",
easy_value = 365,
medium_value = 550,
hard_value = 880,
custom_value = 550,
flags = CONFIG_INGAME, min_value = 0, max_value = 880, step_size = 10 });
AddSetting({ name = "allow_0_days_growth",
description = "Expert: allow 0 days growth",
easy_value = 0,
medium_value = 0,
hard_value = 0,
custom_value = 0,
flags = CONFIG_BOOLEAN | CONFIG_INGAME});
AddSetting({ name = "log_level",
description = "Debug: Log level (higher = print more)",
easy_value = 1,
medium_value = 1,
hard_value = 1,
custom_value = 1,
flags = CONFIG_INGAME, min_value = 1, max_value = 3 });
AddLabels("log_level", { _1 = "1: Info", _2 = "2: Cargo", _3 = "3: Debug" });
}
}
RegisterGS(MainClass());