Working with new map "feature"

Joined
Feb 3, 2011
Messages
608
Greetings.

I have added a new feature "Savanna" to my mod and set it in xml to allow it appear at Grasslands and Plains.
However what happens is that I don't control the altitude, so if there is a plain near far north - my Savanna can easily appear there too. Obviously I need it to appear only in tropical regions like Jungles are.

I understand I need to modify some CvMapGeneratorUtil.py file. I looked at it... and not sure what to do =) Should make a copy of every piece of code that says Jungle and rename it to Savanna? Could some one please help me out?

Thank You!
 
I followed the map making calls between python and the DLL to figure this question out. It looks like you need to modify generateTerrainAtPlot(self,iX,iY) in CvMapGeneratorUtil.py. This function appears to be called for every single plot and will set the terrain for it according to the x,y coordinates. Apparently the map is already created at this point, but the land is "blank" in the sense that it requires the terrain to be set. This means you can rely on certain data, like is it water or land.
 
*facepalm*
I really should read better what you wrote. I focused on Savanna and in WTP that's a terrain, not a feature. Apparently that confused me and I replied regarding adding terrain.

Adding features seems to be done the same way, but using different code. It's in class FeatureGenerator (same file). The most interesting function is addFeaturesAtPlot, which works like generateTerrainAtPlot, except it adds features instead. However you should at least speed read the rest of the class, particularly __init__() and addJunglesAtPlot().
 
Top Bottom