How to call method after a City makes a purchase

CarlCoral55

Chieftain
Joined
May 19, 2018
Messages
3
I am creating a mod where if a unit is within 2 tiles of a city with an armory, they get a certain promotion. I've hooked my promotion assigning function to the game events via

Code:
GameEvents.CityConstructed.Add(ArmoryCompleted)

Where ArmoryCompleted successfully takes care of assigning the promotion correctly. However, if the armory was bought, my functions aren't fired. Is there any way to hook my lua code onto the game so that whenever a city makes a purchase, my code is called? For example something like:

GameEvents.CityMadePurchase.Add(ArmoryPurchased)

I have all the DLC's and I have included whoward's various DLL components mod, so if there are any hooks inside these that would help please let me know, thanks!
 
Last edited:
GameEvents.CityConstructed is a VMC DLL event, and it's supposed to fire from purchases too (there are the bGold and bFaith parameters to let you know the buy mechanism if applicable).
 
It was one (of the many) events that Firaxis added in a later patch, so it should be firing on purchase
 
Top Bottom