Saarlaender
Chieftain
- Joined
- Jan 14, 2006
- Messages
- 60
Hi all,
I'm still working on getting my religion mod to gain more functions. Now, I am trying to get cities with multiple religions to convert themselves with one of them, and to make it possible that multiple religions spread to a city without a missionary. The funtions seem to not be called, though - I included messages if the function gets called and something happens, and also if nothing happens (to see if it works at all). Well, the funktions are supposed to be called at the beginning of each player turn:
now, I can't be certain yet about reform, but convert and multiples do not get called, at least they don't generate the messages they should:
no message, neither "conversion" nor "no conversion" (Keine Konversion, in German.)
neither in the so far only rudimentary multiples function:
again, no messages whatsoever.
what am I messing up?
I'm still working on getting my religion mod to gain more functions. Now, I am trying to get cities with multiple religions to convert themselves with one of them, and to make it possible that multiple religions spread to a city without a missionary. The funtions seem to not be called, though - I included messages if the function gets called and something happens, and also if nothing happens (to see if it works at all). Well, the funktions are supposed to be called at the beginning of each player turn:
Code:
def onBeginPlayerTurn(self, argsList):
'Called at the beginning of a players turn'
iGameTurn, iPlayer = argsList
self.reform(iPlayer)
self.convert(iPlayer)
self.multiples(iPlayer)
now, I can't be certain yet about reform, but convert and multiples do not get called, at least they don't generate the messages they should:
Code:
def convert(self, iPlayer):
pPlayer = gc.getPlayer(iPlayer)
iRefCityList = self.getCityList(pPlayer)
szReligionList = [ ]
for pCity in iRefCityList:
iConvert = CyGame().getSorenRandNum(100, "Conversion")
if (iConvert <= 10 and self.safeguard(pCity) >= 2):
for i in range(gc.getNumReligionInfos()):
if pCity.isHasReligion(i):
szReligionList.append(i)
if len(szReligionList) != 0:
iTarget = szReligionList[CyRandom().get(len(szReligionList), "Get a random number for religion removal.")]
pCity.setHasReligion(iTarget, False, True, True)
CyInterface().addMessage(CyGame().getActivePlayer(),True,25,'Konversion!')
else:
CyInterface().addMessage(CyGame().getActivePlayer(),True,25,'keine Konversion -')
return
no message, neither "conversion" nor "no conversion" (Keine Konversion, in German.)
neither in the so far only rudimentary multiples function:
Code:
def multiples(self, iPlayer):
pPlayer = gc.getPlayer(iPlayer)
iRefCityList = self.getCityList(pPlayer)
for pCity in iRefCityList:
iAdd = CyGame().getSorenRandNum(100, "Spread")
if (pCity.isConnectedToCapital(iPlayer) and iAdd <=20):
self.addreligion(pCity)
else:
CyInterface().addMessage(CyGame().getActivePlayer(),True,25,'keine mr -')
return
what am I messing up?