Hi Munch.....I haven't reached the nuke age yet in my current game...I'm using Carter's Earth mod with "Planetary" size (one larger than huge) and the possibility of 32 nations...my rig is fairly fast, but it still takes about 30-40 seconds per turn especially in the later stages...
I'm thinking we need a "global warming mod" ....I'm wondering if we can use the random events engine to have the old "ice melting, water rises" from an older version of Civ. I could easily see it being triggered by the invention of industrialism....I don't yet know how the events engine works, but I'm going to check it out...perhaps the hard part will be telling the computer which tiles to coastal-ize.
Jeff
EDIT: I believe you are correct about tundra tiles....can only be improved if by a river or hold a resource...I'm not sure about cottages (I've never tried it)
EDIT: I believe you are correct about tundra tiles....can only be improved if by a river or hold a resource...I'm not sure about cottages (I've never tried it)
Cottages can't be constructed on tundra tiles not adjacent to a river, so I reckon those would be destroyed too if a tile with a cottage changes to tundra.
Actually this makes the National Park wonder quite valuable, as it is the only game mechanism that can give some use to tundra tiles again after a climate change.
This was my first XML change EVER!! And it balanced a whole lot of things IMO...
I got the tundra working, and it makes river-side tiles much more important in a post-apopolytic wasteland. The +1 and +1 doesn't kill a city in its tracks, however it still is an annoyance. With biology, by killing your towns, you can now survive mass global warming in every city with no losses, except your GP farm.
Ice IMO is as bad as desert, as you cannot EVER improve on desert, or ice. You can, however, improve on river-side tundra tiles, which is useful.
OK, I've been modding a fair amount with events over the past few weeks, successfully adding plagues for individual civs but not quite yet able to figure things out on a global scale (one would think bGlobal would do it, but I have not been able to figure it out yet as I have not been able to get bGlobal to work for me).....
I'm wondering does anyone know where the global warming mechanics are...they do NOT appear to be in events...I was thinking of adding an asteroid event, but there is no way to do this just usind the XML
I must admit that I find modding this game to be much more of an obtuse affair compared to my modding with games like Medieval Total War II, the Hearts of Iron series, and even going back to Birth of the Federation....yes I'm whining, but I shouldn't have to learn entirely new program languages (Python) to be able to mod right away how I want, whereas the other mentioned games pretty much allow a person to mod almost anything right away (at least as far as game mechanics are concerned).
Global warming is handled by the DLL in CvGame.cpp, there is a method 'doGlobalWarming()' that is not exposed to python. The default implimentation is to loop 'x' times, pick a random land plot that isn't a city and use the global warming probability as a percentage chance to destroy any feature and/or improvement on the plot and change the terrain to the global warming terrain defined in your globals xml file. The doGlobalWarming() method isn't exposed to python but it wouldn't be to hard to add a check for a python override in there.
I've modified global warming myself since the original method is a cheap hack. The 'x' number of times it loops to try and change the terrain is simply the number of nuclear explosions that have occurred in the current game including both nuclear weapons and reactor meltdowns.
As obtuse of an affair as it is, you can do far more with Civ 4 modding than other games allow. The small price to pay is that you need to learn one or two programming languages, both of which are in widespread use so any knowledge gained will be useable elsewhere. Yes, I'm lecturing, but I prefer the flexibility of Civ 4 over the over-simplified and restricted tools included to mod other games.
Where is this file found? Is it in \Sid Meier's Civilization 4\Beyond the Sword\CvGameCoreDLL (or is that a folder I made up when messing with the files) ...?
Also, am I right in thinking you don't have to compile these .cpp files, and that just editing and saving is enough?
Global warming is handled by the DLL in CvGame.cpp, there is a method 'doGlobalWarming()' that is not exposed to python. The default implimentation is to loop 'x' times, pick a random land plot that isn't a city and use the global warming probability as a percentage chance to destroy any feature and/or improvement on the plot and change the terrain to the global warming terrain defined in your globals xml file. The doGlobalWarming() method isn't exposed to python but it wouldn't be to hard to add a check for a python override in there.
I've modified global warming myself since the original method is a cheap hack. The 'x' number of times it loops to try and change the terrain is simply the number of nuclear explosions that have occurred in the current game including both nuclear weapons and reactor meltdowns.
As obtuse of an affair as it is, you can do far more with Civ 4 modding than other games allow. The small price to pay is that you need to learn one or two programming languages, both of which are in widespread use so any knowledge gained will be useable elsewhere. Yes, I'm lecturing, but I prefer the flexibility of Civ 4 over the over-simplified and restricted tools included to mod other games.
PS...hmmmm, I looked through my "CVgame" files (represented as text files in my CvGameCoreDLL folder) and had no luck finding "doGlobalWarming()".....but it may be only some of the files from the master DLL file....I probably need a decompiler or something to that effect.....
Yes, unfortunately you will need to compile the DLL to see your changes in the game. It is burried in CvGame.cpp, here's the entire doGlobalWarming() method:
Spoiler:
Code:
void CvGame::doGlobalWarming()
{
CvCity* pCity;
CvPlot* pPlot;
CvWString szBuffer;
TerrainTypes eWarmingTerrain;
bool bChanged;
int iI;
eWarmingTerrain = ((TerrainTypes)(GC.getDefineINT("GLOBAL_WARMING_TERRAIN")));
for (iI = 0; iI < getNukesExploded(); iI++)
{
if (getSorenRandNum(100, "Global Warming") < GC.getDefineINT("GLOBAL_WARMING_PROB"))
{
pPlot = GC.getMapINLINE().syncRandPlot(RANDPLOT_LAND | RANDPLOT_NOT_CITY);
if (pPlot != NULL)
{
bChanged = false;
if (pPlot->getTerrainType() != eWarmingTerrain)
{
if (pPlot->calculateTotalBestNatureYield(NO_TEAM) > 1)
{
pPlot->setTerrainType(eWarmingTerrain);
bChanged = true;
}
}
if (pPlot->getFeatureType() != NO_FEATURE)
{
if (pPlot->getFeatureType() != GC.getDefineINT("NUKE_FEATURE"))
{
pPlot->setFeatureType(NO_FEATURE);
bChanged = true;
}
}
if (bChanged)
{
pPlot->setImprovementType(NO_IMPROVEMENT);
pCity = GC.getMapINLINE().findCity(pPlot->getX_INLINE(), pPlot->getY_INLINE());
if (pCity != NULL)
{
if (pPlot->isVisible(pCity->getTeam(), false))
{
szBuffer = gDLL->getText("TXT_KEY_MISC_GLOBAL_WARMING_NEAR_CITY", pCity->getNameKey());
gDLL->getInterfaceIFace()->addMessage(pCity->getOwnerINLINE(), false, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_GLOBALWARMING", MESSAGE_TYPE_INFO, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pPlot->getX_INLINE(), pPlot->getY_INLINE(), true, true);
}
}
}
}
}
}
}
Now, if all you want to do is add an event that increases the chances of global warming all you need to do is increase the recorded number of nuclear explosions. You have two functions for this, both are exposed to python. They are also in CvGame.cpp if you want to see them but all they do is get & set a member variable on the game object. The two methods are:
int getNukesExploded() const;
This simply returns the current count of nuclear explosions. For global warming this is how many tiles can potentially be affected each turn.
void changeNukesExploded(int iChange);
This is normally called when a nuke explodes with the arg (iChange) as 1, like; changeNukesExploded(1); It's not an unsigned int so negative numbers should work if you ever want to decrease the global warming effect just be sure to use getNukesExploded() to make sure you don't change the counter below zero as they might not have error handling for that in there I haven't look that closely.
In python these can both be called using the game object, this is from memory so double check it before you try it but it should be as simple as something like:
game = GC.getGame()
game.changeNukesExploded(10)
Or to reduce the count by three for example:
change = 0 - min(game.getNukesExploded(),3)
game.changeNukesExploded(change)
I don't remember if you get the game object with getGame() or something else. FYI, min() returns the lowest of the two args so it's a good way of establishing a max value and max() returns the highest so it works to establish a minimum value. Yes, they're backwards but thats how us programming types think
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.