Player (scripting)
To do much of anything, you'll need to define players in the XML file for your scenario. This is done with individual <Player> tags that enable or disable their AI, sets faction, team, and color, etc.
You'll likely refer to these players later in the script by number, where 0 is the first player defined, 1 is the next, and so on.
Arguments
- Name - Name of the player
- Faction - Faction the player belongs to [ PHC | SS ]
- Team - What team the player belongs to
- Color - What is the team color for the player [ 1-14 ]
- AIType - Set to “Player” if this is player controlled. "On" for AI control, "Off" for passive [ On | Off | Player ]
- AIDifficulty - What setting this AI player is on [ Beginner | Novice | Easy | Intermediate | Normal | Challenging | Tough | Painful | Insane ]
- AIPersonality - What Personality the AI player is. [options in DefaultPlayerAI.xml, random when not set]
- NoSeed - Set this to 1 to disable a Nexus for the player. Note: Doing this will mean you need to manually set victory/loss triggers, as the generic Seed Victory condition won't trigger.
- NoEngineer - Set this to 1 if the player isn’t going to start with an Engineer.
- StartLocation - Which start location the player uses. Corresponds with what you see in the skirmish lobby.
Example
<Player Name="You" Faction="PHC" AIType="Player" Team="1" Color="7" /> <Player Name="Mac" Faction="PHC" AIType="On" Team="1" Color="1" /> <Player Name="Haalee" Faction="SS" AIType="On" Team="2" Color="2" /> <Player Name="Splinter" Faction="PHC" AIType="Off" Team="3" Color="4" NoSeed="1" NoEngineer="1" />
In this example, the player is index 0, Mac 1, Haalee 2, and Splinter 3.
The player and Mac are on a team together, while Haalee and the Splinter are each on their own teams.
The Splinter has its AI turned off, either to create passive guardians or script-controlled incoming waves, or some such thing where you don't want an AI messing with your scenario.