Overwriting ome Normalizie functions

Astax

Prince
Joined
Oct 27, 2005
Messages
556
Hi. I added some code to a map script to replace all plains cows with grassland deer in forest. It works great EXCEPT for some instances of plains cow near starting settler. Now my problem is I don't know if it a) I can't alter terrain in view of the units, or b) it was added there by some default normalizing routine. If it's b, can anyone tell me what and how I overwrite it? if it's a, anyone got any ideas how to remedy this?

I put the code in def findStartingPlot(argsList)

Code:
	map = CyMap()
	userInputPlots = map.getCustomMapOption(0)
	
	iW = map.getGridWidth()
	iH = map.getGridHeight()

	seaCheck = map.getSeaLevel()
	tvbCheck = map.getCustomMapOption(0) 
	
	if (seaCheck == 0) and (tvbCheck == 1):
		for y in range(iH):
			for x in range(iW):
				pPlot = map.plot(x,y)
				if pPlot.getTerrainType() == 1:
					if pPlot.getBonusType(-1) == 12: 
						pPlot.setBonusType(-1)
						pPlot.setTerrainType(0, true, true)
						pPlot.setFeatureType(4, 1)
						pPlot.setBonusType(14)
 
try adding this into your map script:

Code:
def normalizeAddFoodBonuses():
	return None
 
I'll try that thnx! Is there one for adding additional lakes as freshwater sources? I'd love to overwrite that too maybe.

Update: It works but then it is possible to start without food. This sucks. I would love to have a way to tweak the normalizer so that it does not place the plains cow, just every other food it normally places. Anyone have a python version of the original normalizeAddFoodBonuses() function? I would assume it's somewhere written in C.

Alternately I guess I can rewrite the part that searches for your starting plot to make sure it is deemed invalid if there is no food.
 
Top Bottom