Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
In Warzone 3.1 and above, most of the stats files are being converted to the .ini format. |
Overview
As it's name suggests, the .ini file uses the same format as Windows .ini files.
Sections
An ini file is split in to one or more named sections, where the name is always enclosed in square brackets. For example:
No Format |
---|
[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]
Properties
Each section can contain any number of name=value pairs, for example:
No Format |
---|
[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
- ...however it's more common to use camelCase format, 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:
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.
|
Comments
You can annotate ini files with comments. A comment must be on a new line starting with #, for example:
No Format |
---|
[intro] # this is a comment video = "cam1/c001.ogg" #this is another comment captions = "cam1/c001.txa" |