Annoyingly, the expansions already replace UnitPanel.lua with their own versions (UnitPanel_Expansion1.lua, UnitPanel_Expansion2.lua)
so your mod probably works in vanilla but not with expansions.
you can certainly just set promotions regardless of xp, but that ends up being a totally different outcome as the unit now gets more promotions just 15xp later.
and sadly restoring unit movement does not let a unit act again after giving it a promotion :sad:
SetBuildDisabled is to disallow the production of specific units, not to prevent the founding of cities.
Replacing UnitPanel.lua is how certain game modes do things, but I had trouble replacing UnitPanel.lua because Gathering Storm already replaces it and I'm not sure how to replace a...
I had a simple requirement... I wanted to create a unit with some amount of XP and promotions already chosen. I had searched the forums but mostly just people saying it can't be done. After trying out a million things, I found the way to do it.
here's some pseudo code. for example if you wanted...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.