# Set All States

Grammar — Sets all states for player player to state state
FlagsNative | 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 — Player
  • int — State

Returns — void

native void AISetAllStates(int player, int state);

Category: AI Advanced / Utility / Actions

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:164

    AISetMainTown(player, c_townOne);
    AIHarvest(player, c_townOne);
    AISetAllStates(player, 1);
    
    targDPoint = AIWaveTargetGatherDPoint(player, c_townMain);

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:199

    AISetMainTown(player, c_townOne);
    AIHarvest(player, c_townOne);
    AISetAllStates(player, 1);
    
    targDPoint = AIWaveTargetGatherDPoint(player, c_townMain);