any tips for mass deletion?

davidlallen

Deity
Joined
Apr 28, 2008
Messages
4,743
Location
California
I have been able to make some progress on a total conversion, but it seems very painful. I want to replace all the techs, units, promotions and buildings, so that there are no "left-overs" of vanilla items in the civilopedia.

I worked on the tech tree first. My tech tree has about 20 items, of which about 15 are similar to existing techs. So I added my five items (easy) and renamed the 15 I wanted. The difficulty came when deleting the other 60-odd techs I don't want. In particular many of the techs I am deleting are the basic ones like TECH_THE_WHEEL.

There are so many other files which reference individual techs. It took many painful rounds of "start the game, let it read the xml, find a missing-definition error, fix it and repeat". For just the tech tree, I needed to modify:

Buildings\CIV4SpecialBuildingInfos.xml
Buildings\CIV4BuildingInfos.xml
Civilizations\CIV4CivilizationInfos.xml
Events\CIV4EventInfos.xml
Events\CIV4EventTriggerInfos.xml
GameInfo\CIV4CivicInfos.xml
GameInfo\CIV4HandicapInfos.xml
GameInfo\CIV4ProjectInfos.xml
GameInfo\CIV4ReligionInfo.xml
Misc\CIV4RouteInfos.xml
Terrain\CIV4BonusInfos.xml
Terrain\CIV4FeatureInfos.xml
Terrain\CIV4ImprovementInfos.xml
Units\CIV4BuildInfos.xml
Units\CIV4PromotionInfos.xml
Units\CIV4UnitInfos.xml

I could find the references using "grep" or similar; but each reference may require a different style of change. For techs, in many cases I needed to set the tech to TECH_FUTURE_TECH (which I left as a disabled tech), so the item would not show up; in other cases I need to replace with NONE, and there is no good way to know which replacement is needed in which case.

I have started to delete the unwanted units from UnitInfos, and now it is dragging me into ArtStyles and who knows where else. I know in some cases there is a better way. There is a very handy bPlayable/bAIPlayable flag to delete civilizations; all you need to do is set two flags and the civ stops showing up in the pedia.

My question is, is there a better way to mass-delete units, buildings and promotions?
 
What you want is what comes to my mind when some says they have a "civ4 editor", but AFAIK no one has done this yet. People just suffer through it... the best you can do is limit the changes to essential ones. For example I changed all the era names, which generates a variety of edits, whereas what would have been easier was to just rename the existing eras in some XML/Text/*xml file.

Artstyles can have extraneous DEFs in it.

The only tool I can offer that may come in handy is this: http://forums.civfanatics.com/showthread.php?p=6243908#post6243908.

One more tip, while commenting out lines in XML *should* work, in civ4 it can result in very odd things in the game. 1 of my wonders gives a free X building in every city, but due to having comments in the XML the actual building given was Y (Y was listed in the pedia as well)!
 
Back
Top Bottom