Player (scripting): Difference between revisions
Jump to navigation
Jump to search
MarthaSimons (talk | contribs) m (Add AIPersonality) |
JYWLuca8269 (talk | contribs) m (Updated look.) |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:<span style="position: absolute; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px);">{{FULLPAGENAME}}</span>}} | |||
{{HeaderTemplate | |||
|welcome=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. | 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. | 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. | ||
{{SectionTemplate | |||
== Arguments = | |h=h3 | ||
|title=Arguments | |||
|content=}} | |||
*'''Name''' - Name of the player | *'''Name''' - Name of the player | ||
*'''Faction''' - Faction the player belongs to [ PHC | SS ] | *'''Faction''' - Faction the player belongs to [ PHC | SS ] | ||
Line 18: | Line 24: | ||
*'''StartLocation''' - Which start location the player uses. Corresponds with what you see in the skirmish lobby. | *'''StartLocation''' - Which start location the player uses. Corresponds with what you see in the skirmish lobby. | ||
{{SectionTemplate | |||
|h=h3 | |||
|title=Example | |||
|content=}} | |||
<Player Name="You" Faction="PHC" AIType="Player" Team="1" Color="7" /> | <Player Name="You" Faction="PHC" AIType="Player" Team="1" Color="7" /> | ||
<Player Name="Mac" Faction="PHC" AIType="On" Team="1" Color="1" /> | <Player Name="Mac" Faction="PHC" AIType="On" Team="1" Color="1" /> | ||
Line 30: | Line 39: | ||
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. | 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. | ||
[[Category:Modding]] |
Latest revision as of 15:37, 24 November 2020
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
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. |