# Set All States
Grammar — Sets all states for player player to state state
Flags —Native
|Action
Sets the value of the state indexes for a player. The state is a per player integer array that can be useful to AI scripting.
# Arguments
int
— Playerint
— State
Returns — void
native void AISetAllStates(int player, int state);
# Related
Category: AI Advanced / Utility / Actions
- Start AI —
void
— AIStart - Accept Surrender —
void
— AIGoodGame - Init Melee AI —
void
— AIMeleeStart - Set APM —
void
— AISetAPM - Release Unit —
void
— AIReleaseUnit - Set State —
void
— AISetSpecificState - Set All States —
void
— AISetAllStates - Set Flag —
void
— AISetFlag - Set Coop Flag —
void
— AISetCoopFlag - Set Tech Flag State —
void
— AITechFlag - Set Unit Evaluation Custom Index —
void
— AIEvalSetCustomIndex - Enable/Disable AI Option For Unit —
void
— UnitSetAIOption - Set Defense Radii —
void
— AISetDefenseRadii
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/BaseAI.galaxy:164
AISetMainTown(player, c_townOne);
AIHarvest(player, c_townOne);
AISetAllStates(player, 1);
targDPoint = AIWaveTargetGatherDPoint(player, c_townMain);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/BaseAI.galaxy:199
AISetMainTown(player, c_townOne);
AIHarvest(player, c_townOne);
AISetAllStates(player, 1);
targDPoint = AIWaveTargetGatherDPoint(player, c_townMain);