Other great resources: Official JS API docs, Scripting Forum
difficulty
- Aubergine
Overview
End users can choose a difficulty level for AI players in skirmish or multiplayer games on the game set-up screen:
In challenges, the difficultly level is defined in the player sections of the challenge settings file. If a particular AI player doesn't have a difficulty specified, the end-user can choose the difficulty for that player.
The difficulty global tells your script what level has been selected for the player your script is associated with. Ideally, your script should become more challenging as the difficulty level increases.
You can determine the difficultly level set for other AI players by looking at their playerData[].
Values
If you're making Challenge Games, the "Difficulty" property for a player in the .ini file should be assigned a string value as shown in the "Challenge Value" column.
Value | Icon | Description | Challenge Value |
---|---|---|---|
EASY | Mostly harmless, like a bunny rabbit. (Not a killer bunny though!)
| "Easy" | |
MEDIUM | Keep the enemy on their toes. | "Medium" | |
HARD | Be a fierce opponent. | "Hard" | |
INSANE | Take no prisoners. Cheat if you have to. Pwn the enemy. Warzone helps your AI cheat:
| "Insane" |
Availability
Requires:
- Warzone 3.1 Beta 1 and above
See also
JS API features that return difficulty setting:
- difficulty – the difficulty for your script
- playerData[] – difficulty for other scripts
Difficulty level constants: