Cybah
Emperor
- Joined
- Jun 22, 2007
- Messages
- 1,481
Need help!
In my mod, some python code is related to the gamestart. For example this:
Everything what I have added to def onGameStart(self, argsList) in my eventmanager will NOT be executed when reloading the map.
How can I solve this? I cannot find a "on mapreload" event. I need an univeral solution, not a special one for this code (like reset the techs when founding the first city).
In my mod, some python code is related to the gamestart. For example this:
PHP:
## NO STARTING TECHS START ##
if (gc.getGame().getGameTurnYear() == gc.getDefineINT("START_YEAR") and gc.getGame().isOption(GameOptionTypes.GAMEOPTION_NO_STARTING_TECHS)):
for iPlayerLoop in xrange(gc.getMAX_CIV_PLAYERS()):
pPlayer = gc.getPlayer(iPlayerLoop)
iPlayer = pPlayer.getID()
# if pPlayer.isAlive():
iTech1 = gc.getInfoTypeForString("TECH_FISHING")
iTech2 = gc.getInfoTypeForString("TECH_THE_WHEEL")
iTech3 = gc.getInfoTypeForString("TECH_AGRICULTURE")
iTech4 = gc.getInfoTypeForString("TECH_HUNTING")
iTech5 = gc.getInfoTypeForString("TECH_MINING")
pTeam = gc.getTeam(pPlayer.getTeam())
pTeam.setHasTech(iTech1, false, iPlayer, false, false)
pTeam.setHasTech(iTech2, false, iPlayer, false, false)
pTeam.setHasTech(iTech3, false, iPlayer, false, false)
pTeam.setHasTech(iTech4, false, iPlayer, false, false)
pTeam.setHasTech(iTech5, false, iPlayer, false, false)
## NO STARTING TECHS END ##
Everything what I have added to def onGameStart(self, argsList) in my eventmanager will NOT be executed when reloading the map.
How can I solve this? I cannot find a "on mapreload" event. I need an univeral solution, not a special one for this code (like reset the techs when founding the first city).