This file can be used to specify custom parameters that players can set for this scenario before starting it. Intended usages include difficulty or map size settings.
Names and descriptions can be localized the same way scripts can using $id$ strings and corresponding string table entries.
At the moment, parameters can only be set in the lobby of network games.
Any number of sections [ParameterDef]
Wert Datentyp Beschreibung Standardwert
Name Zeichenkette Label put in front of this parameter.
Beschreibung Zeichenkette Description for setting used as tool tip on the control.
ID Zeichenkette Identifier for this parameter. Should be a valid identifier containing only letters, numbers and underscores and should not begin with a number. The script engine prefixes this name with SCENPAR_ and uses it to register the picked value as a constant before game initialization.
Typ Zeichenkette Data type of parameter. At the moment, only Enumeration is supported. Enumeration
Default Integer Value of default option that is chosen if the user does not select anything. 0
LeagueValue Integer If nonzero, the parameter will be forced to this vlaue in league games. 0
Achievement Zeichenkette If set to an achievement ID, this parameter is hidden in the selection dialogue and only used to track player achievements for this scenario. See section below.
Each parameter of type Enumeration should be followed by subordinate section [Options], which contains several subordinate sections [Option]. Subordinate sections need to be indented further than their parent section.
Any number of sections [Option]
Wert Datentyp Beschreibung Standardwert
Name Zeichenkette Label used in dropdown menu for this option.
Beschreibung Zeichenkette Description for element in dropdown menu for this option. Currently not shown.
Wert Integer Value that is assigned to the script constant if this option is picked. Each option within one parameter definition should have a unique value. 0


Scenario achievements are special parameter definitions for which the values are stored per player and per scenario. These parameters cannot be set maually, but can only be gained in game using the GainScenarioAchievement function. Each achievement that has been gained is represented by a small image beside the scenario title in the scenario selection dialogue.
Achievements need to be defined as parameter definition with the Achievement value set in the [ParameterDef] section. The value corresponds to the icon file name formatted as Achv*.png, where * is replaced by the achievement name. The icon may either be placed in the scenario or - if multiple scenarios share the same icon - in the global Graphics.ocg file. Icons are square with the height determining the dimensions.
By using achievement values higher than one, multiple stages of an achievement may be defined e.g. for finishing a scenario on different difficulties. The achievement value denotes the 1-based index in the icon file with multiple icons arranged from left to right.
If several players are activated while the scenario selection dialogue is opened, the player with the highest achievement value is considered for each achievement.


Example ParameterDef.txt file for a difficulty setting in a scenario that controls the amount of meteorites:

The names and descriptions are localized strings which can be set for English in a StringTblUS.txt:
DescDifficulty=Conrols the amount of meteorites
DescEasy=Very few meteorites
DescHard=Lots of meteorites
AchvEasy=Finished on easy.
AchvHard=Finished on hard.
Finally, the Script.c file of the scenario should contain code to evaluate the setting and give an achievement accordingly:
func Initialize()
	// Meteorite amount depending on difficulty setting

func OnGoalsFulfilled()
	GainScenarioAchievement("Done", BoundBy(SCENPAR_Difficulty, 1, 3)); // 1 for easy, 3 for hard
	return false;
Sven2, 2014-09