# Unit Classification Check
Grammar — u is s|State Type
Flags —Native
|Function
Returns true if a unit is a specific class type.
# Arguments
unit
— Unitint
[ preset::unitState ] — State
Returns — bool
native bool UnitTestState(unit inUnit, int inState);
# Related
Category: Unit / Properties
- [F] —
string
[ gamelink::Unit ] — Unit Type Of Unit — ( UnitGetType ) - [F] —
int
— Unit Tag — ( UnitGetTag ) - [F] —
int
— Unit Seed — ( UnitGetSeed ) - [F] —
void
— Unit Property Changes — ( TriggerAddEventUnitProperty ) - [F] —
int
[ preset::Unit_Property ] — Triggering Unit Property — ( EventUnitProperty ) - [F] —
int
— Triggering Unit Property Change (Integer) — ( EventUnitPropertyChangeInt ) - [F] —
fixed
— Triggering Unit Property Change (Real) — ( EventUnitPropertyChangeFixed ) - [F] —
void
— Set Unit Property — ( UnitSetPropertyFixed ) - [F] —
void
— Set Unit State — ( UnitSetState ) - [F] —
void
— Set Unit Seed — ( UnitSetSeed ) - [F] —
void
— Reset Unit Seed — ( UnitResetSeed ) - [F] —
void
— Make Unit Invulnerable — ( libNtve_gf_MakeUnitInvulnerable ) - [F] —
void
— Make Unit Uncommandable — ( libNtve_gf_MakeUnitUncommandable ) - [F] —
fixed
— Unit Property — ( UnitGetPropertyFixed ) - [F] —
int
— Unit Property (Int) — ( UnitGetPropertyInt ) - [F] —
fixed
— Unit Type Property — ( UnitTypeGetProperty ) - [F] —
bool
— Unit Classification Check — ( UnitTestState ) - [F] —
bool
— Unit Type Classification Check — ( UnitTypeTestFlag ) - [F] —
bool
— Unit Type Attribute Check — ( UnitTypeTestAttribute ) - [F] —
bool
— Unit Targetable Check — ( UnitTestPlane ) - [F] —
bool
— Unit Is Invulnerable — ( libNtve_gf_UnitIsInvulnerable ) - [F] —
int
— Unit Kills — ( libNtve_gf_UnitGetPropertyKills ) - [F] —
int
— Unit Resources — ( libNtve_gf_UnitGetPropertyResources ) - [F] —
point
— Unit Attachment Point — ( UnitGetAttachmentPoint ) - [F] —
text
— Name Of Unit Type — ( UnitTypeGetName ) - [F] —
string
— Gender Code Of Unit Type — ( UnitTypeGetGenderCode ) - [F] —
int
— Unit Type Cost — ( UnitTypeGetCost ) - [F] —
bool
— Unit Type Is Affected By Upgrade — ( UnitTypeIsAffectedByUpgrade ) - [F] —
void
— Reset Movement Speed — ( UnitResetSpeed ) - [F] —
bool
— Unit Uses Mover — ( UnitMoverExists ) - [F] —
bool
— Unit Type Uses Mover — ( libNtve_gf_UnitMoverExists ) - [F] —
string
[ gamelink::Unit ] — Unit Type From String — ( UnitTypeFromString ) - [F] —
void
— Set Unit Color — ( UnitSetTeamColorIndex ) - [F] —
void
— Set Unit Info Button - Ability Tooltip — ( libNtve_gf_SetUnitInfoButtonAbilityTooltip ) - [F] —
void
— Set Unit Info Button - Button Tooltip — ( libNtve_gf_SetUnitInfoButtonButtonTooltip ) - [F] —
void
— Set Unit Info Button - Item Tooltip — ( libNtve_gf_SetUnitInfoButtonItemTooltip ) - [F] —
void
— Reset Unit Info Button - Ability Tooltip — ( libNtve_gf_ResetUnitInfoButtonAbilityTooltip ) - [F] —
void
— Reset Unit Info Button - Button Tooltip — ( libNtve_gf_ResetUnitInfoButtonButtonTooltip ) - [F] —
void
— Reset Unit Info Button - Item Tooltip — ( libNtve_gf_ResetUnitInfoButtonItemTooltip ) - [F] —
void
— Set Unit Command Button Tooltip — ( UnitSetInfoButtonTooltip ) - [F] —
void
— Reset Unit Command Button Tooltip — ( UnitClearInfoButtonTooltip ) - [F] —
void
— Set Unit Highlight Cursor — ( UnitSetCursor ) - [F] —
void
— Set Unit Ping Cursor — ( UnitSetPingCursor ) - [F] —
void
— Set Unit Info — ( UnitSetInfoText ) - [F] —
void
— Set Unit Info Text — ( UnitSetInfoText2 ) - [F] —
void
— Set Unit Info Tip — ( UnitSetInfoTip ) - [F] —
void
— Set Unit Info SubTip — ( UnitSetInfoSubTip ) - [F] —
void
— Clear Unit Info — ( UnitClearInfoText ) - [F] —
void
— Set Unit Status Bar State (Deprecated) — ( UnitForceStatusBar ) - [F] —
void
— Show Unit Status Bar — ( UnitStatusBarOverride ) - [F] —
void
— Hide Unit Status Bar — ( UnitStatusBarClearOverride ) - [F] —
void
— Set Unit Scale — ( UnitSetScale ) - [F] —
void
— Set Unit Model Variation — ( libNtve_gf_UnitSetVariation ) - [F] —
void
— Change Unit Height — ( UnitSetHeight ) - [F] —
fixed
— Height Of Unit — ( UnitGetHeight ) - [F] —
void
— Change Unit Damage — ( libNtve_gf_ChangeUnitDamage ) - [F] —
unit
— Add On Child — ( UnitAddOnChild ) - [F] —
unit
— Add On Parent — ( UnitAddOnParent )
# Examples
# campaigns/liberty.sc2campaign
// L849
UnitTestState(gv_boss, c_unitStateIdle)
// L1728
UnitTestState(lp_battlecruiser, c_unitStateIdle)
// L2999
UnitTestState(lp_powerup, c_unitStateIdle)
// L4909
UnitTestState(lv_interceptor, c_unitStateIdle)
// L5316
UnitTestState(gv_boss, c_unitStateIdle)
// L5319
UnitTestState(gv_boss, c_unitStateIdle)
// L5322
UnitTestState(gv_boss, c_unitStateIdle)
// L6299
UnitTestState(lv_plane, c_unitStateIdle)
// L6521
UnitTestState(lv_plane, c_unitStateIdle)
// L6642
UnitTestState(lv_plane, c_unitStateIdle)
// L2769
UnitTestState(lv_scientist, c_unitStateIdle)
// L8110
UnitTestState(gf_ActorUnit(lp_actor), c_unitStateIdle)
// L8122
UnitTestState(gf_ActorUnit(lp_actor), c_unitStateIdle)
// L10845
UnitTestState(gf_ActorUnit(lp_actor), c_unitStateHighlightable)
// L14734
UnitTestState(gv_pinboards[lv_pbIndex].lv_pinboard, c_unitStateHighlightable)
// L14830
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L21778
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L25576
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L25620
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L25664
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L25710
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L1860
UnitTestState(EventUnitDamageSourceUnit(), c_unitStateCloaked)
// L4014
UnitTestState(gv_p3Raven, c_unitStateIdle)
// L849
UnitTestState(gv_boss, c_unitStateIdle)
// L1728
UnitTestState(lp_battlecruiser, c_unitStateIdle)
// L2999
UnitTestState(lp_powerup, c_unitStateIdle)
// L4909
UnitTestState(lv_interceptor, c_unitStateIdle)
// L5316
UnitTestState(gv_boss, c_unitStateIdle)
// L5319
UnitTestState(gv_boss, c_unitStateIdle)
// L5322
UnitTestState(gv_boss, c_unitStateIdle)
// L6299
UnitTestState(lv_plane, c_unitStateIdle)
// L6521
UnitTestState(lv_plane, c_unitStateIdle)
// L6642
UnitTestState(lv_plane, c_unitStateIdle)
// L2769
UnitTestState(lv_scientist, c_unitStateIdle)
// L8110
UnitTestState(gf_ActorUnit(lp_actor), c_unitStateIdle)
// L8122
UnitTestState(gf_ActorUnit(lp_actor), c_unitStateIdle)
// L10845
UnitTestState(gf_ActorUnit(lp_actor), c_unitStateHighlightable)
// L14734
UnitTestState(gv_pinboards[lv_pbIndex].lv_pinboard, c_unitStateHighlightable)
// L14830
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L21778
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L25576
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L25620
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L25664
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L25710
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L1860
UnitTestState(EventUnitDamageSourceUnit(), c_unitStateCloaked)
// L4014
UnitTestState(gv_p3Raven, c_unitStateIdle)
// L521
UnitTestState(gv_zagara, c_unitStateStunned)
// L2596
UnitTestState(gv_zagara, c_unitStateStunned)
// L1106
UnitTestState(lp_hybrid, c_unitStateIdle)
// L3909
UnitTestState(gv_dEHAKA, c_unitStateIdle)
// L604
UnitTestState(lp_fighter, c_unitStateIdle)
// L4749
UnitTestState(gv_enemyBase, c_unitStateIdle)
// L4819
UnitTestState(EventUnit(), c_unitStateIdle)
// L579
UnitTestState(lv_indexUnit, c_unitStateIdle)
// L736
UnitTestState(lp_primal, c_unitStateIdle)
// L1756
UnitTestState(lv_indexHarvester, c_unitStateIdle)
// L4154
UnitTestState(lv_indexQuillgor, c_unitStateIdle)
// L404
UnitTestState(lp_primal, c_unitStateIdle)
// L3688
UnitTestState(auto8C6F2799_var, c_unitStateIdle)
// L517
UnitTestState(lp_target, c_unitStateStunned)
// L680
UnitTestState(lp_primal, c_unitStateIdle)
// L2921
UnitTestState(auto27257508_var, c_unitStateIdle)
// L521
UnitTestState(gv_zagara, c_unitStateStunned)
// L2596
UnitTestState(gv_zagara, c_unitStateStunned)
// L1106
UnitTestState(lp_hybrid, c_unitStateIdle)
// L3909
UnitTestState(gv_dEHAKA, c_unitStateIdle)
// L604
UnitTestState(lp_fighter, c_unitStateIdle)
// L4749
UnitTestState(gv_enemyBase, c_unitStateIdle)
// L4819
UnitTestState(EventUnit(), c_unitStateIdle)
// L579
UnitTestState(lv_indexUnit, c_unitStateIdle)
// L736
UnitTestState(lp_primal, c_unitStateIdle)
// L1756
UnitTestState(lv_indexHarvester, c_unitStateIdle)
// L4154
UnitTestState(lv_indexQuillgor, c_unitStateIdle)
// L404
UnitTestState(lp_primal, c_unitStateIdle)
// L3688
UnitTestState(auto8C6F2799_var, c_unitStateIdle)
// L517
UnitTestState(lp_target, c_unitStateStunned)
// L680
UnitTestState(lp_primal, c_unitStateIdle)
// L2921
UnitTestState(auto27257508_var, c_unitStateIdle)
# campaigns/swarmstory.sc2campaign
// L19977
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L20077
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L20139
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L20205
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L20343
UnitTestState(libSwaC_gv_zS_ArmyCustomEggRoomEvolutionMaster, c_unitStateHighlightable)
// L20608
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L20674
UnitTestState(EventUnit(), c_unitStateHighlightable)
// L20732
UnitTestState(EventUnit(), c_unitStateHighlightable)
# campaigns/void.sc2campaign
// L499
UnitTestState(lp_unit, c_unitStateUnderConstruction)
// L499
UnitTestState(lp_unit, c_unitStateUnderConstruction)
# mods/core.sc2mod
// L5307
UnitTestState(lp_u, c_unitStatePaused)
// L5313
UnitTestState(lp_u, c_unitStateSleeping)
// L5319
UnitTestState(lp_u, c_unitStateHidden)
// L5377
UnitTestState(lp_u, c_unitStateInvulnerable)
// L5728
UnitTestState(lp_u, c_unitStateInsideTransport)
// L5734
UnitTestState(lp_u, c_unitStateInsideUnitTransport)
// L5740
UnitTestState(lp_u, c_unitStateInsidePlayerTransport)
// L5771
UnitTestState(lp_u, c_unitStateUnderConstruction)
# mods/core.sc2mod
// L1268
UnitTestState(unitToCheck, c_unitStateCloaked)
// L1328
UnitTestState(unitToCheck, c_unitStateCloaked)
# mods/core.sc2mod
// L793
UnitTestState(unitToCheck, c_unitStateInsideTransport)
// L924
UnitTestState(unitToCheck, c_unitStateInsideTransport)