Couple of Quick Questions about Events.ActivePlayerTurnEnd()

LeeS

Imperator
Joined
Jul 23, 2013
Messages
7,241
Location
Illinois, USA
  1. Is it known what arguments are passed?
  2. If anyone has used it is it reliable (safe) to use? By reliable (safe) I mean does using it work OK or does it cause odd behavior or CTD or something similar.
  3. Does it also fire correctly for the AI?
I'm currently using a PlayerDoTurn to look at whether a city is building a wonder/building in a list that certain resources will increase production for. When a city has Resource_X improved nearby, and the city is building Wonder_X, I add a dummy building that has a <WonderProductionModifier>. But that "1st turn" really gets missed for increasing the city's production, so I am wondering if I could also fire my lua function on Events.ActivePlayerTurnEnd() and catch these conditions "before" the player's next turn is processed.
 
ActivePlayerTurnEnd is the counterpart to ActivePlayerTurnStart

Neither receive parameters, you can use Game.GetActivePlayer() within ActivePlayerTurnStart to find the current player.

Both only trigger for players where the UI needs to be updated, so not for AI players, usually only for player 0 within a mod, unless that mod is being used in HotSeat.

Search the core Lua files (eg InGame, ActionInfoPanel and UnitPanel) for examples
 
hmm...looks not usable for what I was hoping I could do. Don't want to give an unfair to the human player just to massage this one small issue.

In any event, thanks whoward for the info. This must be about the twenty-eleventh time you've stopped me from chasing a white rabbit down a coding-hole.
 
Back
Top Bottom