Very stuck for last few hours. Im trying to add an event to bug.
Its the python from a modcomp called Real Always War, its all python.
All that the creator says you need is this.
So i made my own python file called mw.py for my mod MW
Does not work. Its gota be simple right lol? But i really cant get it working . CAn someone help please
Its the python from a modcomp called Real Always War, its all python.
All that the creator says you need is this.
Code:
def onGameStart(self, argsList):
'Called at the start of the game'
###real always war start
if gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ALWAYS_WAR):
for i in xrange(gc.getMAX_CIV_TEAMS ()):
FirstTeam = gc.getTeam(i)
if FirstTeam.isHuman():continue
for j in xrange(gc.getMAX_CIV_TEAMS ()):
SecondTeam = gc.getTeam(j)
if SecondTeam.isHuman():continue
if i==j:continue
FirstTeam.declareWar(j,False,WarPlanTypes.WARPLAN_TOTAL)
FirstTeam.setPermanentWarPeace(j,True)
SecondTeam.declareWar(i,False,WarPlanTypes.WARPLAN_TOTAL)
SecondTeam.setPermanentWarPeace(i,True)
###real always war end
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)
CvAdvisorUtils.resetNoLiberateCities()
So i made my own python file called mw.py for my mod MW
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
Lucky Charms - Provides various free goodies at random
-->
<mod id="MW" module="mw">
<event type="GameStart" function="onGameStart"/>
</mod>
#mw
from CvPythonExtensions import *
import BugUtil
gc = CyGlobalContext()
def onGameStart(self, argsList):
'Called at the start of the game'
###real always war start
if gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ALWAYS_WAR):
for i in xrange(gc.getMAX_CIV_TEAMS ()):
FirstTeam = gc.getTeam(i)
if FirstTeam.isHuman():continue
for j in xrange(gc.getMAX_CIV_TEAMS ()):
SecondTeam = gc.getTeam(j)
if SecondTeam.isHuman():continue
if i==j:continue
FirstTeam.declareWar(j,False,WarPlanTypes.WARPLAN_TOTAL)
FirstTeam.setPermanentWarPeace(j,True)
SecondTeam.declareWar(i,False,WarPlanTypes.WARPLAN_TOTAL)
SecondTeam.setPermanentWarPeace(i,True)
###real always war end
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)
CvAdvisorUtils.resetNoLiberateCities()
Does not work. Its gota be simple right lol? But i really cant get it working . CAn someone help please