Promotion on City Capture

formerdc81

Chieftain
Joined
Nov 19, 2018
Messages
53
How would I code something like this where when a unit captures a city, it automatically receives a new standard promotion (with choices like shock/drill/cover/march/logistics/blitz, etc.), as if the unit had leveled up, without increasing level or EXP?
 
Last edited:
It would require lua-scripting with a special user interface to implement the choice for a human if you wanted the human player to be able to choose.
If you wanted to do it with the game's lua-system automatically assigning one of the possible listed promotions it would still require an lua script but not a User Interface. And you would stil need this same logic and code even with a User Interface because AI players do not use User Interfaces.
You'd have to use the CityCaptureComplete event hook, then get the plot the city is on, and then check to see if any unit of the capturing player is still on the plot. Then you'd give one of the promotions to the unit of the capturing player.

It's possible to do but if you aren't able to do lua scripts you would not be able to implement the effect.
 
I managed to code it in C++, but I had to force a level up. It works for now, I suppose, since I over-buffed honor.
 
Top Bottom