A constant representing the difficulty level selected for your script.
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.