Detecting when a Trade Route begins.

JFD

Kathigitarkh
Joined
Oct 19, 2010
Messages
9,132
Location
The Kingdom of New Zealand
Is there a simple way to detect when the player initiates a Trade Route? Perhaps a game event was introduced in BNW? I'm using the CP DLL, so if this exists and I've overlooked it, that would be helpful to know as well. Thanks for any insights.

Also, is there a way to detect when a Great Work is created?
 
With regard to trade routes, I don't believe so, but perhaps someone who could trace the DLL code might find something we've not seen before. However, I've checked through the Player, Team, Game, Unit, and City methods and haven't found anything relating to exactly when a trade route gets established.

If this exists, I could definitely make use of it as well, but for the time being, for my Holo Civ at least, the best I can do is scan the trade routes table every turn. For my needs, I'd also need to know when a trade route ends (naturally or forcibly) but so far, scanning the trade routes table generally gets me that by implication, if a route suddenly disappears.

Afraid I have nothing to offer with respect to Great Works either. Best I can come up with is to cache Player:GetNumGreatWorks() and see if this number changes when a great person has been expended.

I also don't use the CP DLL, or any DLL mods, so all my information is of vanilla BNW.
 
The closest hook method I can see is perhaps to use:

(Hook) GameEvents.GreatPersonExpended(playerId, eGreatPersonType);

But it does not directly give you info on whether they were used to create a great work, or to spam culture, or what. So I think you'd have to cache player's number of great works, etc., and you'd also have to account for all buildings that give free great works, and track-and-cache whether they've been built by CIV_X via the CityConstructed hook.



I didn't see anything either that was a direct trade route initiated (or ended) hook
 
Back
Top Bottom