# Unit XP Set Current XP

Grammar — Sets the current xp in veterancyBehavior for unit to xP
FlagsNative | Action

Sets the current xp of a unit

# Arguments

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

Returns — void

native void UnitXPSetCurrentXP(
	unit inUnit,
	string inVeterancyBehavior,
	fixed inXP,
);

Category: Unit / Attributes And Experience

# Examples

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

        }
    }
    UnitXPSetCurrentXP(libMapM_gv_jungleCreepCamps[lp_camp].lv_campOwnershipFlagUnit, null, 0.0);
    if ((libMapM_gv_jungleCreepCamps[lp_camp].lv_campAwardsRegenGlobe == true)) {
        if ((lp_owner == libCore_gv_cOMPUTER_TeamOrder)) {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/SupportLib.galaxy:4696

    for ( ; lv_iterPlayer <= autoBE69E612_ae ; lv_iterPlayer += 1 ) {
        if ((UnitIsValid(libGame_gv_players[lv_iterPlayer].lv_heroUnit) == true)) {
            UnitXPSetCurrentXP(libGame_gv_players[lv_iterPlayer].lv_heroUnit, "HeroDummyVeterancy", lv_highestXP);
        }