cybrxkhan
Asian Xwedodah
Nice to see some stuff out before the holidays, and no problem about my request being @#$@#$%@ hard.
Hello again, I have a question concerning your SpawnACiv, as I am starting to merge it into the next version of WoL.
Basically, would SpawACiv function the same in a scenario/worldbuilder save?
For example, let's say I have a barbarian civ, the Goths, that appear once 1 civ researches Iron Working. If I have a scenario/worldbuilder save that starts in the Industrial Era, that means that a majority of the civs will already have researched Iron Working. Will the Goths suddenly appear out of the blue and "mess up" my scenario/worldbuilder save, or will they not appear at all?
1. Make the barb civs also get settlers, besides workers. This one probably is the one other people can find useful too, since it'd also make these guys pretty dangerous.
2. Make an option to somehow limit a unit to only the capital, and not other cities. THis is probably not going to be fun...
Anyhow, you don't need to do this request (and if you do again I'm not rushing you), and thanks for your patience and help!
If there's space for another civ, then the goths will appear, when the next civ researches iron working. If nobody does that, then they'll not appear.
Instead of giving them 2 types of combat units, you could also give them settlers instead .
In fact, that's relativly easy .
I'll do it, when i have the time for it.
But it will probably last some time, because there are a few requests, and i want to get my patch out in the next week.
def onProjectBuilt(self, argsList):
'Project Completed'
etc., etc.
def onProjectBuilt(self, argsList):
'Project Completed'
pCity, iProjectType = argsList
game = gc.getGame()
####from here on
if iProjectType == gc.getInfoTypeForString("PROJECT_WHATEVER"):
iPlayerID = pCity.getOwner()
pPlayer = gc.getPlayer(iPlayerID)
numCities = pPlayer.getNumCities ()
for i in xrange(numCities):
CurrentCity = pPlayer.getCity(i)
if (not CurrentCity.isNone()) and (CurrentCity.getOwner()==iPlayerID):
pCity.changeCulture(iPlayerID, TheNumberOfCultureWhichShouldBeAdded,True)
You should be adjusting the culture for "CurrentCity", not "pCity", on that last line.
Also, you should probably use the player's city iterator for looping over all the players's cities rather than looping over the numCities range.
Only a performance difference, i guess?
(loopCity, iter) = self.player.firstCity(false)
while(loopCity):
cityOwner = loopCity.getOwner()
if ( not loopCity.isNone() and loopCity.getOwner() == self.getID() ): #only valid cities
loopCity.changeCulture(iPlayerID, TheNumberOfCultureWhichShouldBeAdded,True)
(loopCity, iter) = self.player.nextCity(iter, false)
def onProjectBuilt(self, argsList):
'Project Completed'
pCity, iProjectType = argsList
game = gc.getGame()
if ((not gc.getGame().isNetworkMultiPlayer()) and (pCity.getOwner() == gc.getGame().getActivePlayer())):
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
popupInfo.setData1(iProjectType)
popupInfo.setData2(pCity.getID())
popupInfo.setData3(2)
popupInfo.setText(u"showWonderMovie")
popupInfo.addPopup(pCity.getOwner())
## LASCAUX CAVE PAINTINGS - START ##
if iProjectType == gc.getInfoTypeForString("PROJECT_LASCAUX"):
iPlayerID = pCity.getOwner()
pPlayer = gc.getPlayer(iPlayerID)
numCities = pPlayer.getNumCities()
TheNumberOfCultureWhichShouldBeAdded = 20
(loopCity, iter) = self.player.firstCity(false) ## line 961
while(loopCity):
cityOwner = loopCity.getOwner()
if ( not loopCity.isNone() and loopCity.getOwner() == self.getID() ): #only valid cities
loopCity.changeCulture(iPlayerID, TheNumberOfCultureWhichShouldBeAdded,True)
(loopCity, iter) = self.player.nextCity(iter, false)
## LASCAUX CAVE PAINTINGS - END ##
Traceback (most recent call last):
File "BugEventManager", line 350, in _handleDefaultEvent
File "CvEventManager", line 961, in onProjectBuilt
AttributeError: BugEventManager instance has no attribute 'player'
def _handleDefaultEvent(self, eventType, argsList):
if self.EventHandlerMap.has_key(eventType):
for eventHandler in self.EventHandlerMap[eventType]:
try:
eventHandler(argsList) ## line 350
except:
BugUtil.trace("Error in %s event handler %s", eventType, BugUtil.escapeXml(eventHandler))
I'm wrong :/.
I took the code snippet from TC01, and didn't change all the things.
Please replace the 2 self.player with pPlayer, and replace self.getID() with iPlayerID.
castesystem = gc.getInfoTypeForString( "CIVIC_CASTE_SYSTEM" )
iPlayer = pPlot.getOwner()
pPlayer = gc.getPlayer(iPlayer)
if (pPlayer.isCivic(castesystem)==True):
caste_system = gc.getInfoTypeForString( "CIVIC_CASTE_SYSTEM" )
iPlayer = pPlot.getOwner()
pPlayer = gc.getPlayer(iPlayer)
if (pPlayer.isCivic(caste_system)==True):