Trouble with CvMapGeneratorUtil in my mod

Argordon

Chieftain
Joined
Mar 11, 2014
Messages
2
Location
Ontario, Canada
This is my very first post, so please.... a little mercy if it is not in the right section.

I have been playing Civ4/BTS for....years.... and have been modding a long time but not in PYTHON. So, I am a little confused as to this particular problem I am having:

Background:
My BTS mod works great - no problems - it loads and the game runs and stability is fine. HOWEVER, I have been trying to add new terrain/features to the game. I wanted a "marsh" feature that would allow players to clear the marsh (drain marsh) and make use of underlying terrain (similar to forests).
Step 1 - I created my marsh feature and added it appropriately and it works great!
Step 2 - Now to make modifications to the Python file CvMapGeneratorUtil.py so that there are some minor mods and a little less desert on my maps... HERE IS WHERE THE PROBLEM BEGINS...

Problem:
a) I went to the source directory for Civ4, which is the only spot I was able to find the CvMapGeneratorUtil.py file.
b) I copied the CvMapGeneratorUtil.py file
c) I pasted it into my mod in the sub-directory: "MyMod"/Assets/Python. This appears to be the norm and I looked at other mods that have done similar (e.g.: Caveman2Cosmos)
d) When I run the game now.... it functions BUT... when I play a Custom Game, every time I select a map type that has a large amount of congruous land (Continent/Custom Continent/Fractal/etc.) the map that is generated is 100%, every tile (and I mean EVERY tile) is grassland... no ice, no plains, no tundra, no ocean, no coast... no other features on the map except for my beautiful marsh, some bonuses, and long rivers. The ONLY spots where this is different is in the immediate area (3x3 square) that you can visibly see around your units when the map first loads up (in that area, there is some forest, hills, lakes, etc....looks normal... until you go to WorldBuilder and view the overall map and see this GIANT grass map).

Other notes:
1) if I remove the CvMapGeneratorUtil.py file from my Python folder, the mod functions fine again. The maps all are generated fine and my new Marsh feature is properly included with each new map generation (how I do not know, since nothing I can see tells the game to seed the new feature in new maps..., but hey, it works).
2) I need to be able to add a new Terrain that I have worked on and I must have a working CvMapGeneratorUtil.py to tell the game how to generate new games using the new terrain.
3) this odd behaviour does NOT seem to occur when I select a map that is Islands or Archipelago... so, I am wondering if there is some oddity within the CvMapGeneratorUtil.py itself that is selecting a strange map generation code...?
4) The Civ4 version that I took the CvMapGeneratorUtil.py file from is 3.19

I am stymied.... Anyone got a clue why this errata may be occurring? Is there another file that I have to work on, to change how the game generates maps? :confused:
 
In short, whatever changes you did in the new file is screwed, so the map generated is screwed.

Certain maps like Arboria, have their own set of generation codes in their own file. Thus, loading those maps will not be affected, while maps that load using default codes are screwed.
 
ok.... what I will try is to remove my mod files to the state previous and see if I still get the error with map generation... It seems a long shot, but it may at least help me narrow down where the problem is.
 
If you work on Map Scripts and anything else in Python, you'd better get Python exceptions enabled.

If you don't know what I mean by enabling Python exceptions:

under My Documents/My Games/Beyond the Sword folder (or similar), you have a file called CivilizationIV.ini. Change the file like this:

; Set to 1 for no python exception popups
HidePythonExceptions = 0

The 0 setup will bring popups ingame if there are Python problems.
 
There is a CvMapGeneratorUtil.py in the Warlords\Assets\Python. That would be the one to use, not the one in the base Civ4.

It is not changed much, but it may be what you need.
 
Why use the one in Warlords when a newer one is in BTS?
 
? I don't have a newer one in BtS.
 
Back
Top Bottom