hi there (again),
i hope this is the right place for this sort of question:
i have this code (by The_j) :
this code suppose to turn coast and ocean into regular land terrain - but it wont for some reason,
the game just gets stuck and the map wont load,
now i have another type of code - but that one will start the game with replaced water tiles - but - after passing the turn - it will crash - im using bug based mod - and i get an error massage right on the beginning of buginit - bugunit.py failed.
so , anyone can help me achieve land over water code (that ill be able to add to various maps by my own?)
thanks for any reply,
keldath
i hope this is the right place for this sort of question:
i have this code (by The_j) :
Code:
def generateTerrainAtPlot(self,iX,iY):
lat = self.getLatitudeAtPlot(iX,iY)
gc = CyGlobalContext()
if (self.map.plot(iX, iY).isWater()):
[B]###changed for mars now
iTerrain = self.map.plot(iX,iY).getTerrainType()
if iTerrain == gc.getInfoTypeForString("TERRAIN_COAST"):
self.map.plot(iX, iY).setPlotType(PlotTypes.PLOT_LAND, false, false)
self.map.plot(iX, iY).setTerrainType(gc.getInfoTypeForString("TERRAIN_DESERT_WASTE"), false, false)
if iTerrain == gc.getInfoTypeForString("TERRAIN_OCEAN"):
self.map.plot(iX, iY).setPlotType(PlotTypes.PLOT_LAND, false, false)
self.map.plot(iX, iY).setTerrainType(gc.getInfoTypeForString("TERRAIN_DEEP_DESERT"), false, false)
return self.map.plot(iX, iY).getTerrainType()
###change end[/B]
terrainVal = self.terrainGrass
if lat >= self.fSnowLatitude:
terrainVal = self.terrainIce
elif lat >= self.fTundraLatitude:
terrainVal = self.terrainTundra
elif lat < self.fGrassLatitude:
terrainVal = self.terrainGrass
else:
desertVal = self.deserts.getHeight(iX, iY)
plainsVal = self.plains.getHeight(iX, iY)
if ((desertVal >= self.iDesertBottom) and (desertVal <= self.iDesertTop) and (lat >= self.fDesertBottomLatitude) and (lat < self.fDesertTopLatitude)):
terrainVal = self.terrainDesert
elif ((plainsVal >= self.iPlainsBottom) and (plainsVal <= self.iPlainsTop)):
terrainVal = self.terrainPlains
if (terrainVal == TerrainTypes.NO_TERRAIN):
return self.map.plot(iX, iY).getTerrainType()
return terrainVal
this code suppose to turn coast and ocean into regular land terrain - but it wont for some reason,
the game just gets stuck and the map wont load,
now i have another type of code - but that one will start the game with replaced water tiles - but - after passing the turn - it will crash - im using bug based mod - and i get an error massage right on the beginning of buginit - bugunit.py failed.
so , anyone can help me achieve land over water code (that ill be able to add to various maps by my own?)
thanks for any reply,
keldath