Most of the information here is for Warzone 3.1 and above.
.ini file format
- Aubergine
Overview
As it's name suggests, the .ini file uses the same format as Windows .ini files.
While earlier versions of Warzone had some ini files (for example, Challenge Games), the ini format became much more widely adopted in the 3.x branch and as of version 3.2 almost all game config ("stats") have been converted to use the ini format (more info).
Sections
An ini file is split in to one or more named sections, where the name is always enclosed in square brackets. For example:
[campaign] name = "Alpha Campaign" level = "CAM_1A" [intro] video = "cam1/c001.ogg" captions = "cam1/c001.txa"
In the example above, there are two sections: campaign and intro.
Notes:
- Each section must have a unique name
- Section names are usually in lowercase
- Section names should start with a letter of the alphabet
- Section names can include numbers and underscores, eg. [foo_bar123]
- It's common to put a blank line between sections to make the file easier to read for humans.
Properties
Each section can contain any number of name=value pairs, for example:
[intro] video = "cam1/c001.ogg" captions = "cam1/c001.txa"
In the example above, there are two named properties: video and captions
Notes:
- Name value pairs must be within a section
- Each name must be unique within the section
- Whitespace within each line is ignored
- Avoid blank lines between name value pairs
- Property names are usually in lower case
- Property names should start with a letter of the alphabet
- Property names can include numbers and underscores, eg. foo_bar123
- ...although it's more common to use camelCase for properties, eg. fooBar123
Data types
The value of each property should follow some conventions depending on it's data type.
Data type | Example |
---|---|
Boolean | A true value should be depicted as: A false value should be depicted as: # example [boolean_values] thisIsTrue = 1 thisIsFalse = 0 Some older ini files used values such as "true" and "false" or "yes" and "no". It was decided to standardise on 1 and 0. |
String | String values must be quoted. # example [string_values] thisIsAString = "string value" |
Filename | Same as a string, but without quotes. # example [filename_values] thisIsAFilename = towerDefence.js Always check documentation to see if a filename requires a path or extension. For example, in <mapname>.ini the path and extension are not required for the [map].file property, but an extension and optionally a path is required for [scripts].rules and [scripts].extra properties. |
Number | Numerical values should be specified without quotes. # example [number_values] thisIsANumber = 42 |
Comments
You can annotate ini files with comments. A comment must be on a new line starting with #, for example:
[intro] # this is a comment video = "cam1/c001.ogg" #this is another comment captions = "cam1/c001.txa"
Availability 3.1+
Requires:
- Warzone 3.1 or above
- Probably also used in earlier versions (please comment if you know)
Contents
Jump to: