1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[TUTORIAL] Modular XML Modding With A New Dawn

Discussion in 'Rise of Mankind: A New Dawn' started by Hydromancerx, Feb 20, 2010.

  1. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    So since Afforess and many others are leaving civ 4 to work on civ 5 in the near future I still want to create the buildings that I requested. This means I must make them myself. So far I have understood making icons and game text. However much of the rest is a mystery to me. Could someone post a starter building for me to work off of?

    I tried to use the zoo but it had specialized sounds and its own building. I need a base building that has just an icon and no building mesh.

    Note my first project is a "town well".

    Town Well
    Cost: 50
    Health: +1

    Requires: Pottery, Masonry

    Obsolete: Invention

    Special Abilities
    • 5% Maintenance
    • +1 Health with Public Works.
    • Double production speed for Agricultural leaders.
    • Upgraded by Artesian Well
    • Provides Fresh Water

    Could someone please walk me through it please?

    So far I have the icon and text file done.

    I would like to be self sufficient before all the modders leave for civ 5.
     
  2. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Sure. This seems like a good example. I'm going to make this a modular tutorial.

    The Basics:

    Let's start with the basics. There are a few key components of each buildings:

    1. The Artwork. In this case, just a button.

    2. The BuildingClass. This is where if the building is a NW or WW is controlled.

    3. The BuildingInfo. This is the meat and gravy of the building.

    4. The Text. Self-Explanatory.

    5. Any Art. (Buttons, etc...)

    Setup:

    Let's start from the ground and build up. It's easiest to start from a empty building.
    Create a folder in an easy place on your computer (Like your desktop) We need to copy the needed files, so open the Assets folder inside of RoM. Then, inside the XML folder, Find the Buildings folder, and copy 3 files. The CIV4BuildingsSchema, the CIV4BuildingInfos, and the CIV4BuildingClassInfos to your new folder.

    Great, now we need to get the Art files. In the Art folder (inside the main assets folder), copy the CIV4ArtDefinesSchema and the CIV4ArtDefines_Building.


    Now, we need to clean these files out. I'm assuming you already have a decent text editor. If not, I HIGHLY recommended Notepad++; it's free and very useful.

    First, let's clean out the Civ4BuildingClassInfos. Since we are making only 1 building, we only need 1 entry. The Palace's will do. But before we begin, a brief seg-way on how XML files work:

    XML Segway:

    XML files are marked by several key parts. Let's use the first few lines of the BuildingClassInfos as an example:

    Code:
    [COLOR="SeaGreen"]<?xml version="1.0"?>
    <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
    <!-- Sid Meier's Civilization 4 -->
    <!-- Copyright Firaxis Games 2005 -->
    <!-- -->
    <!-- Building Class Infos -->[/COLOR]
    [COLOR="Red"]<Civ4BuildingClassInfos xmlns="x-schema:CIV4BuildingsSchema.xml">[/COLOR]
    	[COLOR="Blue"]<BuildingClassInfos>[/COLOR]
    		[COLOR="Orange"]<BuildingClassInfo>[/COLOR]
    			<Type>BUILDINGCLASS_PALACE</Type>
    			<Description>TXT_KEY_BUILDING_PALACE</Description>
    			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
    			<iMaxTeamInstances>-1</iMaxTeamInstances>
    			<iMaxPlayerInstances>1</iMaxPlayerInstances>
    			<iExtraPlayerInstances>1</iExtraPlayerInstances>
    			<bNoLimit>1</bNoLimit>
    			<bMonument>0</bMonument>
    			<DefaultBuilding>BUILDING_PALACE</DefaultBuilding>
    			<VictoryThresholds/>
    		[COLOR="orange"]</BuildingClassInfo>[/COLOR]
    		[COLOR="orange"]<BuildingClassInfo>[/COLOR]
    			<Type>BUILDINGCLASS_GREAT_PALACE</Type>
    			<Description>TXT_KEY_BUILDING_GREAT_PALACE</Description>
    			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
    			<iMaxTeamInstances>-1</iMaxTeamInstances>
    			<iMaxPlayerInstances>1</iMaxPlayerInstances>
    			<iExtraPlayerInstances>0</iExtraPlayerInstances>
    			<bNoLimit>0</bNoLimit>
    			<bMonument>0</bMonument>
    			<DefaultBuilding>BUILDING_GREAT_PALACE</DefaultBuilding>
    			<VictoryThresholds/>
    		[COLOR="orange"]</BuildingClassInfo>[/COLOR]
    The green text is called "Comments". It is ignored by the game. It is just text left by other programmers, for other programmers. Comments in XML start with <!-- and end with a -->,

    Note:
    The red line indicates the start of the file, and the name of the schema file. The game uses schema files to inteprete the XML into machine language. Most modders will not need to edit Schema's unless they are adding new XML tags in the SDK.

    The Blue indicates the main body of the XML file.

    The Orange is the start and end of each section. The first section is for the Palace, the next for Forbidden Palace.

    Tangent:
    One of the things you may notice quickly is that the names in the XML do not always match the names in game. Firaxis, and many programmers, myself included, often change the names mid-version, but don't change the XML out of laziness, only changing description in the Text files. This may make finding objects harder for others. For example, the Technology "Agricultural Engineering" is labeled "PESTICIDES" in the XML. You will often have to work backwards to catch these objects.

    Back to cleaning the files out.
    We only are modding 1 building, so Delete the rest of the information after the first </BuildingClassInfo>. (Hint: the forward slash normally indicates an end to a section of XML).

    When your BuildingClassInfos is clean, it should look like this:

    Code:
    <?xml version="1.0"?>
    <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
    <!-- Sid Meier's Civilization 4 -->
    <!-- Copyright Firaxis Games 2005 -->
    <!-- -->
    <!-- Building Class Infos -->
    <Civ4BuildingClassInfos xmlns="x-schema:CIV4BuildingsSchema.xml">
    	<BuildingClassInfos>
    		<BuildingClassInfo>
    			<Type>BUILDINGCLASS_PALACE</Type>
    			<Description>TXT_KEY_BUILDING_PALACE</Description>
    			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
    			<iMaxTeamInstances>-1</iMaxTeamInstances>
    			<iMaxPlayerInstances>1</iMaxPlayerInstances>
    			<iExtraPlayerInstances>1</iExtraPlayerInstances>
    			<bNoLimit>1</bNoLimit>
    			<bMonument>0</bMonument>
    			<DefaultBuilding>BUILDING_PALACE</DefaultBuilding>
    			<VictoryThresholds/>
    		</BuildingClassInfo>
    	</BuildingClassInfos>
    </Civ4BuildingClassInfos>
    
    Note the bottom. Make sure that there is a closing tag for each opening one. Otherwise, your file will not load.

    To Be Continued...
     
  3. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    Sorry if i sound like a dummy already but where exactly?

    I am in ".../Rise of Mankind/Assets". Then I see art, config, modules, python, res, sounds, unloaded modules and xml. Should I be here or should I be in ".../Rise of Mankind/Assets/Modules"?
     
  4. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Great, 1 file clean, 2 to go.

    I'm going to let you try cleaning the Civ4ArtDefines_Building and Civ4BuildingInfos out by yourself. Once you are done, you can compare them against the correctly cleaned files:
    Spoiler Civ4BuildingInfos.xml :

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by lcollins (Firaxis Games) -->
    <!-- Sid Meier's Civilization 4 -->
    <!-- Copyright Firaxis Games 2005 -->
    <!-- -->
    <!-- Building Infos -->
    <Civ4BuildingInfos xmlns="x-schema:Afforess_CIV4BuildingsSchema.xml">
    	<BuildingInfos>
    		<BuildingInfo>
    			<BuildingClass>BUILDINGCLASS_PALACE</BuildingClass>
    			<Type>BUILDING_PALACE</Type>
    			<SpecialBuildingType>NONE</SpecialBuildingType>
    			<Description>TXT_KEY_BUILDING_PALACE</Description>
    			<Civilopedia>TXT_KEY_BUILDING_PALACE_PEDIA</Civilopedia>
    			<Strategy>TXT_KEY_BUILDING_PALACE_STRATEGY</Strategy>
    			<Advisor>ADVISOR_ECONOMY</Advisor>
    			<ArtDefineTag>ART_DEF_BUILDING_PALACE</ArtDefineTag>
    			<MovieDefineTag>NONE</MovieDefineTag>
    			<HolyCity>NONE</HolyCity>
    			<ReligionType>NONE</ReligionType>
    			<StateReligion>NONE</StateReligion>
    			<bStateReligion>0</bStateReligion>
    			<PrereqReligion>NONE</PrereqReligion>
    			<PrereqCorporation>NONE</PrereqCorporation>
    			<FoundsCorporation>NONE</FoundsCorporation>
    			<GlobalReligionCommerce>NONE</GlobalReligionCommerce>
    			<GlobalCorporationCommerce>NONE</GlobalCorporationCommerce>
    			<VictoryPrereq>NONE</VictoryPrereq>
    			<FreeStartEra>NONE</FreeStartEra>
    			<MaxStartEra>NONE</MaxStartEra>
    			<ObsoleteTech>NONE</ObsoleteTech>
    			<PrereqTech>NONE</PrereqTech>
    			<TechTypes/>
    			<Bonus>NONE</Bonus>
    			<PrereqBonuses/>
    			<ProductionTraits/>
    			<HappinessTraits/>
    			<NoBonus>NONE</NoBonus>
    			<PowerBonus>NONE</PowerBonus>
    			<FreeBonus>NONE</FreeBonus>
    			<iNumFreeBonuses>0</iNumFreeBonuses>
    			<FreeBuilding>NONE</FreeBuilding>
    			<FreePromotion>NONE</FreePromotion>
    			<CivicOption>NONE</CivicOption>
    			<GreatPeopleUnitClass>NONE</GreatPeopleUnitClass>
    			<iGreatPeopleRateChange>0</iGreatPeopleRateChange>
    			<iHurryAngerModifier>0</iHurryAngerModifier>
    			<bBorderObstacle>0</bBorderObstacle>
    			<bTeamShare>0</bTeamShare>
    			<bWater>0</bWater>
    			<bRiver>0</bRiver>
    			<bPower>0</bPower>
    			<bDirtyPower>0</bDirtyPower>
    			<bAreaCleanPower>0</bAreaCleanPower>
    			<DiploVoteType>NONE</DiploVoteType>
    			<bForceTeamVoteEligible>0</bForceTeamVoteEligible>
    			<bCapital>1</bCapital>
    			<bGovernmentCenter>1</bGovernmentCenter>
    			<bGoldenAge>0</bGoldenAge>
    			<bAllowsNukes>0</bAllowsNukes>
    			<bMapCentering>0</bMapCentering>
    			<bNoUnhappiness>0</bNoUnhappiness>
    			<bNoUnhealthyPopulation>0</bNoUnhealthyPopulation>
    			<bBuildingOnlyHealthy>0</bBuildingOnlyHealthy>
    			<bNeverCapture>0</bNeverCapture>
    			<bNukeImmune>1</bNukeImmune>
    			<bPrereqReligion>0</bPrereqReligion>
    			<bCenterInCity>0</bCenterInCity>
    			<iAIWeight>0</iAIWeight>
    			<iCost>160</iCost>
    			<iHurryCostModifier>50</iHurryCostModifier>
    			<iAdvancedStartCost>-1</iAdvancedStartCost>
    			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
    			<iMinAreaSize>-1</iMinAreaSize>
    			<iConquestProb>0</iConquestProb>
    			<iCitiesPrereq>4</iCitiesPrereq>
    			<iTeamsPrereq>0</iTeamsPrereq>
    			<iLevelPrereq>0</iLevelPrereq>
    			<iMinLatitude>0</iMinLatitude>
    			<iMaxLatitude>90</iMaxLatitude>
    			<iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
    			<iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
    			<iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
    			<iGlobalGreatPeopleRateModifier>0</iGlobalGreatPeopleRateModifier>
    			<iAnarchyModifier>0</iAnarchyModifier>
    			<iGoldenAgeModifier>0</iGoldenAgeModifier>
    			<iGlobalHurryModifier>0</iGlobalHurryModifier>
    			<iExperience>0</iExperience>
    			<iGlobalExperience>0</iGlobalExperience>
    			<iFoodKept>0</iFoodKept>
    			<iAirlift>0</iAirlift>
    			<iAirModifier>0</iAirModifier>
    			<iAirUnitCapacity>0</iAirUnitCapacity>
    			<iNukeModifier>0</iNukeModifier>
    			<iNukeExplosionRand>0</iNukeExplosionRand>
    			<iFreeSpecialist>0</iFreeSpecialist>
    			<iAreaFreeSpecialist>0</iAreaFreeSpecialist>
    			<iGlobalFreeSpecialist>0</iGlobalFreeSpecialist>
    			<iMaintenanceModifier>0</iMaintenanceModifier>
    			<iWarWearinessModifier>0</iWarWearinessModifier>
    			<iGlobalWarWearinessModifier>0</iGlobalWarWearinessModifier>
    			<iEnemyWarWearinessModifier>0</iEnemyWarWearinessModifier>
    			<iHealRateChange>0</iHealRateChange>
    			<iHealth>0</iHealth>
    			<iAreaHealth>0</iAreaHealth>
    			<iGlobalHealth>0</iGlobalHealth>
    			<iHappiness>1</iHappiness>
    			<iAreaHappiness>0</iAreaHappiness>
    			<iGlobalHappiness>0</iGlobalHappiness>
    			<iStateReligionHappiness>0</iStateReligionHappiness>
    			<iWorkerSpeedModifier>0</iWorkerSpeedModifier>
    			<iMilitaryProductionModifier>0</iMilitaryProductionModifier>
    			<iSpaceProductionModifier>0</iSpaceProductionModifier>
    			<iGlobalSpaceProductionModifier>0</iGlobalSpaceProductionModifier>
    			<iTradeRoutes>0</iTradeRoutes>
    			<iCoastalTradeRoutes>0</iCoastalTradeRoutes>
    			<iGlobalTradeRoutes>0</iGlobalTradeRoutes>
    			<iTradeRouteModifier>0</iTradeRouteModifier>
    			<iForeignTradeRouteModifier>0</iForeignTradeRouteModifier>
    			<iGlobalPopulationChange>0</iGlobalPopulationChange>
    			<iFreeTechs>0</iFreeTechs>
    			<iDefense>0</iDefense>
    			<iBombardDefense>0</iBombardDefense>
    			<iAllCityDefense>0</iAllCityDefense>
    			<iEspionageDefense>0</iEspionageDefense>
    			<iAsset>0</iAsset>
    			<iPower>0</iPower>
    			<fVisibilityPriority>10000.0</fVisibilityPriority>
    			<SeaPlotYieldChanges/>
    			<RiverPlotYieldChanges/>
    			<GlobalSeaPlotYieldChanges/>
    			<YieldChanges>
    				<iYield>0</iYield>
    				<iYield>0</iYield>
    				<iYield>8</iYield>
    			</YieldChanges>
    			<CommerceChanges>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>4</iCommerce>
    			</CommerceChanges>
    			<ObsoleteSafeCommerceChanges>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>2</iCommerce>
    			</ObsoleteSafeCommerceChanges>
    			<CommerceChangeDoubleTimes/>
    			<CommerceModifiers/>
    			<GlobalCommerceModifiers/>
    			<SpecialistExtraCommerces/>
    			<StateReligionCommerces/>
    			<CommerceHappinesses/>
    			<ReligionChanges/>
    			<SpecialistCounts/>
    			<FreeSpecialistCounts/>
    			<CommerceFlexibles/>
    			<CommerceChangeOriginalOwners/>
    			<ConstructSound/>
    			<BonusHealthChanges/>
    			<BonusHappinessChanges/>
    			<BonusProductionModifiers/>
    			<UnitCombatFreeExperiences/>
    			<DomainFreeExperiences/>
    			<DomainProductionModifiers/>
    			<BuildingHappinessChanges/>
    			<PrereqBuildingClasses/>
    			<BuildingClassNeededs/>
    			<SpecialistYieldChanges/>
    			<BonusYieldModifiers/>
    			<ImprovementFreeSpecialists/>
    			<Flavors/>
    			<HotKey/>
    			<bAltDown>0</bAltDown>
    			<bShiftDown>0</bShiftDown>
    			<bCtrlDown>0</bCtrlDown>
    			<iHotKeyPriority>0</iHotKeyPriority>
    		</BuildingInfo>
    	</BuildingInfos>
    </Civ4BuildingInfos>
    


    Spoiler Civ4ArtDefines_Building :
    Code:
    <?xml version="1.0"?>
    <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Firaxis Games (Firaxis Games) -->
    <!-- Sid Meier's Civilization 4 -->
    <!-- Copyright Firaxis Games 2005 -->
    <!-- -->
    <!-- Building art path information -->
    <Civ4ArtDefines xmlns="x-schema:CIV4ArtDefinesSchema.xml">
    	<BuildingArtInfos>
    		<BuildingArtInfo>
    			<Type>ART_DEF_BUILDING_PALACE</Type>
    			<LSystem>LSYSTEM_PALACE</LSystem>
    			<bAnimated>0</bAnimated>
    			<fScale>1.15</fScale>
    			<fInterfaceScale>0.43</fInterfaceScale>
    			<NIF>Art/Structures/Buildings/Palace/Palace.nif</NIF>
    			<KFM/>
    			<Button>,Art/Interface/Buttons/Buildings/Palace.dds,Art/Interface/Buttons/Buildings_Atlas.dds,6,5</Button>
    		</BuildingArtInfo>
    	</BuildingArtInfos>
    </Civ4ArtDefines>
    


    Great, now we can get to some real work.

    BuildingClassInfos

    Let's start by setting up the Town Well's Building Class Info.

    The First tag we encounter that needs new data is the <Type> tag. Replace the BUILDINGCLASS_PALACE with a new name. It doesn't matter what, but it should pertain to your building in some way. For this one, let's use BUILDINGCLASS_TOWN_WELL.

    (WARNING: DO NOT USE SPACES IN NAMES IN XML. THE GAME ENGINE CAN NOT READ WHITESPACE!!!!)

    The next tag is the Description. We will be filling this out later, but we still need a valid entry here. Again, this tag should pertain losely to your building, or looking up info in the future will be a PITA. Replace TXT_KEY_BUILDING_PALACE with TXT_KEY_BUILDING_TOWN_WELL.

    Now, the next lines are a bit different.

    Let's examine <iMaxGlobalInstances> for a moment. See the first letter? It's using a notation in programming, Hungarian Notation. What this simply means is that the first letter indicates the type of variable that should go in the field. An "i" means integer. (Whole Numbers).

    Now, back to the tag. I have no idea what this tag does. What should I do? Well, there is documention for nearly every XML file. Go to the Modiki from the bar above, and look at the XML reference. Head to buildings, then BuildingClassInfos.

    The information we find is right here


    This shows that <iMaxGlobalInstances> is the number of buildings of this class that can exist in the world at 1 time. Since this is a regular buildings, we don't care how many are built, but we don't want to guess with some high value like 999999. Instead, Civilization 4 frequently uses -1 as a marker. Entering -1 in this field will allow unlimited number of this building.

    Since we aren't making a wonder, -1 will do for the remaining 3 tags as well.

    The next tag is a new one, a boolean tag. Boolean means true or false. Only 1 or 0 values are accepted (1 = true, 0 = false).

    bNoLimit asks if the city has a limit on the number of this building for the city. Since it would be odd if a city 10 Town Wells, set bNoLimit to 0. Basically, in English, this means :There is no no limit, or there is a limit.

    bMonument is a left-over tag from some idea Firaxis never finished. It's value has no effect on the game, so just leave it alone.

    The Last tag specifies the default building. This is used for Unique Buildings. For Example, the Forge has a default building of BUILDING_FORGE, but the Mali have a UB, the Mint. Now, the Mint is actually the same Building Class, but a different building.

    A Building class is the broader term for a building, while the Building is civilization specific.

    Setting the Default Building to BUILDING_TOWN_WELL seems reasonable.


    Review

    Here is what your BuildingClassInfo should look like after this point:

    Code:
    <?xml version="1.0"?>
    <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
    <!-- Sid Meier's Civilization 4 -->
    <!-- Copyright Firaxis Games 2005 -->
    <!-- -->
    <!-- Building Class Infos -->
    <Civ4BuildingClassInfos xmlns="x-schema:CIV4BuildingsSchema.xml">
    	<BuildingClassInfos>
    		<BuildingClassInfo>
    			<Type>BUILDINGCLASS_TOWN_WELL</Type>
    			<Description>TXT_KEY_BUILDING_TOWN_WELL</Description>
    			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
    			<iMaxTeamInstances>-1</iMaxTeamInstances>
    			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
    			<iExtraPlayerInstances>-1</iExtraPlayerInstances>
    			<bNoLimit>0</bNoLimit>
    			<bMonument>0</bMonument>
    			<DefaultBuilding>BUILDING_TOWN_WELL</DefaultBuilding>
    			<VictoryThresholds/>
    		</BuildingClassInfo>
    	</BuildingClassInfos>
    </Civ4BuildingClassInfos>
     
  5. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    The XML folder. ;)
     
  6. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    Part 1 Response

    - CIV4BuildingsSchema - CHECK
    - CIV4BuildingInfos - CHECK
    - CIV4BuildingClassInfos - CHECK

    - CIV4ArtDefinesSchema - CHECK
    - CIV4ArtDefines_Building - CHECK

    - Text Editor - I just have notepad but I have edited code before with it so even though it is not fancy it still works. Maybe I will upgrade to notepad ++ in the future but for now I want to battle one thing at a time.

    - XML Overview - Most of that I already knew from past modding and of course editing the text files.

    - Civ4BuildingClassInfo Cleaning - CHECK

    - Tangent - This is good to know.

    So far so good and I understand all of what you mean and its coming back to me most of the coding jargon.

    End of Part 1 Response
     
  7. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    BuildingInfos

    Into the meat of the building. Watch out, this file is much longer, and much easier to get lost.

    The first line we encounter is the BuildingClass. This must EXACTLY match the one listed in your last file, in our case, BUILDINGCLASS_TOWN_WELL.

    The next building lists the type of building. Since this is not a UB, this should match the default building from our last file, in our case. BUILDING_TOWN_WELL.

    The next line is for special buildings. There are very few of these, usually only monasteries or in rare cases, Wonders. Leave it as NONE.

    The description should also match the description in the last file, TXT_KEY_BUILDING_TOWN_WELL.

    The Civilopedia entry is another entry to a text file, but for a Civilopedia article. The general rule of thumb is to use the same entry as your description, and append a _PEDIA to it; so we should use TXT_KEY_BUILDING_TOWN_WELL_PEDIA.

    The strategy text is the "Sid's Tips" line that players seen when hovering over the construction queue. The rule of thumb here is to use the same entry for the description, but append a _STRATEGY to it. In our case, it should be TXT_KEY_BUILDING_TOWN_WELL_STRATEGY.

    The next line is the advisor that will popup and recommend this building. There are a few advisors you can pick from.

    Code:
    ADVISOR_ECONOMY
    ADVISOR_GROWTH
    ADVISOR_MILITARY
    ADVISOR_SCIENCE
    ADVISOR_CULTURE
    ADVISOR_RELIGION
    Don't put anything other than one of those 6 pre-defined ones. They are all hardcoded in the SDK.

    For our purposes, ADVISOR_GROWTH makes the most sense.


    The next tag is for the Art. We haven't made one, but we can pick a name anyway. Hopefully you are picking up on the trend here, and use ART_DEF_BUILDING_TOWN_WELL.

    Movie Define tag is only used for Wonders. Adding one to a regular building will have no effect, so we can leave it as NONE...

    I'm going to do this in two passes. First pass, we will clean up left-behind information from the Palace. Second Pass, we will add our intended values.

    BuildingInfos - Pass 1

    The next batch of tags are not useful for our purposes, but if you are curious, the Modiki shows what they are used for. You can also look up other buildings that use them to see how they work.

    Skim down until you reach these lines:
    Code:
    			<bCapital>1</bCapital>
    			<bGovernmentCenter>1</bGovernmentCenter>
    These are tags turned on by the palace. Since the Town Well is not a capital building or Government Center, set both of them to false. (0).

    The next left-over tag is this one:
    Code:
    <bNukeImmune>1</bNukeImmune>
    Should we make this building immune from Nuclear Strikes? Somehow, I don't think Town Wells would survive a nuclear blast. Set this to false as well.

    Now, to change the cost. We want the Town Well to cost 50 :hammers:, so change <iCost> to 50.

    The line directly below the <iCost> tag modifies how much the building costs if it is hurried through money or slaves. In this case, it is set to 50%. I can't think of any reason why purchasing a town well should be half the price of building it, so reset it to 100.

    Scroll down until you see this line:
    Code:
    <iCitiesPrereq>4</iCitiesPrereq>
    It sets the number of total cities you need before this building can be built. 4 is left over from the Palace, you can set it to whatever you want, but I recommend 0.

    The next left behind tag is this:

    Code:
    <iHappiness>1</iHappiness>
    The Town well gives no happiness, so reset it to 0.

    Next, is the Yield and Commerce. Look for this section.

    Code:
    			<YieldChanges>
    				<iYield>0</iYield>
    				<iYield>0</iYield>
    				<iYield>8</iYield>
    			</YieldChanges>
    Yields: An Explanation

    Note the tag name, Yield Changes. It means that the building literally adds that much new yield to it. Yield Modifiers modify by a percent what the city already makes.
    There are 3 Yields in Civilization 4 BTS. Food, Production, and Commerce :)food:, :hammers:, :commerce:). They are in that order. So this is basically saying this:

    0 Extra Food
    0 Extra Production
    8 Extra Commerce.

    We need to reset this, so set all 3 values to 0.

    Commerce

    Code:
    			<CommerceChanges>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>4</iCommerce>
    			</CommerceChanges>
    Note the tag name again. This is a change tag, not a modifier.

    Civilization 4 BTS has 4 commerce types, Gold, Science, Culture, and Espionage, in that order :)gold:, :science:, :culture:, :espionage:)

    This tag basically is saying that the palace gives

    0 Extra Gold
    0 Extra Science
    0 Extra Culture
    4 Extra Espionage.

    We need to reset these all back to zero as well.

    The tag below this one, is slightly different:

    Code:
    			<ObsoleteSafeCommerceChanges>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>2</iCommerce>
    			</ObsoleteSafeCommerceChanges>
    Note two things.

    1.) The name, Obsolete Safe, means that when the building goes obsolete, it will still provide these commerces.

    2.) It only lists 3 commerces, not the 4 above. This is out of convenience. Not listing the last commerce is automatically interpreted as a 0. However, if you needed to add a espionage tag, you could just add a line below the last <iCommerce> tag.

    Reset this tag to zeros too.

    Great, we have completely cleaned this building out. After Pass 1, the file should look like this:
    Spoiler :

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by lcollins (Firaxis Games) -->
    <!-- Sid Meier's Civilization 4 -->
    <!-- Copyright Firaxis Games 2005 -->
    <!-- -->
    <!-- Building Infos -->
    <Civ4BuildingInfos xmlns="x-schema:CIV4BuildingsSchema.xml">
    	<BuildingInfos>
    		<BuildingInfo>
    			<BuildingClass>BUILDINGCLASS_TOWN_WELL</BuildingClass>
    			<Type>BUILDING_TOWN_WELL</Type>
    			<SpecialBuildingType>NONE</SpecialBuildingType>
    			<Description>TXT_KEY_BUILDING_TOWN_WELL</Description>
    			<Civilopedia>TXT_KEY_BUILDING_TOWN_WELL_PEDIA</Civilopedia>
    			<Strategy>TXT_KEY_BUILDING_TOWN_WELL_STRATEGY</Strategy>
    			<Advisor>ADVISOR_GROWTH</Advisor>
    			<ArtDefineTag>ART_DEF_BUILDING_TOWN_WELL</ArtDefineTag>
    			<MovieDefineTag>NONE</MovieDefineTag>
    			<HolyCity>NONE</HolyCity>
    			<ReligionType>NONE</ReligionType>
    			<StateReligion>NONE</StateReligion>
    			<bStateReligion>0</bStateReligion>
    			<PrereqReligion>NONE</PrereqReligion>
    			<PrereqCorporation>NONE</PrereqCorporation>
    			<FoundsCorporation>NONE</FoundsCorporation>
    			<GlobalReligionCommerce>NONE</GlobalReligionCommerce>
    			<GlobalCorporationCommerce>NONE</GlobalCorporationCommerce>
    			<VictoryPrereq>NONE</VictoryPrereq>
    			<FreeStartEra>NONE</FreeStartEra>
    			<MaxStartEra>NONE</MaxStartEra>
    			<ObsoleteTech>NONE</ObsoleteTech>
    			<PrereqTech>NONE</PrereqTech>
    			<TechTypes/>
    			<Bonus>NONE</Bonus>
    			<PrereqBonuses/>
    			<ProductionTraits/>
    			<HappinessTraits/>
    			<NoBonus>NONE</NoBonus>
    			<PowerBonus>NONE</PowerBonus>
    			<FreeBonus>NONE</FreeBonus>
    			<iNumFreeBonuses>0</iNumFreeBonuses>
    			<FreeBuilding>NONE</FreeBuilding>
    			<FreePromotion>NONE</FreePromotion>
    			<CivicOption>NONE</CivicOption>
    			<GreatPeopleUnitClass>NONE</GreatPeopleUnitClass>
    			<iGreatPeopleRateChange>0</iGreatPeopleRateChange>
    			<iHurryAngerModifier>0</iHurryAngerModifier>
    			<bBorderObstacle>0</bBorderObstacle>
    			<bTeamShare>0</bTeamShare>
    			<bWater>0</bWater>
    			<bRiver>0</bRiver>
    			<bPower>0</bPower>
    			<bDirtyPower>0</bDirtyPower>
    			<bAreaCleanPower>0</bAreaCleanPower>
    			<DiploVoteType>NONE</DiploVoteType>
    			<bForceTeamVoteEligible>0</bForceTeamVoteEligible>
    			<bCapital>0</bCapital>
    			<bGovernmentCenter>0</bGovernmentCenter>
    			<bGoldenAge>0</bGoldenAge>
    			<bAllowsNukes>0</bAllowsNukes>
    			<bMapCentering>0</bMapCentering>
    			<bNoUnhappiness>0</bNoUnhappiness>
    			<bNoUnhealthyPopulation>0</bNoUnhealthyPopulation>
    			<bBuildingOnlyHealthy>0</bBuildingOnlyHealthy>
    			<bNeverCapture>0</bNeverCapture>
    			<bNukeImmune>0</bNukeImmune>
    			<bPrereqReligion>0</bPrereqReligion>
    			<bCenterInCity>0</bCenterInCity>
    			<iAIWeight>0</iAIWeight>
    			<iCost>50</iCost>
    			<iHurryCostModifier>100</iHurryCostModifier>
    			<iAdvancedStartCost>-1</iAdvancedStartCost>
    			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
    			<iMinAreaSize>-1</iMinAreaSize>
    			<iConquestProb>0</iConquestProb>
    			<iCitiesPrereq>0</iCitiesPrereq>
    			<iTeamsPrereq>0</iTeamsPrereq>
    			<iLevelPrereq>0</iLevelPrereq>
    			<iMinLatitude>0</iMinLatitude>
    			<iMaxLatitude>90</iMaxLatitude>
    			<iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
    			<iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
    			<iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
    			<iGlobalGreatPeopleRateModifier>0</iGlobalGreatPeopleRateModifier>
    			<iAnarchyModifier>0</iAnarchyModifier>
    			<iGoldenAgeModifier>0</iGoldenAgeModifier>
    			<iGlobalHurryModifier>0</iGlobalHurryModifier>
    			<iExperience>0</iExperience>
    			<iGlobalExperience>0</iGlobalExperience>
    			<iFoodKept>0</iFoodKept>
    			<iAirlift>0</iAirlift>
    			<iAirModifier>0</iAirModifier>
    			<iAirUnitCapacity>0</iAirUnitCapacity>
    			<iNukeModifier>0</iNukeModifier>
    			<iNukeExplosionRand>0</iNukeExplosionRand>
    			<iFreeSpecialist>0</iFreeSpecialist>
    			<iAreaFreeSpecialist>0</iAreaFreeSpecialist>
    			<iGlobalFreeSpecialist>0</iGlobalFreeSpecialist>
    			<iMaintenanceModifier>0</iMaintenanceModifier>
    			<iWarWearinessModifier>0</iWarWearinessModifier>
    			<iGlobalWarWearinessModifier>0</iGlobalWarWearinessModifier>
    			<iEnemyWarWearinessModifier>0</iEnemyWarWearinessModifier>
    			<iHealRateChange>0</iHealRateChange>
    			<iHealth>0</iHealth>
    			<iAreaHealth>0</iAreaHealth>
    			<iGlobalHealth>0</iGlobalHealth>
    			<iHappiness>0</iHappiness>
    			<iAreaHappiness>0</iAreaHappiness>
    			<iGlobalHappiness>0</iGlobalHappiness>
    			<iStateReligionHappiness>0</iStateReligionHappiness>
    			<iWorkerSpeedModifier>0</iWorkerSpeedModifier>
    			<iMilitaryProductionModifier>0</iMilitaryProductionModifier>
    			<iSpaceProductionModifier>0</iSpaceProductionModifier>
    			<iGlobalSpaceProductionModifier>0</iGlobalSpaceProductionModifier>
    			<iTradeRoutes>0</iTradeRoutes>
    			<iCoastalTradeRoutes>0</iCoastalTradeRoutes>
    			<iGlobalTradeRoutes>0</iGlobalTradeRoutes>
    			<iTradeRouteModifier>0</iTradeRouteModifier>
    			<iForeignTradeRouteModifier>0</iForeignTradeRouteModifier>
    			<iGlobalPopulationChange>0</iGlobalPopulationChange>
    			<iFreeTechs>0</iFreeTechs>
    			<iDefense>0</iDefense>
    			<iBombardDefense>0</iBombardDefense>
    			<iAllCityDefense>0</iAllCityDefense>
    			<iEspionageDefense>0</iEspionageDefense>
    			<iAsset>0</iAsset>
    			<iPower>0</iPower>
    			<fVisibilityPriority>0</fVisibilityPriority>
    			<SeaPlotYieldChanges/>
    			<RiverPlotYieldChanges/>
    			<GlobalSeaPlotYieldChanges/>
    			<YieldChanges>
    				<iYield>0</iYield>
    				<iYield>0</iYield>
    				<iYield>0</iYield>
    			</YieldChanges>
    			<CommerceChanges>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    			</CommerceChanges>
    			<ObsoleteSafeCommerceChanges>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    			</ObsoleteSafeCommerceChanges>
    			<CommerceChangeDoubleTimes/>
    			<CommerceModifiers/>
    			<GlobalCommerceModifiers/>
    			<SpecialistExtraCommerces/>
    			<StateReligionCommerces/>
    			<CommerceHappinesses/>
    			<ReligionChanges/>
    			<SpecialistCounts/>
    			<FreeSpecialistCounts/>
    			<CommerceFlexibles/>
    			<CommerceChangeOriginalOwners/>
    			<ConstructSound/>
    			<BonusHealthChanges/>
    			<BonusHappinessChanges/>
    			<BonusProductionModifiers/>
    			<UnitCombatFreeExperiences/>
    			<DomainFreeExperiences/>
    			<DomainProductionModifiers/>
    			<BuildingHappinessChanges/>
    			<PrereqBuildingClasses/>
    			<BuildingClassNeededs/>
    			<SpecialistYieldChanges/>
    			<BonusYieldModifiers/>
    			<ImprovementFreeSpecialists/>
    			<Flavors/>
    			<HotKey/>
    			<bAltDown>0</bAltDown>
    			<bShiftDown>0</bShiftDown>
    			<bCtrlDown>0</bCtrlDown>
    			<iHotKeyPriority>0</iHotKeyPriority>
    		</BuildingInfo>
    	</BuildingInfos>
    </Civ4BuildingInfos>
    


    End of Pass 1
     
  8. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    Part 2 Response

    - Civ4ArtDefines_Building Cleaning - CHECK
    - Civ4BuildingInfos Cleaning - CHECK

    - Spoilers - Looks like i did them right.

    - Backing up the files for future use.

    - Renaming Type - CHECK

    - Hungarian Notation - Wow never heard of it.

    - Tag Info and Wiki - Good to know

    - Comparing to Example Code - Look like they match. Yay! :D

    Thank you for posting this so far. I shall continue this tutorial in a bit. I must go do something else right now. Thanks so much for your help!

    End of Part 2 Response
     
  9. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    BuildingInfos - Continued

    Pass 2: Adding our New Values

    If we recall from the OP, we want these values



    We already have the cost changed.

    Next, to add the +1 health. Let's assume you have no idea what the tags do. In the Modiki, look up the tag for health.



    If you look, it's called "iHealth". This tells us it takes integer values. Change the value to 1. This will make the building give +1 health to the city that builds it.

    Next Up, The Prerequisite Technologies.

    Technologies are a bit confusing. Firaxis gives us a list, and a single tech tag. Since we have 2 technology prerequisites, we will need to use both. The single tech tag is used to show which technology on the Tech tree unlocks the building, the list is used to list the total techs required.

    If we think, Masonry generally comes after Pottery, so listing the single tag with Masonry makes more sense. So we go to the <PrereqTech> tag. But what do we put in it? We could guess, and get it wrong. So, this is where our searching skills come in handy.

    Looking Up Technologies

    Go back to the Rise of Mankind/Assets/XML folder. Find the Technologies folder. Open the Civ4TechInfos. Now we have a massive list of all the technology information. Fortuantly, we are only looking for two names. It's best to first look for obvious matches. Open up the Search Field (CONTROL-F) and type in "Masonry".

    We're in luck, we score a "TECH_MASONRY" hit right away. Copy that name, and head back to the BuildingInfos.

    Change this
    Code:
    <PrereqTech>NONE</PrereqTech>
    to this
    Code:
    <PrereqTech>TECH_MASONRY</PrereqTech>
    Great, now we have Masonry as a prequsite. Now, since this tag only holds one name, we need to add one in the list, located right below this tag, indicated by this name:
    Code:
    <TechTypes/>
    Dang. Another roadblock. The Forward slash at the end of the name means that this is a CLOSED list. It has no values in it. We need to open it first to add values.

    Opening the List:

    Now, if you've noticed other OPEN lists, like the YieldChanges, we noticed that the starting tag had no forward slash in it, it meant that it was the start of the list. So we copy the <TechTypes/> tag and remove the forward slash, so it looks like this: <TechTypes>. Now, the YieldChanges tag end is marked by a forward slash at the beginning of the word, so change the second tag to look like this:
    </TechTypes>.

    When you are done, it should look like this:
    Code:
    <TechTypes>
    </TechTypes>
    Great, we opened the list for new values. Copy and paste the Masony Prereq tag inside of the list, and indent it once. The indent doesn't matter, but it makes it conform to standard programming style, improving readability. So now, it should look like this:

    Code:
    			<TechTypes>
    				<PrereqTech>TECH_MASONRY</PrereqTech>
    			</TechTypes/>
    This is where Notepad++ is handy, because of color coding end and start tags. A properly created tag will show the start and stop, while an wrong tag will not:

    Right:


    Wrong:


    Great, now we need to find the name of pottery. Back in the Civ4TechInfos, search (CONTROL-F) for "Pottery". We're in luck again, TECH_POTTERY is the correct name. Update the list with the correct tech.

    Now, for the Obsolete Tech. Use your Searching Skillz again to look up the tech name for Invention.
    (Warning: This one is NOT Easy. This is what I was talking about when I said programmers got lazy and didn't update tags.)

    Try finding it out on your own. Seriously. If all else fails, scroll to the bottom and cheat and look at the answer. But you should be able to find it. (Hint: Look at the techs that require Invention to be researched for a clue)

    Simply Change NONE in the Obsolete Tag into the name you find.

    Now for the maintenance costs. Looking up in the Modiki for maintenance, we find the tag is called <iMaintenanceModifier>. Change the value to 5.

    I'm skipping the Civic Health change for now, we'll come back to that near the end.

    Next up is the double production for Agricultural Leaders. Looking up the tag for production changes, we find it's called <ProductionTraits>.

    Unfortuanty, this is another closed tag. We open it up like the last one. Now, what to put inside it? This time, it's not as easy to copy and paste the tag above it. It's nearly impossible to guess right. The easiest way to find out it to open up the main BuildingInfos.xml in the RoM XML folder. Then, search for "<ProductionTraits>", so we can see it used on another building.

    A quick search reveals this for the walls:

    Code:
    			<ProductionTraits>
    				[COLOR="Cyan"]<ProductionTrait>
    					<ProductionTraitType>TRAIT_PROTECTIVE</ProductionTraitType>
    					<iProductionTrait>100</iProductionTrait>
    				</ProductionTrait>[/COLOR]
    			</ProductionTraits>
    Perfect. Copy and paste the middle section (indicated by the light blue area) into your nearly opened tag.

    Now, another condudrum. What is the XML name for "Agricultural"? Time to use our vast searching skills again. ;) Find the Civ4TraitInfos in the XML/Civilizations folder. Open it up and search for anything that matches Agricultural. Luckily, it's named sensibly; TRAIT_AGRICULTURAL.

    Replace the protective trait with TRAIT_AGRICULTURAL. Now, double production is indicated by a 100 value in the <iProductionTrait> tag. (zero means no production speed increase).

    Uncharted Waters Ahead!:

    Now, the next two features are not Civ4 BTS normal tags, we are heading into new and uncharted territory. It's easiest to add these by example. I have an example package where I show all my new tags in one convenient place. You can download it here. Unarchive it, and open the Example_Civ4BuildingInfos. If you scroll down a bit, you'll see a comment that marks the start of my changes.

    The change you are looking for first is the "ReplaceBuildings" tag, this code:

    Code:
    			<ReplaceBuildings>
    				<ReplaceBuilding>
    					<BuildingClassType>BUILDINGCLASS_KNIGHT_STABLE</BuildingClassType>
    					<bReplace>1</bReplace>
    				</ReplaceBuilding>
    			</ReplaceBuildings>
    This tag lists all the possible building classes that this building upgrades to. Copy this section of code into the very bottom section of the building information, the line after this one:
    Code:
    <iHotKeyPriority>0</iHotKeyPriority>
    Notes about lists:
    You can list as many building classes to upgrade this one as you want, because this is a list. Integer tags only can hold one value, but list can hold as many as you need. They are much more useful in that respect.

    Our spec's call for an upgrade to the Artesian Well, but we will actually need 2 upgrades. The Artesian Well is upgraded by the Cannery, and if we don't make the Cannery a possible upgrade as well, players could use this as an exploit, and get a town well and Cannery.

    Note: Note that the inner tag is asking for a BUILDINGCLASSTYPE, not a BUILDINGTYPE. Putting a building name instead of a Building Class name will cause very strange things to happen.

    Using your search-fu skills, look up the BuildingClass name in the Civ4BuildingClassInfo, you will find the artesian well is named: BUILDINGCLASS_ARTESIAN_WELL. Replace the Knight Stable entry with that.

    Adding a second entry is easy, once you have the first. Copy the inner information, to list for a second building, so it should look like this:

    Code:
    			<ReplaceBuildings>
    				[COLOR="Cyan"]<ReplaceBuilding>
    					<BuildingClassType>BUILDINGCLASS_ARTESIAN_WELL</BuildingClassType>
    					<bReplace>1</bReplace>
    				</ReplaceBuilding>[/COLOR]
    				[COLOR="SandyBrown"]<ReplaceBuilding>
    					<BuildingClassType>BUILDINGCLASS_ARTESIAN_WELL</BuildingClassType>
    					<bReplace>1</bReplace>
    				</ReplaceBuilding>[/COLOR]
    			</ReplaceBuildings>
    Now, using your search skills again, find out that the name of the Building Class of the Cannery is called the BUILDINGCLASS_CANNERY. Replace the second entry with that name.

    SideNote:
    The <bReplace> tag simply indicates that this is true that the building class replaces this one. All non-listed building classes are defaulted to false.

    The Last Tag (Kinda):

    The last tag needs to provide the surrounding tiles with fresh water. Luckily this is an easy one, copied right from my Example_Civ4BuildingInfos

    Code:
    <bProvidesFreshWater>0</bProvidesFreshWater>
    Copy this below the ReplaceBuildings code, and set the value to true (1).


    And Another Thing...:

    Because we are using tags created by A New Dawn, we need to update our buildings schema. The one included in the Example Folder is layed out to include information for the new tags. Without it, the game will be unable to parse the new information. Updating the Schema is an easy 2 step process:

    1.) Copy the Example_CIV4BuildingsSchema into your working folder.

    2.) In the header of the files with the new tag (In our case, just the Civ4BuildingInfos), where it says this:

    Code:
    <Civ4BuildingInfos xmlns="x-schema:[COLOR="Green"]CIV4BuildingsSchema[/COLOR].xml">
    Change the name of the schema to the one you just copied over.


    Final Review:

    When you think you've done this all correctly, compare this against my copy so far.
    Spoiler :

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by lcollins (Firaxis Games) -->
    <!-- Sid Meier's Civilization 4 -->
    <!-- Copyright Firaxis Games 2005 -->
    <!-- -->
    <!-- Building Infos -->
    <Civ4BuildingInfos xmlns="x-schema:Example_CIV4BuildingsSchema.xml">
    	<BuildingInfos>
    		<BuildingInfo>
    			<BuildingClass>BUILDINGCLASS_TOWN_WELL</BuildingClass>
    			<Type>BUILDING_TOWN_WELL</Type>
    			<SpecialBuildingType>NONE</SpecialBuildingType>
    			<Description>TXT_KEY_BUILDING_TOWN_WELL</Description>
    			<Civilopedia>TXT_KEY_BUILDING_TOWN_WELL_PEDIA</Civilopedia>
    			<Strategy>TXT_KEY_BUILDING_TOWN_WELL_STRATEGY</Strategy>
    			<Advisor>ADVISOR_GROWTH</Advisor>
    			<ArtDefineTag>ART_DEF_BUILDING_TOWN_WELL</ArtDefineTag>
    			<MovieDefineTag>NONE</MovieDefineTag>
    			<HolyCity>NONE</HolyCity>
    			<ReligionType>NONE</ReligionType>
    			<StateReligion>NONE</StateReligion>
    			<bStateReligion>0</bStateReligion>
    			<PrereqReligion>NONE</PrereqReligion>
    			<PrereqCorporation>NONE</PrereqCorporation>
    			<FoundsCorporation>NONE</FoundsCorporation>
    			<GlobalReligionCommerce>NONE</GlobalReligionCommerce>
    			<GlobalCorporationCommerce>NONE</GlobalCorporationCommerce>
    			<VictoryPrereq>NONE</VictoryPrereq>
    			<FreeStartEra>NONE</FreeStartEra>
    			<MaxStartEra>NONE</MaxStartEra>
    			<ObsoleteTech>TECH_ALCHEMY</ObsoleteTech>
    			<PrereqTech>TECH_MASONRY</PrereqTech>
    			<TechTypes>
    				<PrereqTech>TECH_POTTERY</PrereqTech>
    			</TechTypes>
    			<Bonus>NONE</Bonus>
    			<PrereqBonuses/>
    			<ProductionTraits>
    				<ProductionTrait>
    					<ProductionTraitType>TRAIT_AGRICULTURAL</ProductionTraitType>
    					<iProductionTrait>100</iProductionTrait>
    				</ProductionTrait>
    			</ProductionTraits>
    			<HappinessTraits/>
    			<NoBonus>NONE</NoBonus>
    			<PowerBonus>NONE</PowerBonus>
    			<FreeBonus>NONE</FreeBonus>
    			<iNumFreeBonuses>0</iNumFreeBonuses>
    			<FreeBuilding>NONE</FreeBuilding>
    			<FreePromotion>NONE</FreePromotion>
    			<CivicOption>NONE</CivicOption>
    			<GreatPeopleUnitClass>NONE</GreatPeopleUnitClass>
    			<iGreatPeopleRateChange>0</iGreatPeopleRateChange>
    			<iHurryAngerModifier>0</iHurryAngerModifier>
    			<bBorderObstacle>0</bBorderObstacle>
    			<bTeamShare>0</bTeamShare>
    			<bWater>0</bWater>
    			<bRiver>0</bRiver>
    			<bPower>0</bPower>
    			<bDirtyPower>0</bDirtyPower>
    			<bAreaCleanPower>0</bAreaCleanPower>
    			<DiploVoteType>NONE</DiploVoteType>
    			<bForceTeamVoteEligible>0</bForceTeamVoteEligible>
    			<bCapital>0</bCapital>
    			<bGovernmentCenter>0</bGovernmentCenter>
    			<bGoldenAge>0</bGoldenAge>
    			<bAllowsNukes>0</bAllowsNukes>
    			<bMapCentering>0</bMapCentering>
    			<bNoUnhappiness>0</bNoUnhappiness>
    			<bNoUnhealthyPopulation>0</bNoUnhealthyPopulation>
    			<bBuildingOnlyHealthy>0</bBuildingOnlyHealthy>
    			<bNeverCapture>0</bNeverCapture>
    			<bNukeImmune>0</bNukeImmune>
    			<bPrereqReligion>0</bPrereqReligion>
    			<bCenterInCity>0</bCenterInCity>
    			<iAIWeight>0</iAIWeight>
    			<iCost>50</iCost>
    			<iHurryCostModifier>100</iHurryCostModifier>
    			<iAdvancedStartCost>-1</iAdvancedStartCost>
    			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
    			<iMinAreaSize>-1</iMinAreaSize>
    			<iConquestProb>0</iConquestProb>
    			<iCitiesPrereq>0</iCitiesPrereq>
    			<iTeamsPrereq>0</iTeamsPrereq>
    			<iLevelPrereq>0</iLevelPrereq>
    			<iMinLatitude>0</iMinLatitude>
    			<iMaxLatitude>90</iMaxLatitude>
    			<iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
    			<iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
    			<iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
    			<iGlobalGreatPeopleRateModifier>0</iGlobalGreatPeopleRateModifier>
    			<iAnarchyModifier>0</iAnarchyModifier>
    			<iGoldenAgeModifier>0</iGoldenAgeModifier>
    			<iGlobalHurryModifier>0</iGlobalHurryModifier>
    			<iExperience>0</iExperience>
    			<iGlobalExperience>0</iGlobalExperience>
    			<iFoodKept>0</iFoodKept>
    			<iAirlift>0</iAirlift>
    			<iAirModifier>0</iAirModifier>
    			<iAirUnitCapacity>0</iAirUnitCapacity>
    			<iNukeModifier>0</iNukeModifier>
    			<iNukeExplosionRand>0</iNukeExplosionRand>
    			<iFreeSpecialist>0</iFreeSpecialist>
    			<iAreaFreeSpecialist>0</iAreaFreeSpecialist>
    			<iGlobalFreeSpecialist>0</iGlobalFreeSpecialist>
    			<iMaintenanceModifier>5</iMaintenanceModifier>
    			<iWarWearinessModifier>0</iWarWearinessModifier>
    			<iGlobalWarWearinessModifier>0</iGlobalWarWearinessModifier>
    			<iEnemyWarWearinessModifier>0</iEnemyWarWearinessModifier>
    			<iHealRateChange>0</iHealRateChange>
    			<iHealth>1</iHealth>
    			<iAreaHealth>0</iAreaHealth>
    			<iGlobalHealth>0</iGlobalHealth>
    			<iHappiness>0</iHappiness>
    			<iAreaHappiness>0</iAreaHappiness>
    			<iGlobalHappiness>0</iGlobalHappiness>
    			<iStateReligionHappiness>0</iStateReligionHappiness>
    			<iWorkerSpeedModifier>0</iWorkerSpeedModifier>
    			<iMilitaryProductionModifier>0</iMilitaryProductionModifier>
    			<iSpaceProductionModifier>0</iSpaceProductionModifier>
    			<iGlobalSpaceProductionModifier>0</iGlobalSpaceProductionModifier>
    			<iTradeRoutes>0</iTradeRoutes>
    			<iCoastalTradeRoutes>0</iCoastalTradeRoutes>
    			<iGlobalTradeRoutes>0</iGlobalTradeRoutes>
    			<iTradeRouteModifier>0</iTradeRouteModifier>
    			<iForeignTradeRouteModifier>0</iForeignTradeRouteModifier>
    			<iGlobalPopulationChange>0</iGlobalPopulationChange>
    			<iFreeTechs>0</iFreeTechs>
    			<iDefense>0</iDefense>
    			<iBombardDefense>0</iBombardDefense>
    			<iAllCityDefense>0</iAllCityDefense>
    			<iEspionageDefense>0</iEspionageDefense>
    			<iAsset>0</iAsset>
    			<iPower>0</iPower>
    			<fVisibilityPriority>0</fVisibilityPriority>
    			<SeaPlotYieldChanges/>
    			<RiverPlotYieldChanges/>
    			<GlobalSeaPlotYieldChanges/>
    			<YieldChanges>
    				<iYield>0</iYield>
    				<iYield>0</iYield>
    				<iYield>0</iYield>
    			</YieldChanges>
    			<CommerceChanges>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    			</CommerceChanges>
    			<ObsoleteSafeCommerceChanges>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    			</ObsoleteSafeCommerceChanges>
    			<CommerceChangeDoubleTimes/>
    			<CommerceModifiers/>
    			<GlobalCommerceModifiers/>
    			<SpecialistExtraCommerces/>
    			<StateReligionCommerces/>
    			<CommerceHappinesses/>
    			<ReligionChanges/>
    			<SpecialistCounts/>
    			<FreeSpecialistCounts/>
    			<CommerceFlexibles/>
    			<CommerceChangeOriginalOwners/>
    			<ConstructSound/>
    			<BonusHealthChanges/>
    			<BonusHappinessChanges/>
    			<BonusProductionModifiers/>
    			<UnitCombatFreeExperiences/>
    			<DomainFreeExperiences/>
    			<DomainProductionModifiers/>
    			<BuildingHappinessChanges/>
    			<PrereqBuildingClasses/>
    			<BuildingClassNeededs/>
    			<SpecialistYieldChanges/>
    			<BonusYieldModifiers/>
    			<ImprovementFreeSpecialists/>
    			<Flavors/>
    			<HotKey/>
    			<bAltDown>0</bAltDown>
    			<bShiftDown>0</bShiftDown>
    			<bCtrlDown>0</bCtrlDown>
    			<iHotKeyPriority>0</iHotKeyPriority>
    			<ReplaceBuildings>
    				<ReplaceBuilding>
    					<BuildingClassType>BUILDINGCLASS_ARTESIAN_WELL</BuildingClassType>
    					<bReplace>1</bReplace>
    				</ReplaceBuilding>
    				<ReplaceBuilding>
    					<BuildingClassType>BUILDINGCLASS_CANNERY</BuildingClassType>
    					<bReplace>1</bReplace>
    				</ReplaceBuilding>
    			</ReplaceBuildings>
    			<bProvidesFreshWater>1</bProvidesFreshWater>
    		</BuildingInfo>
    	</BuildingInfos>
    </Civ4BuildingInfos>
     
  10. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    Part 3 Response

    Ok I am back again. Lets see how this goes ...

    - BuildingClass Rename - CHECK
    - Type Rename - CHECK
    - SpecialBuildingType - Leaving Alone
    - Description - CHECK (I figuring everything named PALACE will be renamed TOWN_WELL)
    - Civilopedia - CHECK
    - Strategy - CHECK
    - Growth Advisor - CHECK
    - Art Tag - CHECK
    - Movie Tag - Leaving Alone

    Pass 1
    - Capital Tags - CHECK and CHECK
    - Nuke Tag - CHECK
    - Cost - CHECK
    - Hurry Cost - CHECK
    - City PreReq - CHECK
    - Happy - CHECK

    - Yields - CHECK (Interesting)
    - Commerce - CHECK
    - Obsolete Safe - CHECK and CHECK

    Ok i think they match. This was much easier than I thought it would be.

    End of Part 3 Response
     
  11. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    To Be continued tomorrow... too tired now. ;)
     
  12. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    Part 4 Response

    Looks like modwiki will be my new best friend. :)

    - Health - CHECK
    - PreReq Tech - CHECK (Oh it rhymes)

    - Tech Masonry - CHECK
    - Tech Pottery - CHECK (Phew)

    - Maintenance - CHECK
    - Agriculture Production - CHECK

    - Replace Buildings - CHECK and CHECK
    - Freshwater - CHECK

    - And Another Thing - Um I am confused ... What am I suppose to call it? How do I set it up for my own folder such as you having an Afforess folder?

    I all attached the files I have done so far. Am I doing it right?

    EDIT: Removed Attachment
     
  13. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Make sure you go back and do the Obsolete Tech stuff, I realized I forgot it and added it, back in the Tech stuff. Other than the obsolete tech, your stuff looks fine.

    As for calling the other schema, simply copy-n-paste it into the same folder as the BuildingInfos file. As long as they are in the same folder, they can find each other.
     
  14. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    1. Ok added Invention (aka Alchemy)

    2. What I mean is (sorry for jumping ahead) but won't I need to eventually get my folder added to "MLF_CIV4ModularLoadingControls" ? Just like how you have the Afforess Folder or GeneralStaff uses "Custom_Buildings". In short mine would be like "Rise of Mankind/Assets/Modules/Hydro/Water". Or is that sort of thing only done when your merging it into "A New Dawn"?
     
  15. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Yeah. It's pretty easy to do that, you can follow the tutorial in the Modmod's forum on how to edit the MLF file. ;)
     
  16. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
  17. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    I did not recognize the topic with the new title. Anyways I am ready to learn your next lesson. :D

    ---------------------------------

    EDIT: Looking at your Arctic Buildings as a guide I started adding ...

    <Civ4BuildingClassInfos xmlns="x-schema:Water_CIV4BuildingsSchema.xml">

    .. to the files.

    I also made a "Hydro" Main folder and then added the CIV4ModularLoadingControlsSchema and MLF_CIV4ModularLoadingControls to that main folder.

    Inside MLF_CIV4ModularLoadingControls I changed the type to "Hydro" (Rather than Afforess) and cut down the list to only have ...

    Code:
    				<Module>
    					<Directory>Water</Directory>
    					<bLoad>1</bLoad>
    				</Module>
    
    Do I need to do anything to the CIV4ModularLoadingControlsSchema file?

    Also I changed the name of all the files in the "Water" folder to say "Water_" in front of their names just like you had "Artic_".

    Am I doing it right so far?
     
  18. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Fun With Civics

    Remember, we skipped the health change with the civics. This is because these are not controlled building to building, but civic to civic.

    We need to grab the RoM civic files, so back in your Rise of Mankind/Assets/XML folder, open up the GameInfo folder, and copy the Civ4GameInfoSchema and the Civ4CivicInfos into your working folder.

    Now, we only want to add 1 health with public works, so the rest of the civics are unnecessary. We will clean up the civics file by deleting all the civic information that isn't part of Public Works. Luckily, Public Works is named PUBLIC_WORKS in the XML, so it's easy to find.

    Your cleaned up file should look like this:
    Spoiler :

    Code:
    <?xml version="1.0"?>
    <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
    <Civ4CivicInfos xmlns="x-schema:CIV4GameInfoSchema.xml">
    	<!-- Sid Meier's Civilization 4 -->
    	<!-- Copyright Firaxis Games 2005 -->
    	<!-- -->
    	<!-- Civic Infos -->
    	<CivicInfos>
    		<CivicInfo>
    			<CivicOptionType>CIVICOPTION_WELFARE</CivicOptionType>
    			<Type>CIVIC_PUBLIC_WORKS</Type>
    			<Description>TXT_KEY_CIVIC_PUBLIC_WORKS</Description>
    			<Civilopedia>TXT_KEY_CIVIC_PUBLIC_WORKS_PEDIA</Civilopedia>
    			<Strategy>TXT_KEY_CIVIC_PUBLIC_WORKS_STRATEGY</Strategy>
    			<Help><!--TXT_KEY_CIVIC_PUBLIC_WORKS_HELP--></Help>
    			<Button>,Art/Interface/Buttons/Civics/PublicWorks.dds,Art/Interface/Buttons/RoM_Civic_Atlas.dds,3,6</Button>
    			<TechPrereq>TECH_CITY_PLANNING</TechPrereq>
    			<iAnarchyLength>1</iAnarchyLength>
    			<Upkeep>UPKEEP_HIGH</Upkeep>
    			<iAIWeight>0</iAIWeight>
    			<iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
    			<iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
    			<iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
    			<iStateReligionGreatPeopleRateModifier>0</iStateReligionGreatPeopleRateModifier>
    			<iDistanceMaintenanceModifier>0</iDistanceMaintenanceModifier>
    			<iNumCitiesMaintenanceModifier>0</iNumCitiesMaintenanceModifier>
    			<iCorporationMaintenanceModifier>0</iCorporationMaintenanceModifier>
    			<iExtraHealth>1</iExtraHealth>
    			<iFreeExperience>0</iFreeExperience>
    			<iWorkerSpeedModifier>25</iWorkerSpeedModifier>
    			<iImprovementUpgradeRateModifier>0</iImprovementUpgradeRateModifier>
    			<iMilitaryProductionModifier>0</iMilitaryProductionModifier>
    			<iBaseFreeUnits>0</iBaseFreeUnits>
    			<iBaseFreeMilitaryUnits>0</iBaseFreeMilitaryUnits>
    			<iFreeUnitsPopulationPercent>0</iFreeUnitsPopulationPercent>
    			<iFreeMilitaryUnitsPopulationPercent>0</iFreeMilitaryUnitsPopulationPercent>
    			<iGoldPerUnit>0</iGoldPerUnit>
    			<iGoldPerMilitaryUnit>0</iGoldPerMilitaryUnit>
    			<iHappyPerMilitaryUnit>0</iHappyPerMilitaryUnit>
    			<bMilitaryFoodProduction>0</bMilitaryFoodProduction>
    			<iMaxConscript>0</iMaxConscript>
    			<bNoUnhealthyPopulation>0</bNoUnhealthyPopulation>
    			<iExpInBorderModifier>0</iExpInBorderModifier>
    			<bBuildingOnlyHealthy>0</bBuildingOnlyHealthy>
    			<iLargestCityHappiness>1</iLargestCityHappiness>
    			<iCivicHappiness>0</iCivicHappiness>
    			<iWarWearinessModifier>0</iWarWearinessModifier>
    			<iFreeSpecialist>0</iFreeSpecialist>
    			<iTradeRoutes>0</iTradeRoutes>
    			<bNoForeignTrade>0</bNoForeignTrade>
    			<bNoCorporations>0</bNoCorporations>
    			<bNoForeignCorporations>0</bNoForeignCorporations>
    			<iCivicPercentAnger>0</iCivicPercentAnger>
    			<bStateReligion>0</bStateReligion>
    			<bNoNonStateReligionSpread>0</bNoNonStateReligionSpread>
    			<iStateReligionHappiness>0</iStateReligionHappiness>
    			<iNonStateReligionHappiness>0</iNonStateReligionHappiness>
    			<iStateReligionUnitProductionModifier>0</iStateReligionUnitProductionModifier>
    			<iStateReligionBuildingProductionModifier>0</iStateReligionBuildingProductionModifier>
    			<iStateReligionFreeExperience>0</iStateReligionFreeExperience>
    			<YieldModifiers/>
    			<CapitalYieldModifiers/>
    			<TradeYieldModifiers/>
    			<CommerceModifiers/>
    			<CapitalCommerceModifiers/>
    			<SpecialistExtraCommerces/>
    			<Hurrys/>
    			<SpecialBuildingNotRequireds/>
    			<SpecialistValids/>
    			<BuildingHappinessChanges>
    				<BuildingHappinessChange>
    					<BuildingType>BUILDINGCLASS_COURIER_SYSTEM</BuildingType>
    					<iHappinessChange>1</iHappinessChange>
    				</BuildingHappinessChange>
    				<BuildingHappinessChange>
    					<BuildingType>BUILDINGCLASS_GREAT_DAM</BuildingType>
    					<iHappinessChange>1</iHappinessChange>
    				</BuildingHappinessChange>
    			</BuildingHappinessChanges>
    			<BuildingHealthChanges>
    				<BuildingHealthChange>
    					<BuildingType>BUILDINGCLASS_AQUEDUCT</BuildingType>
    					<iHealthChange>1</iHealthChange>
    				</BuildingHealthChange>
    				<BuildingHealthChange>
    					<BuildingType>BUILDINGCLASS_PONT_DU_GARD_AQUEDUCT</BuildingType>
    					<iHealthChange>1</iHealthChange>
    				</BuildingHealthChange>
    				<BuildingHealthChange>
    					<BuildingType>BUILDINGCLASS_BATH_HOUSE</BuildingType>
    					<iHealthChange>1</iHealthChange>
    				</BuildingHealthChange>
    				<BuildingHealthChange>
    					<BuildingType>BUILDINGCLASS_WATER_TREATMENT_PLANT</BuildingType>
    					<iHealthChange>1</iHealthChange>
    				</BuildingHealthChange>
    			</BuildingHealthChanges>
    			<FeatureHappinessChanges/>
    			<ImprovementYieldChanges/>
    			<!-- Revolution Mod Start -->
    			<iRevIdxLocal>-1</iRevIdxLocal>
    			<iRevIdxNational>-1</iRevIdxNational>
    			<iRevIdxHolyCityGood>0</iRevIdxHolyCityGood>
    			<iRevIdxHolyCityBad>0</iRevIdxHolyCityBad>
    			<iRevIdxSwitchTo>-30</iRevIdxSwitchTo>
    			<fRevIdxNationalityMod>0</fRevIdxNationalityMod>
    			<fRevIdxBadReligionMod>0</fRevIdxBadReligionMod>
    			<fRevIdxGoodReligionMod>0</fRevIdxGoodReligionMod>
    			<fRevIdxDistanceMod>0</fRevIdxDistanceMod>
    			<fRevViolentMod>0</fRevViolentMod>
    			<iRevReligiousFreedom>0</iRevReligiousFreedom>
    			<iRevLaborFreedom>0</iRevLaborFreedom>
    			<iRevEnvironmentalProtection>0</iRevEnvironmentalProtection>
    			<iRevDemocracyLevel>0</iRevDemocracyLevel>
    			<bIsCommunism>0</bIsCommunism>
    			<bIsFreeSpeech>0</bIsFreeSpeech>
    			<bCanDoElection>0</bCanDoElection>
    			<!-- Revolution Mod End -->
    			<WeLoveTheKing/>
    			<Flavors/>
    		</CivicInfo>
    	</CivicInfos>
    </Civ4CivicInfos>
    


    Great. Now, we only care about 3 things here. We want to change the Building Health Changes, which is named, sensibly, <BuildingHealthChanges>. We also need to keep the name of the civic, so the game knows where to add our change to. So we can delete all of the XML tags in-between. After cleaning the unnessecary XML tags, we should have a file that looks like this:
    Spoiler :

    Code:
    <?xml version="1.0"?>
    <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
    <Civ4CivicInfos xmlns="x-schema:CIV4GameInfoSchema.xml">
    	<!-- Sid Meier's Civilization 4 -->
    	<!-- Copyright Firaxis Games 2005 -->
    	<!-- -->
    	<!-- Civic Infos -->
    	<CivicInfos>
    		<CivicInfo>
    			<CivicOptionType>CIVICOPTION_WELFARE</CivicOptionType>
    			<Type>CIVIC_PUBLIC_WORKS</Type>
    			<BuildingHealthChanges>
    				<BuildingHealthChange>
    					<BuildingType>BUILDINGCLASS_AQUEDUCT</BuildingType>
    					<iHealthChange>1</iHealthChange>
    				</BuildingHealthChange>
    				<BuildingHealthChange>
    					<BuildingType>BUILDINGCLASS_PONT_DU_GARD_AQUEDUCT</BuildingType>
    					<iHealthChange>1</iHealthChange>
    				</BuildingHealthChange>
    				<BuildingHealthChange>
    					<BuildingType>BUILDINGCLASS_BATH_HOUSE</BuildingType>
    					<iHealthChange>1</iHealthChange>
    				</BuildingHealthChange>
    				<BuildingHealthChange>
    					<BuildingType>BUILDINGCLASS_WATER_TREATMENT_PLANT</BuildingType>
    					<iHealthChange>1</iHealthChange>
    				</BuildingHealthChange>
    			</BuildingHealthChanges>
    		</CivicInfo>
    	</CivicInfos>
    </Civ4CivicInfos>


    Great. Now we can go one step farther and delete all but one of the building health changes entries inside the list.

    Tangent:
    Because RoM is using World of Civilization, it uses a special type of modular loading. You don't need to keep duplicate entries, the game remembers them when loading up the next file.

    Now that we only have one entry left, let's make it reference our new building class. Change the name to BUILDINGCLASS_TOWN_WELL inside the <BuildingHealthChanges> block. Since we only want to give it one health, we can leave the one as is.

    When we are all done, this is what our CivicInfos XML file should look like:
    Spoiler :

    Code:
    <?xml version="1.0"?>
    <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
    <Civ4CivicInfos xmlns="x-schema:CIV4GameInfoSchema.xml">
    	<!-- Sid Meier's Civilization 4 -->
    	<!-- Copyright Firaxis Games 2005 -->
    	<!-- -->
    	<!-- Civic Infos -->
    	<CivicInfos>
    		<CivicInfo>
    			<CivicOptionType>CIVICOPTION_WELFARE</CivicOptionType>
    			<Type>CIVIC_PUBLIC_WORKS</Type>
    			<BuildingHealthChanges>
    				<BuildingHealthChange>
    					<BuildingType>BUILDINGCLASS_TOWN_WELL</BuildingType>
    					<iHealthChange>1</iHealthChange>
    				</BuildingHealthChange>
    			</BuildingHealthChanges>
    		</CivicInfo>
    	</CivicInfos>
    </Civ4CivicInfos>


    Great. We are more than half done, we've added the building information, building class information, and the civic information. All we have left is the art and text. ;)
     
  19. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    That all seems correct. I just use it as a way of differentiating files and folders. You shouldn't need to edit the MLFSchema ever. Just make sure you have the schema in the same folder as the MLF file. You need a schema for the game to read the file.
     
  20. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    My Civ4CivicInfos are all scrambled. I mean its not still in code but its all over the place. (See Attachment)

    Should I just skip doing this myself and grab your posted code? Then use this file as a base temperate in the future?
     

Share This Page