PlotOwnership Change Event?

reustonium

Chieftain
Joined
Sep 2, 2014
Messages
1
I'm working on a single player mod that intends to track the ownership of each plot at the end of each turn. The purpose is to post-process this data with the mapdata into a nice looking animated map at the end of each game. (I find the in-game strategic map to be rather ugly).

My first idea was to loop all plots every turn.
Code:
Events.ActivePlayerTurnEnd.Add( GetPlotOwnership);

This is going to be super slow though, and since most plots don't get a new owner each turn really wasteful.

Is there an Event in the sdk that fires when a plot get's a new owner?

Any help you can provide is really appreciated.
 
Events.SerialEventHexCultureChanged()

AFAIK it fires for every players.
 
I could really make use of that, though I was under the impression that serial events only fired when something happens within the screen view of the active player. Will have to test that.

@Gedemon; do you know if it also fires when you buy plots with gold?
 
I could really make use of that, though I was under the impression that serial events only fired when something happens within the screen view of the active player.
Not true as a 'global' property of SerialEvents. But they do seem to be a case-by-case for whether or not they are reliable as a method. One may be, another not so much.

Example: SerialEventUnitCreated fires for all units, regardless of whether the human player can see the 'event'. But it also re-fires at times you would not expect it to, such as when a saved game is reloaded, and the units are 'created' by being placed on the map as part of the reloading process.

The ActivePlayerTurnStart and ActivePlayerTurnEnd events only fire for the human player, which makes them useless for 99% of all mods.

Events.EndCombatSim and Events.RunCombatSim I think are two more that only run when the human player can 'see' the combat.
 
Back
Top Bottom