# Unit XP Get Num Levels

Grammar — The number of levels in veterancyBehavior for unit
FlagsNative | Function

Returns the number of levels available for a unit

# Arguments

  • unit — Unit
  • string<gamelink::Behavior> — Veterancy Behavior

Returns — int

native int UnitXPGetNumLevels(
	unit inUnit,
	string inVeterancyBehavior,
);

Category: Unit / Attributes And Experience

# Examples

mods/starcoop/starcoop.sc2modbase.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);
        }