(info) Most of the information here is for Warzone 3.1 and above.

<challenge>.ini 3.1

The ini file format used to define a Challenge game...

 

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.

PropertyTypeMandatoryNotesRelated DocumentationWarzone Version
NameString(tick)

The human-readable name of your challenge, keep it short as there is limited screen space on the Challenges menu.

For example: "Hide behind me"

 3.1
DifficultyString(tick)

How difficult is your challenge to the average gamer?

  • "Easy"
  • "Medium"
  • "Hard"
  • "Insane"

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

MapString(tick)

The map filename, but without path or extension. Case sensitive.

Example: "Sk-MizaMaze"

mapName

Map

mapWidth

mapHeight

3.1

MaxPlayersNumber(tick)

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.

maxPlayers

Players & Alliances

playerData[]

3.1
ScavengersBoolean(error)

Should the Scavenger faction be enabled?

  • true – yes, enable Scavengers
  • false – disable Scavengers

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.

scavengers

scavengerPlayer

Scavenger faction

Adding Scavengers to Maps

3.1
BasesNumber(error)

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.

baseType

Player Initialisation

3.1
PowerNumber(error)

The rate at which power is generated by oil derricks, which must be one of the following:

  • 400 – low output
  • 700 – medium output
  • 1000 – high output

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.

powerType

derrickPositions[]

RESOURCE_ EXTRACTOR

POWER_GEN

setPower()

playerPower()

3.1
DescriptionString(error)

A sentence that describes what the challenge is about.

For example: "Stay behind your AI allies and beat the enemy in close quarters, man-to-man combat."

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
AllowPositionChangeBoolean(error)

Should the player be allowed to choose which position they start in?

  • true – yes, player can change their start position on the map
  • false – no, player position is locked

Default: false

playerData[]

Player object

startPositions[]

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:

PropertyTypeMandatoryNotesRelated DocumentationWarzone Version
nameString(error)

The name of the player as they will appear on the Challenge set-up screen, in-game chat and intel screen.

Example: "Bob Hoskins"

Default: "Nexus"

playerData[]

Player object

3.1
teamNumber(tick)

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.

(warning) If the "team" property is not specified, the player slot is disabled.

playerData[]

Player object

Faction, Team & Player Colours

Players & Alliances

3.1
difficultyString(error)

Set the difficulty level for the player.

  • "Easy"
  • "Medium"
  • "Hard"
  • "Insane"

Default: "Medium"

difficulty

Players & Alliances

playerData[]

Player object

PLAYER_DATA

3.1
positionNumber(error)

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.

playerData[]

Player object

startPositions[]

3.1
aiFilename(error)

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: semperfi.js

Default: No AI associated with player.

Warzone will search the challenges/ folder first, and if it can't find the script there it will then search multiplay/skirmish/ folder. This is useful because if you want an AI that's only available in challenge games, and not skirmish or multiplayer games, you can put it in the challenges/ folder.

If you do not want an AI to be associated with the player, you can specify null or simply omit the "ai" property. For example, you might have a ready-built base but don't want it to do anything other than have its automated defence structures firing at enemies.

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).

Scripting (JS & WZScript)

3.1

[scripts] section

This section should only appear once in the ini file, and only if needed.

PropertyTypeMandatoryNotesRelated DocumentationWarzone Version
rulesFilename(error)

Specify custom game rules for your challenge using this property.

Example: towerdefence.js

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 challenges/ folder first, and if it can't find the script there it will then search multiplay/skirmish/ folder.

Game Rules & SitRep

rules.js

Player Initialisation

Scripting (JS & WZScript)

3.1
extraFilename(error)

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
Thanks to Per for providing this info in the forums.
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:

If you're using older WZscript for your AIs, see:

You should also be familiar with: