removing rivers on map generation

keldath

LivE LonG AnD PrOsPeR
Joined
Dec 20, 2005
Messages
7,367
Location
israel
hi,
hope this is the right place to ask for this help,

im working on a mod - named dune wars,

and i need a code,
that will remove rivers to be created on the map (also lakes),

and furthur more, perhaps replacing the river model by another thing,

thanks in advance,
kel.
 
I did several scripts for my FutureMod, based on other planets with cratered terrain without water interspersed with bands of Space passable only by spacecraft, except that in many there is an earthlike area with rivers and lakes and seas. For that I did this.

I used this right under the part about x and y wrap:

def addLakes():
iPass=1

def addRivers():
iPass=1

and this right at the end after add features

def normalizeAddRiver():
iPass=1

def normalizeRemovePeaks():
iPass=1

def normalizeAddLakes():
iPass=1

If you leave out the normalize stuff you get them generated, but only added in as an afterthought near where players start. Which you can also dictate with this

def findStartingPlot(argsList):
[playerID] = argsList

def isValid(playerID, x, y):

if x <87:
return False

if x >115:
return False

return True

return CvMapGeneratorUtil.findStartingPlot(playerID, isValid)

Of course, basing this on absolute x values is my crude but effective way for a solar system map, but more sophisticated versions are possible that determine relative position on the map, probably copyable from numerous scripts that do this sort of stuff. If you allow normalized rivers, you have to isolate the player start region with something that will prevent rivers from crawling all the way across the map, such as a sea for them to terminate in. There are more sophisticated ways to do this I'm sure, such as finding what makes rivers stop when they reach sea and having them do that for some other terrain.
 
thanks for the reply first,

but,
where do you mean me to add those lines?
which file?

also,
can i define a river how big i want it - i wanna make a square river - say like a square model that the surronding tile will act like near river tiles - like floodplains.

:)
 
These have to go in a python map script, not the dll. In my post I stated more or less where they go. You take an existing map script, rename it, put it in a folder PrivateMaps outside assets and stick the lines in so the default code for map generation is replaced by this code. I used the Highlands Map script as a base for most of mine. Making rivers run square is a little more complicated. Maybe you could copy from Oasis, it messes with rivers a lot. Or you could maybe use my simple x coordinate abuse and define ranges for rivers so that they only can occur every other square, thus giving you all these vertical rivers. Here's one of my scripts for FutureMod (it won't work without the mod because it refers to terrains that don't exist, but you can use it as a reference for where things go).
 

Attachments

  • SolarSystem.zip
    4.4 KB · Views: 49
Top Bottom