Map Script Request - remove mountains on fractral map for ffh2

Karnja

Chieftain
Joined
Oct 10, 2008
Messages
84
hello everyone~

i am in need of a script that removes any mountains from a fractal map in ffh2 in mp games. they may be replaced with hills so you can built a mine or something.

for any help thx in advance!
 
In the script, add something like this (roughly, untested):
Code:
def normalizeRemovePeaks():
	map = CyMap()
	mapHeight = map.getGridHeight()
	width = map.getGridWidth()
	height = map.getGridHeight()
	for x in range(width):
		for y in range(height):
			plot = map.plot(x,y)
			if (plot.getPlotType() == PlotTypes.PLOT_PEAK):
				plot.setPlotType(PlotTypes.PLOT_HILLS)
 
can you tell me exactly in which folder and where i have to add this?
 
You need to add this to the .py file corresponding to the map script you want to use. It's one of the .py files in the Public Maps folder in the game installation directory.
 
done as you told me (copy and paste into the fractal.py file, didnt replace anything, just add this) unfortunetly, the mountains are still there. may be even grassland, or grassland hills or plains. just anything (but water) is fine :)
 
Mm. The function I told you to use is only called if normalizeStartingPlotLocations() is also defined.
Replace normalizeRemovePeaks() by afterGeneration() and it should work.
 
#
# FILE: Continents.py
# AUTHOR: Soren Johnson
# PURPOSE: Global map script - Civ4's default map script
#-----------------------------------------------------------------------------
# Copyright (c) 2004, 2005 Firaxis Games, Inc. All rights reserved.
#-----------------------------------------------------------------------------
#

from CvPythonExtensions import *
import CvUtil
import CvMapGeneratorUtil
from CvMapGeneratorUtil import FractalWorld
from CvMapGeneratorUtil import TerrainGenerator
from CvMapGeneratorUtil import FeatureGenerator

def getDescription():
return "TXT_KEY_MAP_SCRIPT_FRACTAL_DESCR"

def isAdvancedMap():
"This map should show up in simple mode"
return 0

def generatePlotTypes():
NiTextOut("Setting Plot Types (Python Fractal) ...")
fractal_world = FractalWorld()
fractal_world.initFractal(rift_grain = -1, has_center_rift = False, polar = True)
return fractal_world.generatePlotTypes()

def generateTerrainTypes():
NiTextOut("Generating Terrain (Python Fractal) ...")
terraingen = TerrainGenerator()
terrainTypes = terraingen.generateTerrain()
return terrainTypes

def addFeatures():
NiTextOut("Adding Features (Python Fractal) ...")
featuregen = FeatureGenerator()
featuregen.addFeatures()
return 0

def afterGeneration():
map = CyMap()
mapHeight = map.getGridHeight()
width = map.getGridWidth()
height = map.getGridHeight()
for x in range(width):
for y in range(height):
plot = map.plot(x,y)
if (plot.getPlotType() == PlotTypes.PLOT_PEAK):
plot.setPlotType(PlotTypes.PLOT_HILLS)

first off all, i really appreciate your work and help! ok that way my fractal.py in the public map folder is looking now. it still doesnt work. i bet im doing something wrong :(
 
Two things.
One: Replace the setPlotType line by this:
plot.setPlotType(PlotTypes.PLOT_HILLS,true,true)
Two:
The file chosen by CIV is a bit weird.
I have Civ IV, Warlords and Beyond the Sword installed.
I run Beyond the Sword.
If I select continents, the continents.py file used is the one in the Warlords directory, not the one in the Civ IV (base) directory. I suppose this is your problem.
 
Thank you alot LDiCesare, looks like it works! you made my day by this, thx alot mate :D :D :D
 
Top Bottom