Deal expiration

I don't think there is an explicit event, but you may be able to hook the Events.NotificationAdded event and check for a NotificationTypes.NOTIFICATION_FRIENDSHIP_EXPIRED message (see ...\assets\UI\InGame\WorldView\NotificationPanel.lua)

Except that would only work for a human player (as the AI doesn't get UI notifications ... ummmmm)

Otherwise you're going to have to check each turn for friends and store that info, and then check the subsequent turn for not being friends with
Code:
pActivePlayer:IsDoF(iOtherPlayer)
 
It's be so fantastic if we simply had a few basic events for building built, combat ended, policy acquired, etc. My concern with turn-checking is... does the 'turn starts' event trigger before or after deal checking? If turn start runs, then deals expire, then turn end runs... :crazyeye:
 
Based on my experience, the user-triggered start-of-turn event happens after all of the game's built-in start-of-turn events. Same for the events that key off the end of a turn, start of a combat, creation of a unit, etc., so in the case you're asking about, the deal would expire and then your start-of-turn event could kick in. Assuming you used the save/load functionality to store variables across turns (like how the Building Resources mod works), it shouldn't be hard to have it trigger immediately after the expiration this way, before the user has a chance to notice.
 
Back
Top Bottom