Annex event

BlossomPone

Chieftain
Joined
Oct 25, 2014
Messages
23
Is it possible to hook into an event that fires when a puppet city has been annexed?

Thanks :)
 
I don't think there is a direct function for that, but you could do some workarounds.

For example using a script that loops through all cities and adds a custom building (with conquestprobability = 0) to each one that is a puppet (using City:IsPuppet to check), then a second loop that checks if there are any any non-puppet cities that have the building.
 
I don't think there is a direct function for that, but you could do some workarounds.

For example using a script that loops through all cities and adds a custom building (with conquestprobability = 0) to each one that is a puppet (using City:IsPuppet to check), then a second loop that checks if there are any any non-puppet cities that have the building.

That wouldn't quite work for my purposes. That would only be able to determine IF a city has been annexed (though it would probably be easier to check if the current owner is the original owner AND is not puppeted, no need for a fancy building).

My problem is that my custom civilization adds a trait building ( a dummy building ) to modify the yield. I dont want the city to be affected, however, until the city has been annexed.

I update cities when units are moved (because of how the trait works), and i also update when a city changes hands. However, an exploit would be to capture a city, hunker down all units, annex the city, and then not move your units, preventing the yield change from occurring (this is an exploit, because the building applies negative yield gains).

The current workaround is to just affect all cities regardless of annexation, but I'd really like to be able to implement the trait in the way that I was hoping to do so originally.

If its not possible, I guess its not the end of the world, though. :)
 
Your next best bet I feel would be to check each city's condition at the start of each turn. This is something the player wouldn't be able to avoid unlike moving their own units. It's not as responsive as you might like, but it's something players will rarely notice.
 
Top Bottom