# Unit XP Get Current XP

Grammar — The current xp in veterancyBehavior for unit
FlagsNative | Function

Returns the current xp of a unit

# Arguments

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

Returns — fixed

native fixed UnitXPGetCurrentXP(
	unit inUnit,
	string inVeterancyBehavior,
);

Category: Unit / Attributes And Experience

# Examples

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/HeroesLib.galaxy:2095

    lv_deadHeroWholeLevel = UnitXPGetCurrentLevel(libGame_gv_players[UnitGetOwner(lp_deadHero)].lv_heroUnit, "HeroDummyVeterancy");
    lv_experienceLevelBaseXP = libCore_gf_GetTotalXPForLevel(lv_deadHeroWholeLevel);
    lv_experienceLevelTotalXP = UnitXPGetCurrentXP(libGame_gv_players[UnitGetOwner(lp_deadHero)].lv_heroUnit, "HeroDummyVeterancy");
    lv_experienceLevelBase1XP = (lv_deadHeroWholeLevel + 1);
    lv_xPMath = (libCore_gf_GetTotalXPForLevel(lv_experienceLevelBase1XP) - lv_experienceLevelBaseXP);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/HeroesLib.galaxy:2111

    lv_playerHeroWholeLevel = UnitXPGetCurrentLevel(libGame_gv_players[UnitGetOwner(lp_playerHero)].lv_heroUnit, "HeroDummyVeterancy");
    lv_experienceLevelBaseXP = libCore_gf_GetTotalXPForLevel(lv_playerHeroWholeLevel);
    lv_experienceLevelTotalXP = UnitXPGetCurrentXP(libGame_gv_players[UnitGetOwner(lp_playerHero)].lv_heroUnit, "HeroDummyVeterancy");
    lv_experienceLevelBase1XP = (lv_playerHeroWholeLevel + 1);
    lv_xPMath = (libCore_gf_GetTotalXPForLevel(lv_experienceLevelBase1XP) - lv_experienceLevelBaseXP);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/MapMechanicsLib.galaxy:1758

        PlayerGroupAdd(lv_creditGroup, UnitGetOwner(lv_itUnit));
    }
    lv_grantedXP = UnitXPGetCurrentXP(libMapM_gv_jungleCreepCamps[lp_camp].lv_campOwnershipFlagUnit, null);
    lv_grantedXP += libMapM_gv_dataJungleCampDefenderData[(libMapM_gv_jungleCreepCamps[lp_camp].lv_mapDataCampDefenderType)].lv_xPAwardForCapture;
    auto6FC0000D_g = lv_creditGroup;