I've been trying to create a mod which reduces a player's happiness under certain circumstances. (Specifically, based on the amount of fallout in their territory. But that's besides the point here.) I've managed to make the code to calculate by how much I want to reduce it and do the reduction, but there doesn't seem to be a right time to run it. Even when I use both Events.ActivePlayerTurnStart and Events.ActivePlayerTurnEnd, I can tell from the golden age progress that the happiness is recalculated separately before being applied.
I've read another thread suggesting using hidden buildings for this, but that only works when you want to increase the happiness. A quick test shows that even a building with -100 unmodded happiness still won't affect your empire.
So, is there some special event I could use or would I be forced to replace one of the game's own lua files? And if I would, which file would I be looking at?
I've read another thread suggesting using hidden buildings for this, but that only works when you want to increase the happiness. A quick test shows that even a building with -100 unmodded happiness still won't affect your empire.
So, is there some special event I could use or would I be forced to replace one of the game's own lua files? And if I would, which file would I be looking at?