# Get State
Grammar — Gets the current value of the state at index index for player player
Flags —Native
|Function
Gets the current value of the specified state index for a player. The state is a per player integer array that can be useful to AI scripting.
# Arguments
int
— Playerint
— Index
Returns — int
native int AIState(int player, int index);
# Related
Category: AI Advanced / Utility / Functions
- [F] —
bool
— Is Point In Shrub — ( InShrub ) - [F] —
bool
— Is Campaign AI — ( AIIsCampaign ) - [F] —
unit
— Grab Unit — ( AIGrabUnit ) - [F] —
int
— Get State — ( AIState ) - [F] —
bool
— Get Flag — ( AIGetFlag ) - [F] —
bool
— Get Coop Flag — ( AIGetCoopFlag ) - [F] —
bool
— Unit Has AI Option — ( UnitGetAIOption ) - [F] —
bool
— Wants To Surrender — ( AIGivingUp ) - [F] —
int
— AI Pathing Cost Map — ( AIPathingCostMap ) - [F] —
int
— AI Pathing Cost Unit — ( AIPathingCostUnit ) - [F] —
point
— AI Self Reinforce Point — ( AISelfReinforceDropPoint )
# Examples
# mods/core.sc2mod
// L188
AIState(player, e_attackState)
// L204
AIState(player, e_mainState)
// L205
AIState(player, e_mainSubState)
# mods/core.sc2mod
// L134
AIState(player, e_attackState)
// L157
AIState(player, e_attackState)
# mods/core.sc2mod
// L113
AIState(player, e_mainState)
// L159
AIState(player, e_attackState)
// L165
AIState(player, e_attackState)
# mods/core.sc2mod
// L157
AIState(player, e_attackState)
// L396
AIState(player, e_attackState)
// L421
AIState(player, e_attackState)
// L512
AIState(player, e_attackState)
// L630
AIState(player, e_attackState)
// L686
AIState(player, e_attackState)
// L785
AIState(player, e_attackState)
# mods/liberty.sc2mod
// L77
AIState(player, e_mainState)
// L78
AIState(player, e_mainSubState)
// L79
AIState(player, e_attackState)
// L237
AIState(player, e_mainState)
# mods/liberty.sc2mod
// L771
AIState(player, e_mainSubState)
// L775
AIState(player, e_mainSubState)
// L786
AIState(player, e_mainSubState)
// L790
AIState(player, e_mainSubState)
// L801
AIState(player, e_mainSubState)
// L805
AIState(player, e_mainSubState)
# mods/liberty.sc2mod
// L1067
AIState(player, e_mainSubState)
// L1071
AIState(player, e_mainSubState)
// L1082
AIState(player, e_mainSubState)
// L1086
AIState(player, e_mainSubState)
// L1097
AIState(player, e_mainSubState)
// L1101
AIState(player, e_mainSubState)
# mods/liberty.sc2mod
// L575
AIState(player, e_mainState)
// L613
AIState(player, e_mainSubState)
// L643
AIState(player, e_mainState)
// L681
AIState(player, e_mainSubState)
// L711
AIState(player, e_mainState)
// L749
AIState(player, e_mainSubState)
// L811
AIState(player, e_attackState)
# mods/liberty.sc2mod
// L993
AIState(player, e_mainSubState)
// L997
AIState(player, e_mainSubState)
// L1008
AIState(player, e_mainSubState)
// L1012
AIState(player, e_mainSubState)
// L1023
AIState(player, e_mainSubState)
// L1027
AIState(player, e_mainSubState)
# mods/liberty.sc2mod
// L884
AIState(player, e_mainSubState)
// L888
AIState(player, e_mainSubState)
// L899
AIState(player, e_mainSubState)
// L903
AIState(player, e_mainSubState)
// L914
AIState(player, e_mainSubState)
// L918
AIState(player, e_mainSubState)
# mods/liberty.sc2mod
// L719
AIState(player, e_mainSubState)
// L723
AIState(player, e_mainSubState)
// L734
AIState(player, e_mainSubState)
// L738
AIState(player, e_mainSubState)
// L749
AIState(player, e_mainSubState)
// L753
AIState(player, e_mainSubState)
# mods/liberty.sc2mod
// L77
AIState(player, e_mainState)
// L78
AIState(player, e_mainSubState)
// L79
AIState(player, e_attackState)
// L263
AIState(player, e_mainState)
# mods/liberty.sc2mod
// L758
AIState(player, e_mainSubState)
// L762
AIState(player, e_mainSubState)
// L773
AIState(player, e_mainSubState)
// L777
AIState(player, e_mainSubState)
// L788
AIState(player, e_mainSubState)
// L792
AIState(player, e_mainSubState)
# mods/liberty.sc2mod
// L1224
AIState(player, e_mainSubState)
// L1228
AIState(player, e_mainSubState)
// L1239
AIState(player, e_mainSubState)
// L1243
AIState(player, e_mainSubState)
// L1254
AIState(player, e_mainSubState)
// L1258
AIState(player, e_mainSubState)
# mods/liberty.sc2mod
// L607
AIState(player, e_mainState)
// L645
AIState(player, e_mainSubState)
// L675
AIState(player, e_mainState)
// L713
AIState(player, e_mainSubState)
// L743
AIState(player, e_mainState)
// L781
AIState(player, e_mainSubState)
// L843
AIState(player, e_attackState)
# mods/liberty.sc2mod
// L1166
AIState(player, e_mainSubState)
// L1170
AIState(player, e_mainSubState)
// L1181
AIState(player, e_mainSubState)
// L1185
AIState(player, e_mainSubState)
// L1196
AIState(player, e_mainSubState)
// L1200
AIState(player, e_mainSubState)
# mods/liberty.sc2mod
// L981
AIState(player, e_mainSubState)
// L985
AIState(player, e_mainSubState)
// L996
AIState(player, e_mainSubState)
// L1000
AIState(player, e_mainSubState)
// L1011
AIState(player, e_mainSubState)
// L1015
AIState(player, e_mainSubState)
# mods/liberty.sc2mod
// L701
AIState(player, e_mainSubState)
// L705
AIState(player, e_mainSubState)
// L716
AIState(player, e_mainSubState)
// L720
AIState(player, e_mainSubState)
// L731
AIState(player, e_mainSubState)
// L735
AIState(player, e_mainSubState)
# mods/liberty.sc2mod
// L77
AIState(player, e_mainState)
// L78
AIState(player, e_mainSubState)
// L79
AIState(player, e_attackState)