(SOLVED) How to add an existing UB to an existing civ

Dtony

Chieftain
Joined
Aug 23, 2021
Messages
43
I am having trouble finding the right variables I need to add in order to do this. I want to add the bazaar and Krepost to Assyria's unique buildings, can anyone give me an example xml code on how to do this? I tried looking in xml buildings but saw nothing there that attached a building to a civ. I also looked at xml civilizations Assyria and leaders Ashurbanipal and didn't see a field for unique buildings.
 
Last edited:
It's not a field in the <Civilizations> table itself; the database table to do this is <Civilization_BuildingClassOverrides>, and Firaxis in the main game files put it in the same file as the civilization definitions themselves. So, for the bazaar and krepost, you can find them being mapped to Arabia/Russia respectively in Assets\Gameplay\XML\Civilizations\CIV5Civilizations.xml:

Code:
<Civilization_BuildingClassOverrides>
    ...
    <Row>
        <CivilizationType>CIVILIZATION_RUSSIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_BARRACKS</BuildingClassType>
        <BuildingType>BUILDING_KREPOST</BuildingType>
    </Row>
    ...
    <Row>
        <CivilizationType>CIVILIZATION_ARABIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_MARKET</BuildingClassType>
        <BuildingType>BUILDING_BAZAAR</BuildingType>
    </Row>
    ...
</Civilization_BuildingClassOverrides>

And for Assyria, in Assets\DLC\Expansion2\Gameplay\XML\Civilizations\CIV5Civilizations_Expansion2.xml:

Code:
<Civilization_BuildingClassOverrides>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_LIBRARY</BuildingClassType>
        <BuildingType>BUILDING_ROYAL_LIBRARY</BuildingType>
    </Row>
    ...
</Civilization_BuildingClassOverrides>

The former (vanilla) XML file also contains the table schema:

Code:
<Table name="Civilization_BuildingClassOverrides">
    <Column name="CivilizationType" type="text" reference="Civilizations(Type)"/>
    <Column name="BuildingClassType" type="text" notnull="true" reference="BuildingClasses(Type)"/>
    <Column name="BuildingType" type="text" reference="Buildings(Type)"/>
</Table>
 
It's not a field in the <Civilizations> table itself; the database table to do this is <Civilization_BuildingClassOverrides>, and Firaxis in the main game files put it in the same file as the civilization definitions themselves. So, for the bazaar and krepost, you can find them being mapped to Arabia/Russia respectively in Assets\Gameplay\XML\Civilizations\CIV5Civilizations.xml:

Code:
<Civilization_BuildingClassOverrides>
    ...
    <Row>
        <CivilizationType>CIVILIZATION_RUSSIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_BARRACKS</BuildingClassType>
        <BuildingType>BUILDING_KREPOST</BuildingType>
    </Row>
    ...
    <Row>
        <CivilizationType>CIVILIZATION_ARABIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_MARKET</BuildingClassType>
        <BuildingType>BUILDING_BAZAAR</BuildingType>
    </Row>
    ...
</Civilization_BuildingClassOverrides>

And for Assyria, in Assets\DLC\Expansion2\Gameplay\XML\Civilizations\CIV5Civilizations_Expansion2.xml:

Code:
<Civilization_BuildingClassOverrides>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_LIBRARY</BuildingClassType>
        <BuildingType>BUILDING_ROYAL_LIBRARY</BuildingType>
    </Row>
    ...
</Civilization_BuildingClassOverrides>
[/code]
The former (vanilla) XML file also contains the table schema:
thanks man, does the code look something like this
Code:
<GameData>
<Civilization_BuildingClassOverrides>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_BARRACKS</BuildingClassType>
        <BuildingType>BUILDING_KREPOST</BuildingType>
    </Row>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_MARKET</BuildingClassType>
        <BuildingType>BUILDING_BAZAAR</BuildingType>
    </Row>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_WINDMILL</BuildingClassType>
        <BuildingType>BUILDING_COFFEE_HOUSE</BuildingType>
    </Row>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_WATER_MILL</BuildingClassType>
        <BuildingType>BUILDING_FLOATING_GRADENS</BuildingType>
    </Row>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_OPERA_HOUSE</BuildingClassType>
        <BuildingType>BUILDING_CEILIDH_HALL</BuildingType>
    </Row>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_GARDEN</BuildingClassType>
        <BuildingType>BUILDING_CANDI</BuildingType>
    </Row>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_TEMPLE</BuildingClassType>
        <BuildingType>BUILDING_BURIAL_TOMB</BuildingType>
    </Row>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_MONUMENT</BuildingClassType>
        <BuildingType>BUILDING_STELE</BuildingType>
    </Row>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_SHRINE</BuildingClassType>
        <BuildingType>BUILDING_PYRAMID</BuildingType>
    </Row>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_BANK</BuildingClassType>
        <BuildingType>BUILDING_SATRAPS_COURT</BuildingType>
    </Row>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_STABLE</BuildingClassType>
        <BuildingType>BUILDING_DUCAL_STABLE</BuildingType>
    </Row>
    <Row>
        <CivilizationType>CIVILIZATION_ASSYRIA</CivilizationType>
        <BuildingClassType>BUILDINGCLASS_UNIVERSITY</BuildingClassType>
        <BuildingType>BUILDING_WAT</BuildingType>
    </Row>
    </Civilization_BuildingClassOverrides>
</GameData>
Also what program do u use to open the larger xml files. I use xml notepad and keep getting an error when i try to view the larger xml files
 
Last edited:
thanks man, does the code look something like this
Yes, that looks correct on first glance. But then, so does most XML that hasn't been run through the game's XML parser; database.log is the real decider of whether your code is correct or not.
Also what program do u use to open the larger xml files
Notepad++.
 
Top Bottom