# Set Unit Property
Grammar — Set u prop to val
Flags —Native
|Action
Sets a unit’s property.
# Arguments
unit
— Unitint
[ preset::Unit_Property2 ] — Propertyfixed
— Value
Returns — void
native void UnitSetPropertyFixed(
unit inUnit,
int inProp,
fixed inVal,
);
# 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
// L719
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L728
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L917
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L248
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L265
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L283
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L300
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L319
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L338
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L353
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L369
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L390
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L1716
UnitSetPropertyFixed(gv_pylon01, c_unitPropLifePercent, 100.0)
// L170
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L182
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L194
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L337
UnitSetPropertyFixed(UnitFromId(1), c_unitPropLifeMax, 1000.0)
// L338
UnitSetPropertyFixed(UnitFromId(1), c_unitPropLifePercent, 100.0)
// L736
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropLifeMax, 1000.0)
// L737
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropLifePercent, 100.0)
// L766
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L1662
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L1828
UnitSetPropertyFixed(UnitFromId(1), c_unitPropLifePercent, 100.0)
// L2177
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropResources, 1500.0)
// L2452
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropResources, 1500.0)
// L287
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L307
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L322
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L338
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L354
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L1538
UnitSetPropertyFixed(gv_supplyDepot01, c_unitPropLifePercent, 100.0)
// L1539
UnitSetPropertyFixed(gv_supplyDepot02, c_unitPropLifePercent, 100.0)
// L1540
UnitSetPropertyFixed(gv_supplyDepot03, c_unitPropLifePercent, 100.0)
// L699
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L709
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L902
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L302
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L336
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L352
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L368
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L384
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L1625
UnitSetPropertyFixed(gv_spire01, c_unitPropLifePercent, 100.0)
// L1626
UnitSetPropertyFixed(gv_spire02, c_unitPropLifePercent, 100.0)
// L1627
UnitSetPropertyFixed(gv_spire03, c_unitPropLifePercent, 100.0)
// L688
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L697
UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergyPercent, 100.0)
// L2640
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropHeight, -2.0)
// L2704
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropHeight, 0.0)
// L2708
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropHeight, 0.0)
// L2728
UnitSetPropertyFixed(lp_unit, c_unitPropHeight, gv_c_PlaneHeight)
// L5412
UnitSetPropertyFixed(gv_boss, c_unitPropMovementSpeed, 30.0)
// L5429
UnitSetPropertyFixed(gv_boss, c_unitPropMovementSpeed, UnitGetPropertyFixed(gv_boss, c_unitPropMovementSpeed, c_unitPropNormal))
// L6290
UnitSetPropertyFixed(lv_plane, c_unitPropMovementSpeed, 3.5)
// L6310
UnitSetPropertyFixed(lv_plane, c_unitPropMovementSpeed, lv_oldSpeed)
// L6421
UnitSetPropertyFixed(lv_plane, c_unitPropMovementSpeed, lv_speed)
// L6530
UnitSetPropertyFixed(lv_plane, c_unitPropMovementSpeed, lv_speed)
// L310
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropMovementSpeed, gv_convoyMovementSpeed)
// L685
UnitSetPropertyFixed(UnitFromId(1774), c_unitPropLifePercent, 42.0)
// L686
UnitSetPropertyFixed(UnitFromId(2097), c_unitPropLifePercent, 34.0)
// L687
UnitSetPropertyFixed(UnitFromId(1774), c_unitPropLifePercent, 27.0)
// L688
UnitSetPropertyFixed(UnitFromId(2119), c_unitPropLifePercent, 63.0)
// L689
UnitSetPropertyFixed(UnitFromId(2103), c_unitPropLifePercent, 25.0)
// L690
UnitSetPropertyFixed(UnitFromId(2097), c_unitPropLifePercent, 35.0)
// L691
UnitSetPropertyFixed(UnitFromId(2064), c_unitPropLifePercent, 53.0)
// L692
UnitSetPropertyFixed(UnitFromId(2002), c_unitPropLifePercent, 12.0)
// L693
UnitSetPropertyFixed(UnitFromId(482), c_unitPropLifePercent, 18.0)
// L616
UnitSetPropertyFixed(UnitFromId(17), c_unitPropLife, 100.0)
// L617
UnitSetPropertyFixed(UnitFromId(17), c_unitPropLifeMax, 100.0)
// L618
UnitSetPropertyFixed(UnitFromId(20), c_unitPropLife, 100.0)
// L619
UnitSetPropertyFixed(UnitFromId(20), c_unitPropLifeMax, 100.0)
// L620
UnitSetPropertyFixed(UnitFromId(16), c_unitPropLife, 100.0)
// L621
UnitSetPropertyFixed(UnitFromId(16), c_unitPropLifeMax, 100.0)
// L622
UnitSetPropertyFixed(UnitFromId(18), c_unitPropLife, 100.0)
// L623
UnitSetPropertyFixed(UnitFromId(18), c_unitPropLifeMax, 100.0)
// L630
UnitSetPropertyFixed(auto97A1CCEC_var, c_unitPropEnergyPercent, 100.0)
// L639
UnitSetPropertyFixed(autoC2C40852_var, c_unitPropEnergyPercent, 100.0)
// L615
UnitSetPropertyFixed(gv_purifier, c_unitPropEnergyPercent, 100.0)
// L616
UnitSetPropertyFixed(gv_purifier, c_unitPropMovementSpeed, 0.35)
// L676
UnitSetPropertyFixed(auto9A549C26_var, c_unitPropMovementSpeed, 0.0)
// L683
UnitSetPropertyFixed(autoBB0D8226_var, c_unitPropMovementSpeed, 0.0)
// L690
UnitSetPropertyFixed(autoDFBE53DC_var, c_unitPropMovementSpeed, 0.0)
// L855
UnitSetPropertyFixed(gv_purifier, c_unitPropLifeMax, gv_pURIFIER_MAX_LIFE)
// L856
UnitSetPropertyFixed(gv_purifier, c_unitPropLifePercent, 100.0)
// L857
UnitSetPropertyFixed(gv_purifier, c_unitPropShieldsMax, 0.0)
// L864
UnitSetPropertyFixed(auto8AE73090_var, c_unitPropLifeMax, gv_cOLONIST_SHIP_MAX_LIFE)
// L865
UnitSetPropertyFixed(auto8AE73090_var, c_unitPropLifePercent, 100.0)
// L277
UnitSetPropertyFixed(lp_unit, c_unitPropLifeMax, lp_maxLife)
// L278
UnitSetPropertyFixed(lp_unit, c_unitPropLifePercent, 100.0)
// L1034
UnitSetPropertyFixed(UnitFromId(163), c_unitPropEnergy, 50.0)
// L2354
UnitSetPropertyFixed(autoF8E238DB_var, c_unitPropMovementSpeed, 2.5)
// L757
UnitSetPropertyFixed(auto582274C1_var, c_unitPropEnergy, UnitGetPropertyFixed(auto582274C1_var, c_unitPropEnergyMax, c_unitPropNormal))
// L1923
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropMovementSpeed, (UnitTypeGetProperty("TarsonisEngine", c_unitPropMovementSpeed) * gv_trainList[lv_trainsToSpawn[lv_i]].lv_speedMultiplier))
// L1924
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropLifeMax, gv_trainList[lv_trainsToSpawn[lv_i]].lv_maxLife)
// L2059
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L4555
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L4640
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0)
// L563
UnitSetPropertyFixed(UnitFromId(1226), c_unitPropEnergyPercent, 100.0)
// L1075
UnitSetPropertyFixed(EventUnit(), c_unitPropEnergy, 50.0)
// L5193
UnitSetPropertyFixed(autoA9A837E3_var, c_unitPropMovementSpeed, 2.25)
// L5689
UnitSetPropertyFixed(UnitFromId(95), c_unitPropLifePercent, 40.0)