[LUA] Remove unit promotion

qqqbbb

Prince
Joined
Sep 25, 2010
Messages
530
Can
Code:
pUnit:GetExperience():SetPromotion(PromotionIndex)
command be used to remove a promotion?

This
Code:
pUnit:GetExperience():SetPromotion(PromotionIndex, false)
does not work.
 
nope. JFD ran into this ages ago, and both he and I tested various different methods of using this function or attempting work-arounds. None work. Deleting and re-creating the unit does not work because you cannot set a unit's "Level" via lua nor can you attach modifiers the unit may have had from being trained in a given city, for example. And because of the way combat XP works in civ6, from the testing I did back then any XP points you add to a unit via lua beyond that needed for the 1st promotion go *poof* once the unit selects such a 1st promotion.
 
I use
Code:
Players[iPlayer]:GetUnits():Destroy(pUnit)
Where I already have the unit object defined as "pUnit".

There is also a way to do it using UnitManager.Kill(args) but I am unsure what arguments are required.
 
Back
Top Bottom