Longer Thaw?

Tarquelne

Follower of Tytalus
Joined
Dec 8, 2001
Messages
3,718
Can I make the thawing from the "Thaw" option last longer by altering a python or XML file? (Which, where, how?) I'd like to try having the ice and snow stick around for much of the early game.
 
Can I make the thawing from the "Thaw" option last longer by altering a python or XML file? (Which, where, how?) I'd like to try having the ice and snow stick around for much of the early game.

Using Python, in Assets\Python\CvEventMangager.py

Code:
	def onGameStart(self, argsList):
		'Called at the start of the game'

		introMovie = CvIntroMovieScreen.CvIntroMovieScreen()
		introMovie.interfaceScreen()

		if gc.getGame().isOption(GameOptionTypes.GAMEOPTION_THAW):
			iDesert = gc.getInfoTypeForString('TERRAIN_DESERT')
			iGrass = gc.getInfoTypeForString('TERRAIN_GRASS')
			iPlains = gc.getInfoTypeForString('TERRAIN_PLAINS')
			iSnow = gc.getInfoTypeForString('TERRAIN_SNOW')
			iTundra = gc.getInfoTypeForString('TERRAIN_TUNDRA')
			for i in range (CyMap().numPlots()):
				pPlot = CyMap().plotByIndex(i)
				if pPlot.getFeatureType() == -1:
					if pPlot.getImprovementType() == -1:
						if pPlot.isWater() == False:
							iTerrain = pPlot.getTerrainType()
							if iTerrain == iTundra:
								pPlot.setTempTerrainType(iSnow, CyGame().getSorenRandNum(90, "Bob") + 10)
							if iTerrain == iGrass:
								pPlot.setTempTerrainType(iTundra, CyGame().getSorenRandNum(90, "Bob") + 10)
							if iTerrain == iPlains:
								pPlot.setTempTerrainType(iTundra, CyGame().getSorenRandNum(90, "Bob") + 10)
							if iTerrain == iDesert:
								pPlot.setTempTerrainType(iPlains, CyGame().getSorenRandNum(90, "Bob") + 10)

"setTempTerrainType" takes a terrain type that will be applied, followed by an integer number of turns that the terrain will last for. In the original case, Kael has made this duration a Random Number between 0 and 89 + 10 Turns. (so 10-99 turns total).

If you want to make it guaranteed to be longer, change the "10" for a greater value. If you want a chance for it to be longer, change the "90".

Code:
CyGame().getSorenRandNum(180, "Bob") + 20)

would give you a slow thaw over the first 200 turns.

Code:
CyGame().getSorenRandNum(90, "Bob") + CyGame().getSorenRandNum(90, "Bob") + 20)

Would "normalize" the thawing, so that most thawing took place around the 100-120 turn mark, with some occurring before or after (less likely to occur very early or late than with the other method).
 
Thanks!

I saw that section, but I was wrong about what it does. I guess that shows the limits of just guessing. :)

Not adjusted for game speed, it seems. I bet that's why it seemed too short to me.
 
Back
Top Bottom