View Issue Details

IDProjectCategoryView StatusLast Update
0001586Spring engineLuapublic2016-02-13 17:15
ReporterMelTraX Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionnot fixable 
Product Version0.80.2.0 
Summary0001586: add default values to GetModOptions()
DescriptionIf I understand the current behavior correctly, Spring.GetModOptions() returns the [modoptions] section of script.txt without any changes.

If a modopion isn't set at all in script.txt, its default value is used. That value is not included in GetModOptions() in that case though.

So if you want to know the value in a widget, you either have to hardcode the default value in the widget (bad if the default in modoptions.lua changes) or you have to read modoptions.lua yourself to find the default.

While the engine would also have to read modoptions.lua to find the default, it's probably less work because it already has functions to do so and it would only be needed once per game and not once per widget.
TagsNo tags attached.
Checked infolog.txt for Errors

Activities

tvo

2009-08-29 21:16

reporter   ~0004021

> While the engine would also have to read modoptions.lua to find the default, it's probably less work because it already has functions to do so and it would only be needed once per game and not once per widget.

The complicating factor here is that this isn't true: the engine does not read modoptions.lua at all currently; all code dealing with *options.lua is in unitsync.

hoijui

2009-10-07 19:49

reporter   ~0004185

so the solution is to instruct lobby defs to always write all options to script.txt, even if they are on the default?

Kloot

2016-02-13 17:15

developer   ~0015764

yes

Issue History

Date Modified Username Field Change
2009-08-25 13:13 MelTraX New Issue
2009-08-29 21:16 tvo Note Added: 0004021
2009-10-07 19:49 hoijui Note Added: 0004185
2016-02-13 17:15 Kloot Note Added: 0015764
2016-02-13 17:15 Kloot Status new => closed
2016-02-13 17:15 Kloot Resolution open => not fixable