# Unit XP Set Current XP
Grammar — Sets the current xp in veterancyBehavior for unit to xP
Flags —Native
|Action
Sets the current xp of a unit
# Arguments
unit
— Unitstring
<gamelink::Behavior> — Veterancy Behaviorfixed
— XP
Returns — void
native void UnitXPSetCurrentXP(
unit inUnit,
string inVeterancyBehavior,
fixed inXP,
);
# 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/heroesdata.stormmod — base.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.stormmod — base.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);
}