# Unit XP Get Num Levels
Grammar — The number of levels in veterancyBehavior for unit
Flags —Native
|Function
Returns the number of levels available for a unit
# Arguments
unit
— Unitstring
<gamelink::Behavior> — Veterancy Behavior
Returns — int
native int UnitXPGetNumLevels(
unit inUnit,
string inVeterancyBehavior,
);
# Related
Category: Unit / Attributes And Experience
- Unit Gains Experience —
void
— TriggerAddEventUnitGainExperience - Unit Gains Experience Level —
void
— TriggerAddEventUnitGainLevel - Unit XP Get Current XP —
fixed
— UnitXPGetCurrentXP - Unit XP Add XP —
void
— UnitXPAddXP - Unit XP Set Current XP —
void
— UnitXPSetCurrentXP - Unit XP Get XP For Level —
int
— UnitXPGetXPForLevel - Unit XP Set XP For Level —
void
— UnitXPSetXPForLevel - Unit XP Get Current Level —
int
— UnitXPGetCurrentLevel - Unit XP Set Current Level —
void
— UnitXPSetCurrentLevel - Unit XP Get Num Levels —
int
— UnitXPGetNumLevels - Triggering Experience Gained —
fixed
— EventUnitXPDelta - Unit Attribute Change —
void
— TriggerAddEventUnitAttributeChange - Triggering Attribute Points —
int
— EventUnitAttributePoints - Total Experience Of Unit —
fixed
— UnitXPTotal - Experience Level Of Unit —
int
— UnitLevel - Enable/Disable Experience Gain For Unit —
void
— UnitXPGainEnable
# Examples
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:5389
lv_veteran = UnitGroupUnitFromEnd(autoED740C17_g, autoED740C17_u);
if (lv_veteran == null) { break; }
if ((UnitXPGetCurrentLevel(lv_veteran, null) >= UnitXPGetNumLevels(lv_veteran, null))) {
lv_maxedsupply += UnitGetPropertyFixed(lv_veteran, c_unitPropSuppliesUsed, c_unitPropNormal);
}