Help me start my mod please!

Farmer

Chieftain
Joined
Oct 31, 2001
Messages
15
While I'm not new to modding in general, I am new to modding civ4. (I used to mod Hearts of Iron 2 and other things). Basically the problem I'm having is I know I can technically do anything, but I don't know HOW to do that. I basically need variable defines.

What I'm trying to do has already been done, and I've seen a couple copies online, but none of the ones I've pulled seem to work (maybe not built for BTS). Basically it's a terraform mod. Desert -> Forest Desert, Forest Desert -> Plains, Plains -> Grassland. (still debating the Tundra path, might just follow the civ2 lead). So I guess the question becomes one of how do I change one tile to another, and how do I plant forest? I'm going to try looking at the nuke effects since they like to change tile terrain.

Does such a mod require python coding, or can I use XML alone?
 
Definetely requires python. Python is for events and things like that: If this happens, do that. XML only defines thing put out in other codes. C++ is the main part of the program. For example, you could say that something has a str of 3 in XML, explain what that means in C++, and change it to 9 after the classical age in python.

Back on topic, I think there was a terraformiong mod around here somewhere that you could look at/use
 
It can be done in Python like this.
plot = gc.getMap().plot(X, Y)
plot.setTerrainType(TerrainType, True, True)

Where X,Y is the location of the plot that you want to change. You can get the value needed for TerrainType by doing this:
gc.getInfoTypeForString("TERRAIN_GRASS").
Replace TERRAIN_GRASS with another value to get the Terrain Type for that terrain.

A Forest is a feature not terrain, so you would have to use : plot.setFeatureType(FeatureType, 0)
The second value (the 0) is feature variety.

You can get the Feature Type for forest the same way.
gc.getInfoTypeForString("FEATURE_FORREST").
 
Back
Top Bottom