Olleus
Deity
In civ4 python their is no function which is called at the end of a turn. onEndPlayerTurn is actualy called before you move any unit, and onEndGameTurn is called once every player has moved. I have made a scipt which i called at the begining of a players turn and returns the index of the previous player. Using this you can fool the computer into calling a script at the end of a players turn.
A far as I can see it always works.
Code:
def onBeginPlayerTurn(self, argsList):
'Called at the beginning of a players turn'
iGameTurn, iPlayer = argsList
if iPlayer == 0:
iRealPlayer = 18
elif iPlayer == 18:
iRealPlayer = gc.getGame().countCivPlayersEverAlive() - 1
while gc.getPlayer(iRealPlayer).isAlive() == False:
iRealPlayer -= 1
else:
iRealPlayer = iPlayer - 1
while gc.getPlayer(iRealPlayer).isAlive() == False:
iRealPlayer -= 1
# iRealplayer is the index of the previous player
A far as I can see it always works.