# Start AI
Grammar — Start AI for player player in mode mode with APM Actions Per Minute
Flags —Native
|Action
Starts the AI for a player in either campaign or melee mode, limiting the computer’s actions per minute to the specified number.
# Arguments
int
— Playerbool
[ preset::AIMode ] — Modeint
— APM
Returns — void
native void AIStart(int player, bool isCampaign, int apm);
# Related
Category: AI Advanced / Utility / Actions
- [F] —
void
— Start AI — ( AIStart ) - [F] —
void
— Accept Surrender — ( AIGoodGame ) - [F] —
void
— Init Melee AI — ( AIMeleeStart ) - [F] —
void
— Set APM — ( AISetAPM ) - [F] —
void
— Release Unit — ( AIReleaseUnit ) - [F] —
void
— Set State — ( AISetSpecificState ) - [F] —
void
— Set All States — ( AISetAllStates ) - [F] —
void
— Set Flag — ( AISetFlag ) - [F] —
void
— Set Coop Flag — ( AISetCoopFlag ) - [F] —
void
— Set Tech Flag State — ( AITechFlag ) - [F] —
void
— Set Unit Evaluation Custom Index — ( AIEvalSetCustomIndex ) - [F] —
void
— Enable/Disable AI Option For Unit — ( UnitSetAIOption ) - [F] —
void
— Set Defense Radii — ( AISetDefenseRadii )
# Examples
# mods/core.sc2mod
// L107
AIStart(player, false, DifficultyAPM(diff))
// L244
AIStart(player, true, DifficultyAPM(diff))
// L143
AIStart(player, false, DifficultyAPM(diff))
// L287
AIStart(player, true, DifficultyAPM(diff))