Cybah
Emperor
- Joined
- Jun 22, 2007
- Messages
- 1,481
This code is not loading when reloading the map. I've also tried onBeginGameTurn, onBeginPlayerTurn, ... (with iGameTurn < 1) but all of them are not called either when reloading the map - even without the "if iGameTurn".
Any ideas?
When reloading the map and playing with "no starting techs" no player shall have knowledge of the techs - like on game start.
Any ideas?
When reloading the map and playing with "no starting techs" no player shall have knowledge of the techs - like on game start.
Code:
def onGameStart(self, argsList):
'Called at the start of the game'
if (gc.getGame().getGameTurnYear() == gc.getDefineINT("START_YEAR") and not gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ADVANCED_START)):
for iPlayer in range(gc.getMAX_PLAYERS()):
player = gc.getPlayer(iPlayer)
if (player.isAlive() and player.isHuman()):
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
popupInfo.setText(u"showDawnOfMan")
popupInfo.addPopup(iPlayer)
else:
CyInterface().setSoundSelectionReady(true)
if gc.getGame().isPbem():
for iPlayer in range(gc.getMAX_PLAYERS()):
player = gc.getPlayer(iPlayer)
if (player.isAlive() and player.isHuman()):
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_DETAILS)
popupInfo.setOption1(true)
popupInfo.addPopup(iPlayer)
## NO STARTING TECHS START ##
if (gc.getGame().getGameTurnYear() == gc.getDefineINT("START_YEAR") and gc.getGame().isOption(GameOptionTypes.GAMEOPTION_NO_STARTING_TECHS)):
for iPlayerLoop in range(gc.getMAX_CIV_PLAYERS()):
pPlayer = gc.getPlayer(iPlayerLoop)
iPlayer = pPlayer.getID()
if pPlayer.isAlive():
iTech1 = CvUtil.findInfoTypeNum(gc.getTechInfo,gc.getNumTechInfos(),'TECH_FISHING')
iTech2 = CvUtil.findInfoTypeNum(gc.getTechInfo,gc.getNumTechInfos(),'TECH_THE_WHEEL')
iTech3 = CvUtil.findInfoTypeNum(gc.getTechInfo,gc.getNumTechInfos(),'TECH_AGRICULTURE')
iTech4 = CvUtil.findInfoTypeNum(gc.getTechInfo,gc.getNumTechInfos(),'TECH_HUNTING')
iTech5 = CvUtil.findInfoTypeNum(gc.getTechInfo,gc.getNumTechInfos(),'TECH_MYSTICISM')
iTech6 = CvUtil.findInfoTypeNum(gc.getTechInfo,gc.getNumTechInfos(),'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)
pTeam.setHasTech(iTech6, false, iPlayer, false, false)
## NO STARTING TECHS END ##