Most of the information here is for Warzone 3.1 and above.
<challenge>.ini 3.1
- Aubergine
Challenge .ini files
An .ini file located in the challenges/
folder defines all the game, map and player settings for the challenge. The files use the standard .ini file format.
There are three types of section in the ini file:
- [challenge] – map selection, description, alliance mode, etc.
- [player_N] – settings for player #N in the game, there must be one of these for each player
- [scripts] – customise game rules and/or load additional scripts during the game
In the property tables below, String values must be "enclosed in quotes" unless specified otherwise.
[challenge] section
This section only appears once in the file, and is usually placed at the top of the file.
Property | Type | Mandatory | Notes | Related Documentation | Warzone Version |
---|---|---|---|---|---|
Name | String | The human-readable name of your challenge, keep it short as there is limited screen space on the Challenges menu. For example: | 3.1 | ||
Difficulty | String | How difficult is your challenge to the average gamer?
Note: This is not related to the AI difficulty, it's just a guide for users as to how hard the challenge is. In Warzone 2.x, difficulty was expressed as a number, probably between 1 and 100 (or 0 and 99). The values shown above are for Warzone 3.1 and above. |
| 3.1 | |
Map | String | The map filename, but without path or extension. Case sensitive. Example: | 3.1 | ||
MaxPlayers | Number | Must be the same number as the number of player slots (excluding Scavenger faction) on the Map. So if you're using a 4 player map, MaxPlayers would be 4 (even if you don't plan to fill all the slots). Scripts can refer to maxPlayers and playerData[] globals to get information about the players. | 3.1 | ||
Scavengers | Boolean | Should the Scavenger faction be enabled?
Default: If the property is not defined, players can choose whether to include scavengers or not. Note: The map must contain pre-placed Scavenger objects if you want to use Scavengers. See Adding Scavengers to Maps for more information. | 3.1 | ||
Bases | Number | What base type should be set for the game?
Default: Allow player to decide while setting up the game. See Player Initialisation for full details of the effects of base types. | 3.1 | ||
Power | Number | The rate at which power is generated by oil derricks, which must be one of the following:
Default: Allow player to decide while setting up the game. Note: Not the same as starting power, which is determined by the base type (Bases) setting during Player Initialisation. | 3.1 | ||
Description | String | A sentence that describes what the challenge is about. For example: Default: No description. It's shown in a tooltip when the user hovers their mouse over the map name on the Challenges menu. | 3.1 | ||
AllowPositionChange | Boolean | Should the player be allowed to choose which position they start in?
Default: | 3.1 |
[player_N] sections
There must be one of these sections for each player. For example, if MaxPlayers is 2, you'd need both [player_1] and [player_2] sections in your ini file. If a player section is missing, the associated player slot is disabled.
Confusingly, these sections are one-referenced. In the JS API player IDs and start positions are zero-referenced. So, [player_1] in the ini file relates to player 0 in the JS API.
Note: The human player is always defined in the [player_1] section (and will be player 0 if referenced from a script).
Within each section, the following properties are defined:
Property | Type | Mandatory | Notes | Related Documentation | Warzone Version |
---|---|---|---|---|---|
name | String | The name of the player as they will appear on the Challenge set-up screen, in-game chat and intel screen. Example: Default: | 3.1 | ||
team | Number | Which team is the player in? Give more than one player the same team to create an alliance between those players. Teams are zero-referenced, so 0 = Team A, 1 = Team B, etc. If the "team" property is not specified, the player slot is disabled. | playerData[] | 3.1 | |
difficulty | String | Set the difficulty level for the player.
Default: | 3.1 | ||
position | Number | Which map starting position should this player be in? Position slots in the .ini file are one-referenced, so this should be a number between 1 and MaxPlayers (inclusive). If not specified, defaults to 1 for the human player. Note that in your scripts, the position slots are zero-referenced. So position 1 in the .ini file is equivalent to position 0 in your script. | 3.1 | ||
ai | Filename | Which AI bot will control this player? This is not an .ai file, it is the filename (without path or extension) of the .js file containing your AI. Example: Default: No AI associated with player. Warzone will search the If you do not want an AI to be associated with the player, you can specify Human players should not have an "ai" property, obviously. If you want to override the script (rules.js) associated with humans, use the "rules" property in the [scripts] section (see below). | 3.1 |
[scripts] section
This section should only appear once in the ini file, and only if needed.
Property | Type | Mandatory | Notes | Related Documentation | Warzone Version |
---|---|---|---|---|---|
rules | Filename | Specify custom game rules for your challenge using this property. Example: If specified, the standard rules.js will not be loaded. Instead, the specified script will be run in the context of the human player ([player_1]). Like the "ai" property in [player_N] sections, this should just be a filename and Warzone will search the | 3.1 | ||
extra | Filename | Allows you to run an additional script (linked to the human player) during the game. For example, you could use the script to define missions or send in reinforcements. In Warzone 3.2, where the JS API can interact with chat messages, you could even use the "extra" script to provide custom chat commands or status reports. | Scripting (JS & WZScript) | 3.1 |
Availability 3.1.X
Requires:
- Warzone 3.1 branch
The format is expected to change in Warzone 3.2, but this 3.1 format will be retained for backwards-compatibility.
Contents
Jump to:
File location
The challenges bundled with Warzone can be found here:
mp.wz or mp
challenges
*.ini
If you want to define a challenge in your mod, its .ini file should be here:
<your mod>.wz or <your mod>
challenges
<filename>.ini
<filename>.js
The .ini file should have a unique name (otherwise it might overwrite or be overwritten by an existing challenge).
The .js files are optional and can be incorporated either via the "ai" property in [player_N] and/or [scripts] section of your .ini file.
See also
If you're using Javascript for your AIs, see:
- Javascript API – reference to all JS API features
If you're using older WZscript for your AIs, see:
- AI Tutorial - an introduction to creating a WZscript AI
- Scripting Manual – full WZscript manual
You should also be familiar with:
- Player Initialisation – how all players, human and AI, are initialised at the start of a game