BvBPL
Pour Decision Maker
I have to say that I love the randomization of city names. I recently came across a Calabum city called "Don'tgonearthecastle."
I have to say that I love the randomization of city names. I recently came across a Calabum city called "Don'tgonearthecastle."
def onCityBuilt(self, argsList):
'City Built'
city = argsList[0]
pPlot = city.plot()
iPlayer = city.getOwner()
pPlayer = gc.getPlayer(iPlayer)
iCiv = pPlayer.getCivilizationType()
if not city.isCapital():
listCityNames = []
CivFile = open("Mods/Magister Modmod for FfH2/Assets/XML/Civilizations/CIV4CivilizationInfos.xml")
bCiv = False
for line in CivFile.readlines():
if "<Type>" in line:
sCiv = line[line.find(">") +1 : line.find("</")]
if iCiv == gc.getInfoTypeForString(sCiv):
bCiv = True
else:
bCiv = False
elif bCiv:
if "<City>" in line:
txtKeyCity = line[line.find(">") +1 : line.find("</")]
sName = localText.getText(txtKeyCity, ())
bUsed = False
for iLoopPlayer in range(gc.getMAX_PLAYERS()):
pLoopPlayer = gc.getPlayer(iLoopPlayer)
(loopCity, iter) = pLoopPlayer.firstCity(False)
while(loopCity):
if not loopCity.isNone(): #only valid cities
if loopCity.getName() == sName:
bUsed = True
break
(loopCity, iter) = pLoopPlayer.nextCity(iter, False)
if bUsed:
break
if not bUsed:
listCityNames.append(txtKeyCity)
if len(listCityNames) > 0:
txtKeyCity = listCityNames.pop(CyGame().getSorenRandNum(len(listCityNames), "Name city"))
sName = localText.getText(txtKeyCity, ())
city.setName(sName, False)
I have encountered a strange bug while playing Calabims. Some of my recently conquered cities have a *negative* production and it keeps on decreasing (or increasing in absolute value).
For instance in the screen shot below, current production is -50, but was -40 the previous turn.
What is the problem (and is there a fix)?
Yeah, but if he happens to survive past that he's just an axeman. This isn't really important to balance since the best use of Lucian is always going to be early rushing which has a high chance of getting him killed, but sometimes I like to save units from the early game and make them into immortals or whatever.
He's not the only hero who declines to irrelevancy. Gilden Silveric and Rantine are also irrelevant in the late game, for example. (It always seemed odd to me that the three civs with the earliest heroes are the two rush civs and... the most builder-y of builder civs.)
I encountered an interesting variation of the Waiting for Other Civilizations bug yesterday that I think might help in figuring out where it's coming from. (This is on the most recent revision.) What happens in the attached save game is that, when you end turn 228 the game will go *entirely* into the next turn (229)--I discover a new tech, all information updates--and *then* the Waiting for Other Civilizations message appears, even though it's clear all AIs have already made their moves. Some functions were still available, so I even managed to get a save on the turn with the Waiting for Other Civilizations bug having already happened.
Thoughts?
Using the latest version, I get this bug too. If I go back a couple of turns, and replay through, the turn then proceeds as normal, but not if I reload the previous turn. This means that whatever is causeing the 'waiting for other civs' freeze is related to a units action, rather the a particular building. I have included the only logs that this error gave. Spent a lot of time on this gave, shame to give it up.
Cheers
Edit: Playing as the calabim I took over the EMPYREAN holy city, and am now getting the occasional message 'trying to overthrow vampiric oppressors'. I cannot see that this is actually doing anything, so just wonder what going on, ie is there a chance to lose the city/things I can do to combat the problem (I really want to keep the city as the previous owner was kind enough to build the dies wonder for me).
Edit 2: Got to a point where the game would not continue on (waiting for other civs error), so in a desperate attempt to save my game I went into the world builder and started deleting.
1. Finally discovered that if I removed the clan of embers the game would continue.
2. Because none of their cities were finishing anything, I started deleting their units.
3. Found that a particular wolf rider was the culprit, and simply removing this one unit allowed me to continue. I had a look the wolf rider to see if there was anything of particular note, and it had the flanking 3 promotion, but more importantly (I think) it was going past the pristine pass unique feature. Anyway see a bit weird but will see if this has eliminated the error.
if pCity.getNumBuilding(iComplacency) > 0 or pCity.getNumBuilding(iUnyielding) > 0:
iChange = -9
pTimer = pCity.getHurryAngerTimer()
if pTimer < 9:
iChange = 0 - pTimer
pCity.changeHurryAngerTimer(iChange)
pCity.setOccupationTimer(0)
CyGame().changeCrime(-5)
if pCity.getRevolutionIndex() > 0:
pCity.setRevolutionIndex(0)
elif pCity.getNumBuilding(iChains):
pCity.setOccupationTimer(0)
CyGame().changeCrime(-5)
if pCity.getRevolutionIndex() > 0:
pCity.setRevolutionIndex(0)
else:
if pCity.isHasReligion(iDragonCult):
if not self.isHasDragon(pPlayer):
iRnd = CyGame().getSorenRandNum(100, "Dragon Cult Revolt")
if iRnd < 2:
pCity.changeOccupationTimer(iRnd)
pCity.changeHurryAngerTimer(iRnd)
CyInterface().addMessage(iPlayer,True,25,CyTranslator().getText("TXT_KEY_MESSAGE_DRAGON_CULT_REVOLT", ()),'',1,'Art/Interface/Buttons/Units/Acheron.dds',ColorTypes(7),iX,iY,True,True)
[COLOR="Red"] if pCity.isHasReligion(iEmpyrean):
if iCiv == iCalabim:
iRnd = CyGame().getSorenRandNum(100, "Empyrean vs Vampire revolt")
if iRnd < 4:
pCity.changeOccupationTimer(iRnd)
pCity.changeHurryAngerTimer(iRnd)
pCity.setRevolutionIndex(pCity.getRevolutionIndex() + iRnd)[/COLOR]
CyInterface().addMessage(iPlayer,True,25,CyTranslator().getText("TXT_KEY_MESSAGE_EMPYREAN_REVOLT", (pCity.getName(),)),'',1,'Art/Interface/Buttons/Units/Priest Empyrean.dds',ColorTypes(7),iX,iY,True,True)
if pCity.isHasReligion(iOne):
iRnd = CyGame().getSorenRandNum(75, "Monothiest Revolt")
if pCity.getNumRealBuilding(iMartyrs) > 0:
iRnd *= 2
if iRnd < 5:
for iTarget in range(gc.getNumReligionInfos()):
if iTarget != iOne and pCity.isHasReligion(iTarget):
if self.removeReligion(iTarget, pCity):
CyInterface().addMessage(iPlayer,True,25,CyTranslator().getText("TXT_KEY_MESSAGE_MONOTHIEST_REVOLT", ()),'',1,'Art/Interface/Buttons/Units/Inquisitor Grigori.dds',ColorTypes(7),iX,iY,True,True)
iRnd += 1
if iStateReligion == iTarget:
pCity.changeOccupationTimer(iRnd)
pCity.changeHurryAngerTimer(iRnd)
if pCity.getNumBuilding(iPaganTemple):
pCity.setNumRealBuilding(iPaganTemple, 0)
iRnd += 1
if iRnd >= 1:
pCity.changeHurryAngerTimer(iRnd)
if pCity.isHasReligion(iHand):
if bAuricRevolt:
if CyGame().getSorenRandNum(100, "Auric Revolt") < 15:
pCity.changeOccupationTimer(3)
pCity.changeHurryAngerTimer(1)
CyInterface().addMessage(iPlayer,True,25,CyTranslator().getText("TXT_KEY_MESSAGE_AURIC_REVOLT", ()),'',1,'Art/Interface/Buttons/Units/Auric Ascended.dds',ColorTypes(7),iX,iY,True,True)
Hi Magister,
I was having a fun time as the Svarts running over the map. I decided that the best course of action would be for some hidden nationality units to visit the Ljosalfar, where they would carry on a philosophical discussion about reuniting the elves.
Sadly, when I cast Veil of Night, nothing happened. None of my units gained HN, or any other promotion.
I have attached a save.
Thanks in advance for your time.
def spellVeilOfNight(pCaster):
iHN = gc.getInfoTypeForString('PROMOTION_HIDDEN_NATIONALITY')
iStealth = gc.getInfoTypeForString('PROMOTION_STEALTH')
iMark = gc.getInfoTypeForString('PROMOTION_MARKSMAN')
iCoE = gc.getInfoTypeForString('RELIGION_COUNCIL_OF_ESUS')
pPlayer = gc.getPlayer(pCaster.getOwner())
(pUnit, iter) = pPlayer.firstUnit(False)
while(pUnit):
if ( not pUnit.isDead() ): #is the unit alive and valid?
if pUnit.baseCombatStr() > 0:
pUnit.setHasPromotion(iHN, True)
pUnit.setHasPromotion(iStealth, True)
if pUnit.getReligion() ==-1:
pUnit.setReligion(iCo[COLOR="Red"]E[/COLOR])
if pUnit.getReligion() == iCo[COLOR="Red"]E[/COLOR]:
pUnit.setHasPromotion(iMark, True)
(pUnit, iter) = pPlayer.nextUnit(iter, False)