Modding City Conquest

McMickeroo1

Chieftain
Joined
Jun 8, 2015
Messages
41
Very quick question: Is there are a way to change the effect of conquering cities re: reducing population and destruction of buildings. Is there a way to make it so that conquering cities doesn't cause any change to population or to the buildings? Cheers
 
The population change is hardcoded in the DLL: CvPlayer::acquireCity
For buildings, the capture conditions are checked a few lines below. That logic is mostly based on data loaded from Civ4BuildingInfos.xml, specifically the bNeverCapture and iConquestProb elements. Would be a bit laborious to go through all buildings in XML, but technically very easy to do. If you're comfortable with setting up a development enviroment for the DLL, then changing the DLL code would be quicker and, in a way, cleaner. If that's not an option, then the 1 population could perhaps be added back in a Python script; the DLL fires a city-kept event toward the end of the acquireCity function. Might be tricky (impossible?) to tell in Python whether the city had only 1 population to begin with and therefore hasn't actually lost any.
 
The population change is hardcoded in the DLL: CvPlayer::acquireCity
For buildings, the capture conditions are checked a few lines below. That logic is mostly based on data loaded from Civ4BuildingInfos.xml, specifically the bNeverCapture and iConquestProb elements. Would be a bit laborious to go through all buildings in XML, but technically very easy to do. If you're comfortable with setting up a development enviroment for the DLL, then changing the DLL code would be quicker and, in a way, cleaner. If that's not an option, then the 1 population could perhaps be added back in a Python script; the DLL fires a city-kept event toward the end of the acquireCity function. Might be tricky (impossible?) to tell in Python whether the city had only 1 population to begin with and therefore hasn't actually lost any.
The buildings were the main annoyance, and they weren't actually that hard to fix. Just did a replace thing and it should hopefully work now!

Since I'm here I'll let you know why. I've recently been challenging myself to play an 18 civ multiplayer game with the world map and try to "act out" real world history... it's just a fun project, and something I've discovered is that when you try to act out world history certain territories just get DESTROYED. The biggest examples being France and Spain (conquered by Rome and then retaken by France and then have to fight the Arabs) and Anatolia (Conquered by Persia then Greece then Rome then Arabia then retaken by the crusades etc. etc.) the historically inaccurate consequence of all this is that Spain and France end up really underpowered because they keep having to rebuild their essential buildings and areas that were historically quite valuable become largely worthless due to having a load of maintenance-consuming cities with no useful buildings

Anyway, cheers
 
Top Bottom