# Unit Tag
Grammar — Unit tag of u
Flags —Native
|Function
A unit’s tag is a unique integer associated with that unit. The tag will never change and will never be associated with a different unit.
# Arguments
unit
— Unit
Returns — int
native int UnitGetTag(unit inUnit);
# 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/swarm.sc2campaign
// L464
UnitGetTag(lp_escort)
// L470
UnitGetTag(lp_shuttle)
// L731
UnitGetTag(lp_escort)
// L732
UnitGetTag(lp_escort)
// L733
UnitGetTag(UnitGroupUnit(lp_shuttles, 1))
// L2336
UnitGetTag(EventUnitTargetUnit())
// L2362
UnitGetTag(EventUnitTargetUnit())
// L464
UnitGetTag(lp_escort)
// L470
UnitGetTag(lp_shuttle)
// L731
UnitGetTag(lp_escort)
// L732
UnitGetTag(lp_escort)
// L733
UnitGetTag(UnitGroupUnit(lp_shuttles, 1))
// L2336
UnitGetTag(EventUnitTargetUnit())
// L2362
UnitGetTag(EventUnitTargetUnit())
# campaigns/voidstory.sc2campaign
// L4340
UnitGetTag(lp_unit)
// L4555
UnitGetTag(lp_unit)
// L4589
UnitGetTag(lp_unit)
// L4811
UnitGetTag(lp_unit)
// L4842
UnitGetTag(lp_unit)
# mods/heroesdata.stormmod
// L20097
UnitGetTag(libGame_gv_townTownData[lv_townIndex].lv_structureUnits[lv_structureIndex])
// L20114
UnitGetTag(auto2636383B_var)
# mods/heroesdata.stormmod
// L3312
UnitGetTag(lp_unit)
# mods/heroesmapmods/battlegroundmapmods/alteracpass.stormmod
// L2653
UnitGetTag(lv_defenderUnit)
# mods/heroesmapmods/battlegroundmapmods/hauntedmines.stormmod
// L255
UnitGetTag(lp_unit)
# mods/missionpacks/campaigncommon.sc2mod
// L352
UnitGetTag(lp_unit)
// L382
UnitGetTag(lp_unit)
# mods/starcoop/starcoop.sc2mod
// L25453
UnitGetTag(lv_u)
// L25457
UnitGetTag(lv_u)
// L25497
UnitGetTag(lv_u)
// L25498
UnitGetTag(lv_u)
# mods/starcoop/starcoop.sc2mod
// L2777
UnitGetTag(lp_gift)
// L2831
UnitGetTag(lp_gift)
// L6644
UnitGetTag(lv_indexResource)
// L6648
UnitGetTag(lv_indexResource)
// L6652
UnitGetTag(lv_indexResource)
// L6656
UnitGetTag(lv_indexResource)
// L6660
UnitGetTag(lv_indexResource)
// L9033
UnitGetTag(lv_indexResource)
// L13503
UnitGetTag(lv_indexGift)
# mods/starcoop/starcoop.sc2mod
// L3421
UnitGetTag(lp_unit)
// L3636
UnitGetTag(lp_unit)
// L3670
UnitGetTag(lp_unit)
// L3935
UnitGetTag(lp_unit)
// L3949
UnitGetTag(lp_unit)
// L3963
UnitGetTag(lp_unit)
// L3994
UnitGetTag(lp_unit)
# mods/swarm.sc2mod
// L145
UnitGetTag(lp_unit)