Hi,
I am trying to build a road from one city to another if there is more than 1 city for a civilization. However it seems like I am doing something wrong. Firstly I would like to ask if this even possible. Secondly I am doing it this way :-
However it doesn't seem to be going into the iCityLoop for loop.
Thanks
I am trying to build a road from one city to another if there is more than 1 city for a civilization. However it seems like I am doing something wrong. Firstly I would like to ask if this even possible. Secondly I am doing it this way :-
Code:
def buildRoads(self, iPlayer):
print "Build Roads called"
player = gc.getPlayer(iPlayer)
iWorker = gc.getInfoTypeForString("UNIT_FARM_WORKER")
pWorker = player.getUnit(iWorker)
pGroup = pWorker.getGroup()
iCities = player.getNumCities()
pyPlayer = PyPlayer(iPlayer)
print "Num Cities"
print iCities
pCapitalCity = player.getCapitalCity()
print pCapitalCity.getName()
if(iCities > 1):
cityList = pyPlayer.getCityList()
for apCityLoop in cityList:
for iCityLoop in range(iCities):
apCityLoop = pyPlayer.getCity(iCityLoop)
print "In Build roads loop"
print apCityLoop
pGroup.generatePath(pCapitalCity.plot(), apCityLoop.getPlot(), False, 10)
However it doesn't seem to be going into the iCityLoop for loop.
Thanks