Hello everyone, I've run into a Python problem again.
As always, it's about modding RFC - this time I'm trying to dynamically change the continent (or area, to be precise) some tiles belong to. For instance, Mesopotamia and Persia should belong to Europe during the classical era to encourage the Persian AI to interact with Europe. But when I call this function:
The game immediately crashes.
When I comment the setArea method out, there's no problem anymore. What am I doing wrong?
Thanks in advance
As always, it's about modding RFC - this time I'm trying to dynamically change the continent (or area, to be precise) some tiles belong to. For instance, Mesopotamia and Persia should belong to Europe during the classical era to encourage the Persian AI to interact with Europe. But when I call this function:
Code:
def convertMiddleEast(self):
if (gc.getMap().plot(76,40).area().getID() == con.iEurope):
return
for i in range(72,86+1):
for j in range(34,46+1):
pCurrent = gc.getMap().plot(i, j)
if ((not pCurrent.isWater()) and pCurrent.area().getID() != con.iEurope):
pCurrent.setArea(con.iEurope)
for i in range(69,71+1):
for j in range(40,45+1):
pCurrent = gc.getMap().plot(i, j)
if ((not pCurrent.isWater()) and pCurrent.area().getID() != con.iEurope):
pCurrent.setArea(con.iEurope)
for i in range(78,86+1):
for j in range(47,49+1):
pCurrent = gc.getMap().plot(i, j)
if ((not pCurrent.isWater()) and pCurrent.area().getID() != con.iEurope):
pCurrent.setArea(con.iEurope)
When I comment the setArea method out, there's no problem anymore. What am I doing wrong?
Thanks in advance