ViterboKnight
Jan 29, 2009, 07:13 AM
How can I set how many rivers there are in a map, in the python map script?
For hills, I've found they're set in the Climate xml file. But I still haven't found how to set rivers.
cephalo
Jan 29, 2009, 09:34 AM
How can I set how many rivers there are in a map, in the python map script?
For hills, I've found they're set in the Climate xml file. But I still haven't found how to set rivers.
It's been a while since I looked at it, but I don't remember any XML variables for rivers. I'm not sure about other map scripters, but in my map scripts I usually have a tuning variable near the beginning to adjust that. I think that most map scripts use a default routine in the SDK that's kinda set in stone.
ViterboKnight
Feb 02, 2009, 02:30 AM
I've found a way to do it.
It's set in the SDK (class CvMapGenerator) and it takes into account these global defines (in the GlobalDefines xml):
PLOTS_PER_RIVER_EDGE (for the number of rivers in a given size of land)
RIVER_SOURCE_MIN_RIVER_RANGE (for the minimum distance between a river source and another river)
RIVER_SOURCE_MIN_SEAWATER_RANGE (for the minimum distance between a river source and the sea)
If you want more rivers, you can simply decrease all these values.
Tholish
Feb 07, 2009, 06:09 PM
I want a map script without rivers. For my Future mod I've created Very High and Very Low sea levels and Harsh climate, but to get really different planets, I need to get rid of rivers. I'm going to try setting PLOTS_PER_RIVER_EDGE to -1 and see what happens. Infinite rivers? No rivers? Crash? It would be nice to have a map script that eliminates rivers while allowing the same mod to run other map scripts that don't. Based on Lakes. So, is it possible to set this variable in a script with Python? I have bad luck with python, but will try that too.
edit:
-As for changing rivers in the mod itself, -1 for Plots per edge didn't get it. This did it.
<Define>
<DefineName>PLOTS_PER_RIVER_EDGE</DefineName>
<iDefineIntVal>10000</iDefineIntVal>
</Define>
<Define>
<DefineName>RIVER_SOURCE_MIN_RIVER_RANGE</DefineName>
<iDefineIntVal>100</iDefineIntVal>
</Define>
<Define>
<DefineName>RIVER_SOURCE_MIN_SEAWATER_RANGE</DefineName>
<iDefineIntVal>100</iDefineIntVal>
</Define>
Almost no rivers. Hah!
LDiCesare
Feb 08, 2009, 12:45 PM
To get zero rivers is quite easy:
Add
def addRivers:
pass
to your map script and you should be done.
Tholish
Feb 08, 2009, 06:12 PM
Actually, that didn't work. This did.
def generateTerrainTypes():
NiTextOut("Generating Terrain (Python Lakes) ...")
terraingen = TerrainGenerator()
terrainTypes = terraingen.generateTerrain()
return terrainTypes
def addRivers():
iPass=1
def addFeatures():
NiTextOut("Adding Features (Python Lakes) ...")
featuregen = FeatureGenerator()
featuregen.addFeatures()
return 0
Vadus
Mar 14, 2009, 02:22 PM
have a look into the BtS Tectonics.py . This is a script, which implements addRivers().. Maybe there must be executed a single line of code, which is needed somehow ..