Logically, your correction should have worked. But it didn't. What happens is:
- the event takes place right away on the initial turn of the scenario (Turn = 24), although I had it set to go off on turn 28,
- it happens every turn,
- two different civs are getting the event simultaneously,
- and the next listed event is also triggered.
EDIT: This is what had been happening with my earlier attempts to elaborate on the original coding.
Here is the coding for the two events (these are listed at the end of the Python file.)
Code:
######## USAAF Reinforcements (American event Turn 128) #########
def canTriggerUSAAF(argsList):
kTriggeredData = argsList[0]
player = gc.getPlayer(kTriggeredData.ePlayer)
turn = kTriggeredData.iTurn
if (player.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_AMERICA")):
if (turn > 27 && turn % 4 == 0):
return true
return false
return false
######## Germany Declares War on USA (American event Turn 89) #########
def canTriggerUSAETOWAR(argsList):
kTriggeredData = argsList[0]
player = gc.getPlayer(kTriggeredData.ePlayer)
if (player.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_AMERICA")):
game = gc.getGame()
if (game.getGameTurn() == 89):
return true
return false
return false
If the first event's python routine is the same as the one listed for the second event, then they occur as they should, on their expected turns. Event #1 is a recurring event -- listed as such in the XML file.
Here's the actual trigger file.
And the two event entries