XML (Advanced) Guide to Adding Buildings and Wonders to Brave New World

MAKING CHANGES TO THE FIRAXIS XML: Adding or Altering In-Game Text​

(I) Determing Which Text 'Tags' Need to be Altered
In order to modify existing in-game civilopedia and help text, it's necessary to first know which text "tags" are being used by a particular building. This is not as difficult as it might seem. If I look up the current XML of the Workshop building in the file called "CIV5Buildings.xml" (supplied by FIRAXIS), I find the following commands that relate to in-game text:
Code:
<Help>TXT_KEY_BUILDING_WORKSHOP_HELP</Help>
<Description>TXT_KEY_BUILDING_WORKSHOP</Description>
<Civilopedia>TXT_KEY_CIV5_BUILDINGS_WORKSHOP_TEXT</Civilopedia>
<Strategy>TXT_KEY_BUILDING_WORKSHOP_STRATEGY</Strategy>
I can't see any useful reason why I would want to alter the in-game name of the Workshop building, so I would discard the command for that from the list of commands I need to alter. The in-game name of a building will always be the <Description> command, so any time you are altering existing FIRAXIS-supplied buildings, there won't be much need to change the text used by the game for those commands.

Removing the <Description> command leaves a list of the following three commands:
Code:
<Help>TXT_KEY_BUILDING_WORKSHOP_HELP</Help>
<Civilopedia>TXT_KEY_CIV5_BUILDINGS_WORKSHOP_TEXT</Civilopedia>
<Strategy>TXT_KEY_BUILDING_WORKSHOP_STRATEGY</Strategy>
At this point I have two choices on how to proceed:

Choice #1: I simply make up the text I want to have displayed without concerning myself with what the game was using previously.

Choice #2: I find the text the game is currently using for each of these commands, and I alter that pre-existing text as little as possible.​
(II) Which Language Table to Use
Regardless of which method I decide to use to add my altered in-game text, I must use one of the "language" tables to do so. In the case of English, which is the only language I know how to speak, read, or write, I use the <Language_en_US> table. If I were bilingual, and also was comfortable with Spanish, I could also make entries in the <Language_ES_ES> table for the Espanol version of the game.​
(III) Example Where I Make Up Completely New "Workshop" Text Entries
If I'm not particularly concerned about what was in-game as part of the Civilopedia, etc., for the Workshop, I can simply make up my own completely new entries for <Help> , <Civilopedia> , and <Strategy> text look-ups. I need to start with the <GameData> command and then I need to open the <Language_en_US> table:
Code:
1=	<GameData>
2=		<Language_en_US>
Since I am going to change what FIRAXIS had supplied I use the <Update> command to substitute my new text into the "TEXT_KEY"s that the game previously used:
Code:
1=	<GameData>
2=		<Language_en_US>
3=			<Update>
Then I define where the game is to make the first substitution by entering that I am replacing a text key "Tag", and that the name of the "Tag" I am going to replace is "TXT_KEY_BUILDING_WORKSHOP_HELP". Whether in an update or in an entirely new addition to the game, the language tables use the command Tag="TXT_KEY_something_and_something" to identify which "TXT_KEY_" the XML should refer or write to.
Code:
1=	<GameData>
2=		<Language_en_US>
3=			<Update>
4=				<Where Tag="TXT_KEY_BUILDING_WORKSHOP_HELP"/>
Next I use the "Set" command to tell the game what change to make, and that it needs to change the <Text> it had previously for this language "Tag":
Code:
1=	<GameData>
2=		<Language_en_US>
3=			<Update>
4=				<Where Tag="TXT_KEY_BUILDING_WORKSHOP_HELP"/>
5=				<Set Text=" "/>
I haven't actually entered the text to be inserted in place of the old text as yet. I've simply created the proper command structure for me to shove the actual text I want displayed in-game. I have to decide what I want the game to display.

Since the earlier examples I showed have changed the yield modification of the Workshop from +10 % production in a city to +20 % production in a city, and I have added +1 Culture as an inherent property of the Workshop I would want to place this information into the "_HELP" tag for the Workshop. I might therefore decide to enter the following text string:
Code:
"Workshops add 20% [ICON_PRODUCTION] to a city's total [ICON_PRODUCTION],
and they also add +1 [ICON_CULTURE] Culture to a city."
If I'm satisfied that this will be a good text string for the game to use, I paste this in to line #5, as follows:
Code:
1=	<GameData>
2=		<Language_en_US>
3=			<Update>
4=				<Where Tag="TXT_KEY_BUILDING_WORKSHOP_HELP"/>
5=				<Set Text="Workshops add 20% [ICON_PRODUCTION] to a city's total [ICON_PRODUCTION],
					and they also add +1 [ICON_CULTURE] Culture to a city."/>
Now I can close-out this <Update> to the "TXT_KEY_BUILDING_WORKSHOP_HELP" Tag, and in this case I'm going to insert a blank line:
Code:
1=	<GameData>
2=		<Language_en_US>
3=			<Update>
4=				<Where Tag="TXT_KEY_BUILDING_WORKSHOP_HELP"/>
5=				<Set Text="Workshops add 20% [ICON_PRODUCTION] to a city's total [ICON_PRODUCTION],
					and they also add +1 [ICON_CULTURE] Culture to a city."/>
6=			</Update>
7=
I still have two more <Update> commands to do, so I don't as yet close out the <Language_en_US> table. Since it might be useful to have a note on my mod reminding me what each of these Updates is doing, I might decide to add a human-readable comment between line #2 and #3:
Code:
1=	<GameData>
2=		<Language_en_US>
2.1=			<!-- Update to the "<Help>" text -->
3=			<Update>
4=				<Where Tag="TXT_KEY_BUILDING_WORKSHOP_HELP"/>
5=				<Set Text="Workshops add 20% [ICON_PRODUCTION] to a city's total [ICON_PRODUCTION],
					and they also add +1 [ICON_CULTURE] Culture to a city."/>
6=			</Update>
7=
At this point I am going to make the assumption that you are comfortable enough with the concept of closing-out open game tables and open <GameData> commands, so I am not going to add any more descriptive text as to what those sorts of commands are for. I will simply from here on in show these sorts of commands wherever appropriate.

The final two Updates I still need to make are for the Workshop's <Civilopedia> and <Strategy> Tags. I am going to show all of that in one go, including closing out the open table and game data:
Code:
1=	<GameData>
2=		<Language_en_US>
2.1=			<!-- Update to the "<Help>" text -->
3=			<Update>
4=				<Where Tag="TXT_KEY_BUILDING_WORKSHOP_HELP"/>
5=				<Set Text="Workshops add 20% [ICON_PRODUCTION] to a city's total [ICON_PRODUCTION],
					and they also add +1 [ICON_CULTURE] Culture to a city."/>
6=			</Update>
7=
8=			<!-- Update to the "<Civilopedia>" text -->
9=			<Update>
10=				<Where Tag="TXT_KEY_CIV5_BUILDINGS_WORKSHOP_TEXT"/>
11=				<Set Text="A workshop is a building dedicated to constructing stuff. It boosts a city's
					overall production."/>
12=			</Update>
13=
14=			<!-- Update to the "<Strategy>" text -->
15=			<Update>
16=				<Where Tag="TXT_KEY_BUILDING_WORKSHOP_STRATEGY"/>
17=				<Set Text="The Workshop speeds a city's [ICON_PRODUCTION] Production by 20%. Allows
					[ICON_PRODUCTION] Production trade routes"/>
18=			</Update>
19=		</Language_en_US>
20=	</GameData>
What each of these added lines is doing:

# 8 is a human-readable comment to remind me that this update is for the <Civilopedia> entry of the Workshop
# 9 opens an <Update> command for the <Civilopedia> entry of the Workshop
# 10 tells the game which text "tag" to update.
# 11 is the "Set" command that tells the game what new text to use.
# 12 Closes out the open <Update> for the Workshop <Civilopedia> text.
# 13 is a blank line
# 14 is a human-readable comment to remind me that this update is for the <Strategy> entry of the Workshop
# 15 opens an <Update> command for the <Strategy> entry of the Workshop
# 16 tells the game which text "tag" to update.
# 17 is the "Set" command that tells the game what new text to use.
# 18 Closes out the open <Update> for the Workshop <Strategy> text.
# 19 Closes out the open <Language_en_US> table.
# 20 Closes out the open <GameData> command.

Here is the XML I would actually add to my mod, without the line numbers:
Code:
<GameData>
	<Language_en_US>
		<!-- Update to the "<Help>" text -->
		<Update>
			<Where Tag="TXT_KEY_BUILDING_WORKSHOP_HELP"/>
			<Set Text="Workshops add 20% [ICON_PRODUCTION] to a city's total [ICON_PRODUCTION],
				and they also add +1 [ICON_CULTURE] Culture to a city."/>
		</Update>
		
		<!-- Update to the "<Civilopedia>" text -->
		<Update>
			<Where Tag="TXT_KEY_CIV5_BUILDINGS_WORKSHOP_TEXT"/>
			<Set Text="A workshop is a building dedicated to construction in a city. It boosts
				a city's overall production."/>
		</Update>
		
		<!-- Update to the "<Strategy>" text -->
		<Update>
			<Where Tag="TXT_KEY_BUILDING_WORKSHOP_STRATEGY"/>
			<Set Text="The Workshop speeds a city's [ICON_PRODUCTION] Production by 20%. Allows
				[ICON_PRODUCTION] Production trade routes"/>
		</Update>
	</Language_en_US>
</GameData>
I could put this XML code in its own "___.XML" file in the mod, or I could add it to the file I would already have created for the changes I made to the Workshop building. If I place everything in one file, my XML for updating the Workshop would be as follows (click on the spoiler button):
Spoiler :
Code:
<GameData>
	<Building_YieldModifiers>
		<Update>
			<Where BuildingType="BUILDING_WORKSHOP" YieldType="YIELD_PRODUCTION"/>
			<Set Yield="20"/>
		</Update>
	</Building_YieldModifiers>

	<Building_YieldChanges>
		<Row>
			<BuildingType>BUILDING_WORKSHOP</BuildingType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>1</Yield>
		</Row>
	</Building_YieldChanges>

	<Language_en_US>
		<!-- Update to the "<Help>" text -->
		<Update>
			<Where Tag="TXT_KEY_BUILDING_WORKSHOP_HELP"/>
			<Set Text="Workshops add 20% [ICON_PRODUCTION] to a city's total [ICON_PRODUCTION], and they also add +1 [ICON_CULTURE] Culture to a city."/>
		</Update>
	
		<!-- Update to the "<Civilopedia>" text -->
		<Update>
			<Where Tag="TXT_KEY_CIV5_BUILDINGS_WORKSHOP_TEXT"/>
			<Set Text="A workshop is a building dedicated to construction in a city. It boosts a city's overall production."/>
		</Update>
		
		<!-- Update to the "<Strategy>" text -->
		<Update>
			<Where Tag="TXT_KEY_BUILDING_WORKSHOP_STRATEGY"/>
			<Set Text="The Workshop speeds a city's [ICON_PRODUCTION] Production by 20%. Allows [ICON_PRODUCTION] Production trade routes"/>
		</Update>
	</Language_en_US>
</GameData>
(IV) Example Where I Alter the Existing "Workshop" Text Entries
In order to change the existing <Help>, <Strategy>, and <Civilopedia> as little as necessary to inform the player of the new effects of the Workshop building, I need to know what exactly is the pre-existing text used by the game. Instead of hunting around in a myriad different files supplied by FIRAXIS to find this information, you can simply use this file called "Text_Buildings.XML" . I believe I have hunted down all the text string "tags" related to buildings and I have copied them into "Text_Buildings.XML".

If I want to find the existing in-game text tag commands for the Workshop's <Help>, <Civilopedia>, and <Strategy> Tags I can do a "find" in notepad for TXT_KEY_BUILDING_WORKSHOP_HELP, TXT_KEY_CIV5_BUILDINGS_WORKSHOP_TEXT, and TXT_KEY_BUILDING_WORKSHOP_STRATEGY. Doing so, I find the following (I have reformatted the commands slightly to make the text more readable):
Spoiler :
Code:
<Row Tag="TXT_KEY_BUILDING_WORKSHOP_HELP">
	<Text>Allows [ICON_PRODUCTION] Production to be moved from this city along trade routes inside your civilization.</Text>
</Row>

<Row Tag="TXT_KEY_CIV5_BUILDINGS_WORKSHOP_TEXT">
	<Text>
	A workshop is a building dedicated to constructing stuff. It would contain raw materials, tools, and the skilled labor
	to build whatever was needed. A pottery workshop would create pottery (unsurprisingly), while a carpentry workshop might
	construct doors, cabinets, floors - anything wooden. In Renaissance Italy, many artists worked in workshops, where a great
	painter might take credit for a painting that was in fact painted by his employees and students who had learned to accurately
	mimic his style, a practice which gives art collectors and historians headaches even today.
	</Text>
</Row>

<Row Tag="TXT_KEY_BUILDING_WORKSHOP_STRATEGY">
	<Text>The Workshop speeds a city's [ICON_PRODUCTION] Production.</Text>
</Row>

Looking at these three sets of text commands, I would most likely conclude that I really only need to change the first one, for TXT_KEY_BUILDING_WORKSHOP_HELP. Further, I might decide I really don't need to add any text about the +1 Culture I have added to the workshop, since the game always shows the yields that are inherent to the building when a player mouses over the name of the building in city build lists, etc. So all I really need to do is add a note about the change to +20 % production in a city instead of the normal +10 %. So, this is what I would use for my <Language_en_US> table:
Spoiler :
Code:
<GameData>
	<Language_en_US>
		<!-- Update to the "<Help>" text -->
		<Update>
			<Where Tag="TXT_KEY_BUILDING_WORKSHOP_HELP"/>
			<Set Text="Allows [ICON_PRODUCTION] Production to be moved from this city along trade routes inside your civilization.
			[NEWLINE]Workshops add 20% to a city's total [ICON_PRODUCTION]."/>
		</Update>
	</Language_en_US>
</GameData>
I purposefully reformatted the appearance of the new "Text" entry above to make it a little easier for you to read. I would probably actually enter it into my mod as follows. Either way will work.
Spoiler :
Code:
<GameData>
	<Language_en_US>
		<!-- Update to the "<Help>" text -->
		<Update>
			<Where Tag="TXT_KEY_BUILDING_WORKSHOP_HELP"/>
			<Set Text="Allows [ICON_PRODUCTION] Production to be moved from this city along trade routes inside your civilization.[NEWLINE]Workshops add 20% to a city's total [ICON_PRODUCTION]."/>
		</Update>
	</Language_en_US>
</GameData>
I generally always look at what is in the game before I alter it, because this will often lead me to the conclusion that I don't need to do anything to one or more of the existing text strings related to a building.​
 
MAKING CHANGES TO THE FIRAXIS XML: The <Buildings> table and <Update>

When making changes to the <Buildings> table there are two main options for telling the game where to make the changes. You can specify the building XML-name by using the building "Type", or you can use the class of the building using "BuildingClass".

(I) Using the building "Type" to control changes.
To use the "Type" (or XML-name of the building) you simply structure your <Where> command so that it references the Type and then you add the XML-name of the building. To make a change to the core defintion of the Workshop building, I set-up my <Where> command as follows:
Code:
<GameData>
	<Buildings>
		<Update>
			[COLOR="blue"]<Where Type="BUILDING_WORKSHOP"/>[/COLOR]
If the change I want to make is to add an additional specialist slot to Workshops, then my <Set> command would be:
Code:
<Set SpecialistCount="2"/>
Putting this all together and closing out the open commands, my mod would be as follows:
Code:
<GameData>
	<Buildings>
		<Update>
			<Where Type="BUILDING_WORKSHOP"/>
			<Set SpecialistCount="2"/>
		</Update>
	</Buildings>
</GameData>
This would only make the change to the Workshop, so the Longhouse would be "left out in the cold", as it were. If I repeat this same set of commands for the Longhouse, though, my mod would change to this:
Code:
<GameData>
	<Buildings>
		<Update>
			<Where Type="BUILDING_WORKSHOP"/>
			<Set SpecialistCount="2"/>
		</Update>
		<Update>
			<Where Type="BUILDING_LONGHOUSE"/>
			<Set SpecialistCount="2"/>
		</Update>
	</Buildings>
</GameData>
Both the Unique Iroqois version of the Workshop and the standard version of the workshop that every other player gets to build would have the same change made to them.​
(II) Using the building "BuildingClass" to control changes.
A better method to ensure a change applies to both the default building and any unique buildings within a class is to use BuildingClass instead of Type when making changes to the <Buildings> table. Doing a change in this way also results in less total XML-text needed to make such changes. Here is how I would use BuildingClass instead of Type in an update to add a second specialist to all Workshop-class buildings:
Code:
<GameData>
	<Buildings>
		<Update>
			<Where BuildingClass="BUILDINGCLASS_WORKSHOP"/>
			<Set SpecialistCount="2"/>
		</Update>
	</Buildings>
</GameData>
The only case where using BuildingClass will not work to make the same change to all buildings within a class is when one of the unique buildings within a class has an attribute different from the other buildings within the same class, and that attribute is the one you are trying to alter across all buildings within the class.

IMPORTANT: this strategy for making blanket changes using the BuildingClass only works with the <Buildings> table. Trying to jam BuildingClass into your <Where> command for other Building-related tables really just won't work.​
(III) Removing Building Attributes
If I want to remove an attribute from a building, I can do so using the <Update> command. I do not want to eliminate the whole definition of the building, I just want to eliminate one attribute. I can also add an attribute a building did not have previously.

If I wished to remove the Production Trade Routes capability from Workshops and Longhouses, and the Food Trade Routes capabilty from Granaries, and apply both these attributes to the Caravansary building I would need three updates to do so. I can do an update based on the Building Class to remove Production Trade Routes from Workshops and Longhouses, a second update to remove the Food Trade Route capability from Granaries, and a third update to add both capabilities to the Caravansary.

First, I remove the Production Trade Route capability from Workshop class buildings:
Code:
<GameData>
	<Buildings>
		<Update>
			<Where BuildingClass="BUILDINGCLASS_WORKSHOP"/>
			<Set AllowsProductionTradeRoutes="false"/>
		</Update>
Next I add the update to the Granary to remove Food Trade Routes from it:
Code:
<GameData>
	<Buildings>
		<Update>
			<Where BuildingClass="BUILDINGCLASS_WORKSHOP"/>
			<Set AllowsProductionTradeRoutes="false"/>
		</Update>

		[COLOR="blue"]<Update>
			<Where Type="BUILDING_GRANARY"/>
			<Set AllowsFoodTradeRoutes="false"/>
		</Update>[/COLOR]
Finally I add the update to the Caravansary to give it both the Food Trade Routes and Production Trade Routes capabilities:
Code:
<GameData>
	<Buildings>
		<Update>
			<Where BuildingClass="BUILDINGCLASS_WORKSHOP"/>
			<Set AllowsProductionTradeRoutes="false"/>
		</Update>

		<Update>
			<Where Type="BUILDING_GRANARY"/>
			<Set AllowsFoodTradeRoutes="false"/>
		</Update>

[COLOR="blue"]		<Update>
			<Where Type="BUILDING_CARAVANSARY"/>
			<Set AllowsFoodTradeRoutes="true" AllowsProductionTradeRoutes="true"/>
		</Update>[/COLOR]
	</Buildings>
</GameData>
Note that I can do multiple "sets" within the same command. I do not need to add a new update command for every item I wish to set so long as the same <Where> statement applies.​
(IV) Making multiple changes to one building with the <Update> command.
I can make more than one or two changes to a building within the same update command. When I get to a point where I have more than about three items to "set" I will generally format my Update in a slightly different manner. I find this easier to read later on when I come back to look at my XML commands.

Instead of stating my <Set> command in a format like this:
Code:
<Set AllowsFoodTradeRoutes="true" AllowsProductionTradeRoutes="true"/>
I adopt a format like this:
Code:
<Set>
	<AllowsProductionTradeRoutes>true</AllowsProductionTradeRoutes>
	<AllowsFoodTradeRoutes>true</AllowsFoodTradeRoutes>
</Set>
So far as the game is concerned the two versions are exactly the same. If I wanted to add a bunch of overpowered strange stuff to the Great Wall world wonder, I could throw the following into a mod:
Spoiler :
Code:
<GameData>
	<Buildings>
		<!-- Great Wall -->
		<!-- adds two engineer specialist slots -->
		<Update>
			<Where Type="BUILDING_GREAT_WALL"/>
			<Set>
				<SpecialistCount>2</SpecialistCount>
				<CityConnectionTradeRouteModifier>5</CityConnectionTradeRouteModifier>
				<TrainedFreePromotion>PROMOTION_SHOCK_1</TrainedFreePromotion>
				<WonderProductionModifier>15</WonderProductionModifier>
				<UnitUpgradeCostMod>-15</UnitUpgradeCostMod>
				<GreatPersonExpendGold>100</GreatPersonExpendGold>
			</Set>
		</Update>
	</Buildings>
</GameData>
Note that the Great Wall already specifies <SpecialistType>SPECIALIST_ENGINEER</SpecialistType> in order to add Great Person Points to the city. When I state <SpecialistCount>2</SpecialistCount> the game will use SPECIALIST_ENGINEER for the type of specialist slots to be added to the wonder. Bear in mind also that since the Great Wall expires part-way through the game, some of these effects will be lost. Since the two specialist slots are considered by the game to be part of the structure of the Great Wall, and not part of what the Great Wall does, the specialist slots will remain effective after the Great Wall expires. The other oddball stuff I added in this example will expire.

....................................................................................................................................................................................................

MAKING CHANGES TO THE FIRAXIS XML: <Replace> and <InsertOrAbort>

I do not know that I would really recommend using either of these two commands as a general rule. Anything you can accomplish using either of these two commands can also be accomplished by using an <Update> command.

These two commands can only be used easily with what I would define as a "core" game table. I would define the <Buildings> table as a "core" game table because it is where the basic definition of a building or wonder is added to the game. Every other table relating to buidings within the game XML is additional to the core definitions of buildings. In this definition, the <Units> table is the "core" game table for units, the <Beliefs> table is the "core" game table for beliefs, the <UnitPromotions> table is the "core" game table for unit promotions, the <Civilizations> table is the "core" game table for civilizations, etc. You should only generally attempt to use the <Replace> or the <InsertOrAbort> command when writing to one of these "core" game tables.

NOTE: It is not that it is impossible to use <Replace> or <InsertOrAbort> in what I would define as a "follow-on" table, it is just that you have to be much more careful that you are adjusting only the <Row> in such follow-on tables for only the building and the specific yield or other adjustment you wish to make, and not inadvertently making adjustments to all yields or affects from within the same follow-on table for the same building.

(I) Complete "Make-Over" of what a Building Does: <Replace> command
When you wish to make a mod that will completely "make-over" what a building does in-game, you can use the <Replace> command in the <Buildings> table. You do not in this case make use of the <Update> command. To use the <Replace> command you open the <GameData> and the <Buildings> table:
Code:
<GameData>
	<Buildings>
Then, instead of using a <Row> or an <Update> command, you use a <Replace> command.
Code:
<GameData>
	<Buildings>
		<Replace>
Next, you add commands to your entry in the <Buildings> table as if you were creating a completely new building. You do not necessarily have to care what is part of the building as it was supplied by FIRAXIS. As a practical matter you would probably start by copying everything from the existing XML for the building, and then add, delete, or change as you require.

Here is what was in the Shrine building in the Gods & Kings version of the game:
Code:
<Type>BUILDING_SHRINE</Type>
<BuildingClass>BUILDINGCLASS_SHRINE</BuildingClass>
<FreeStartEra>ERA_MEDIEVAL</FreeStartEra>
<MaxStartEra>ERA_RENAISSANCE</MaxStartEra>
<Cost>40</Cost>
<GoldMaintenance>1</GoldMaintenance>
<PrereqTech>TECH_POTTERY</PrereqTech>
<Description>TXT_KEY_BUILDING_SHRINE</Description>
<Civilopedia>TXT_KEY_CIV5_BUILDINGS_SHRINE_TEXT</Civilopedia>
<Strategy>TXT_KEY_BUILDING_SHRINE_STRATEGY</Strategy>
<ArtDefineTag>TEMPLE</ArtDefineTag>
<MinAreaSize>-1</MinAreaSize>
<HurryCostModifier>25</HurryCostModifier>
<IconAtlas>EXPANSION_BW_ATLAS_1</IconAtlas>
[COLOR="blue"]<NeverCapture>true</NeverCapture>[/COLOR]
<PortraitIndex>9</PortraitIndex>
If you look closely you will see that there is no command for <ConquestProb>, but there is a command for <NeverCapture>. In the Brave New World expansion, the Shrine was changed to the following info:
Code:
<Type>BUILDING_SHRINE</Type>
<BuildingClass>BUILDINGCLASS_SHRINE</BuildingClass>
<FreeStartEra>ERA_MEDIEVAL</FreeStartEra>
<MaxStartEra>ERA_RENAISSANCE</MaxStartEra>
<Cost>40</Cost>
<GoldMaintenance>1</GoldMaintenance>
<PrereqTech>TECH_POTTERY</PrereqTech>
<Description>TXT_KEY_BUILDING_SHRINE</Description>
<Civilopedia>TXT_KEY_CIV5_BUILDINGS_SHRINE_TEXT</Civilopedia>
<Strategy>TXT_KEY_BUILDING_SHRINE_STRATEGY</Strategy>
<ArtDefineTag>TEMPLE</ArtDefineTag>
[COLOR="blue"]<ConquestProb>66</ConquestProb>[/COLOR]
<MinAreaSize>-1</MinAreaSize>
<HurryCostModifier>25</HurryCostModifier>
<IconAtlas>EXPANSION_BW_ATLAS_1</IconAtlas>
<PortraitIndex>9</PortraitIndex>
The changes made were that <NeverCapture>true</NeverCapture> was removed from the Gods & Kings version of the Shrine, and <ConquestProb>66</ConquestProb> was added for the Brave New World expansion. This was done by using a <Replace> command when the new version of the Shrine was defined within the <Buildings> table.

If I were going to add a mod to the game that incorporated these exact same changes to the Shrine building, I would have a mod that looked like the following:
Spoiler :
Code:
<GameData>
	<Buildings>
		<Replace>
			<Type>BUILDING_SHRINE</Type>
			<BuildingClass>BUILDINGCLASS_SHRINE</BuildingClass>
			<FreeStartEra>ERA_MEDIEVAL</FreeStartEra>
			<MaxStartEra>ERA_RENAISSANCE</MaxStartEra>
			<Cost>40</Cost>
			<GoldMaintenance>1</GoldMaintenance>
			<PrereqTech>TECH_POTTERY</PrereqTech>
			<Description>TXT_KEY_BUILDING_SHRINE</Description>
			<Civilopedia>TXT_KEY_CIV5_BUILDINGS_SHRINE_TEXT</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_SHRINE_STRATEGY</Strategy>
			<ArtDefineTag>TEMPLE</ArtDefineTag>
			<ConquestProb>66</ConquestProb>
			<MinAreaSize>-1</MinAreaSize>
			<HurryCostModifier>25</HurryCostModifier>
			<IconAtlas>EXPANSION_BW_ATLAS_1</IconAtlas>
			<PortraitIndex>9</PortraitIndex>
		</Replace>
	</Buildings>
</GameData>
Here is an example of how FIRAXIS used the <Replace> command to re-define the Great Prophet under the <Units> table:
Code:
<GameData>
	<Units>
		<Replace>
			<Class>UNITCLASS_PROPHET</Class>
			<Type>UNIT_PROPHET</Type>
			<Cost>-1</Cost>
			<Moves>2</Moves>
			<Capture>UNITCLASS_PROPHET</Capture>
			<CivilianAttackPriority>CIVILIAN_ATTACK_PRIORITY_HIGH</CivilianAttackPriority>
			<Special>SPECIALUNIT_PEOPLE</Special>
			<Domain>DOMAIN_LAND</Domain>
			<DefaultUnitAI>UNITAI_PROPHET</DefaultUnitAI>
			<Description>TXT_KEY_UNIT_GREAT_PROPHET</Description>
			<Civilopedia>TXT_KEY_CIV5_GREATPROPHETS_TEXT</Civilopedia>
			<Strategy>TXT_KEY_UNIT_GREAT_PROPHET_STRATEGY</Strategy>
			<AdvancedStartCost>-1</AdvancedStartCost>
			<WorkRate>1</WorkRate>
			<CombatLimit>0</CombatLimit>
			<FoundReligion>true</FoundReligion>
			<SpreadReligion>true</SpreadReligion>
			<ReligionSpreads>4</ReligionSpreads>
			<ReligiousStrength>1000</ReligiousStrength>
			<UnitArtInfo>ART_DEF_UNIT_GREAT_PROPHET</UnitArtInfo>
			<UnitFlagAtlas>EXPANSION_UNIT_FLAG_ATLAS</UnitFlagAtlas>
			<UnitFlagIconOffset>16</UnitFlagIconOffset>
			<IconAtlas>EXPANSION_UNIT_ATLAS_1</IconAtlas>
			<PortraitIndex>16</PortraitIndex>
			<MoveRate>GREAT_PERSON</MoveRate>
		</Replace>
	</Units>
</GameData>
(II) Complete "Make-Over" of what a Building Does: <InsertOrAbort> command
The <InsertOrAbort> command is similar to the <Replace> command, but it was used by FIRAXIS to redefine buildings or wonders that are part of one of the DLC packages. Here is an example of how FIRAXIS used this command with the Statue of Zeus world wonder:
Spoiler :
Code:
<GameData>
	<Buildings>
		<!--DLC 6 Statue of Zeus -->
		<InsertOrAbort>
			<Type>BUILDING_STATUE_ZEUS</Type>
			<BuildingClass>BUILDINGCLASS_STATUE_ZEUS</BuildingClass>
			<Cost>185</Cost>
			<PrereqTech>TECH_BRONZE_WORKING</PrereqTech>
			<Help>TXT_KEY_WONDER_STATUE_ZEUS_HELP</Help>
			<Description>TXT_KEY_BUILDING_STATUE_ZEUS</Description>
			<Civilopedia>TXT_KEY_WONDER_STATUE_ZEUS_DESC</Civilopedia>
			<Quote>TXT_KEY_WONDER_STATUE_ZEUS_QUOTE</Quote>
			<ArtDefineTag>STATUE ZEUS</ArtDefineTag>
			<MaxStartEra>ERA_CLASSICAL</MaxStartEra>
			<NukeImmune>true</NukeImmune>
			<HurryCostModifier>-1</HurryCostModifier>
			<MinAreaSize>-1</MinAreaSize>
			<ConquestProb>100</ConquestProb>
			<FreePromotion>PROMOTION_STATUE_ZEUS</FreePromotion>
			<DisplayPosition>4</DisplayPosition>
			<IconAtlas>WONDERS_DLC_ATLAS</IconAtlas>
			<PortraitIndex>2</PortraitIndex>
			<WonderSplashImage>WonderConceptTempleZues.dds</WonderSplashImage>
			<WonderSplashAudio>AS2D_WONDER_SPEECH_STATUE_OF_ZEUS</WonderSplashAudio>
		</InsertOrAbort>
	</Buildings>
</GameData>
If a player has the DLC for the wonder or building being re-written by such an entry, the game will "insert" the new XML commands in the appropriate place within the game database. Otherwise, the game will abort the command.​

....................................................................................................................................................................................................

MAKING CHANGES TO THE FIRAXIS XML: <Delete>

The <Delete> command can be used when you need to make changes to a table that may have multiple entries within it for the same building. You should only use this command to make large changes in tables other than the <Buildings> table. By using the <Delete> command you can be sure you have removed all entries within a table that you do not want or might conflict with the settings within that table that you want to make.

In an earlier example I removed the internal trade route capabilities from the Granary, the Workshop, and the Longhouse. All three of these buildings, though, would still have flavorings associated with them for their original internal trade route capabilities. I would want to remove these flavorings in a properly-constructed mod. I would use the <Delete> command to first remove all the existing flavors for Granary, Workshop, and Longhouse, and then I would re-build the flavors each of these buildings have by creating new flavor entries for them in the <Building_Flavors> table. The first three lines I would need to create would be as follows:
Code:
1=	<GameData>
2=		<Building_Flavors>
3=			<Delete BuildingType="BUILDING_GRANARY"/>
Line # 3 is deleting all entries in the <Building_Flavors> table where the <BuildingType> command said "BUILDING_GRANARY". I do not need a <Where> specification. The <Delete> command pre-supposes the inclusiuon of the "where" when you specify BuildingType. The next two lines will delete the flavorings for the Workshop and the Longhouse:
Code:
1=	<GameData>
2=		<Building_Flavors>
3=			<Delete BuildingType="BUILDING_GRANARY"/>
4=			<Delete BuildingType="BUILDING_WORKSHOP"/>
5=			<Delete BuildingType="BUILDING_LONGHOUSE"/>
The <Delete> commands need to come before any additional commands I make in the <Building_Flavors> table. Next I would need to "re-build" the flavor settings for the Granary building (click the spoiler button to see)
Spoiler :
Code:
1=	<GameData>
2=		<Building_Flavors>
3=			<Delete BuildingType="BUILDING_GRANARY"/>
4=			<Delete BuildingType="BUILDING_WORKSHOP"/>
5=			<Delete BuildingType="BUILDING_LONGHOUSE"/>
[COLOR="blue"]6=			<Row>
7=				<BuildingType>BUILDING_GRANARY</BuildingType>
8=				<FlavorType>FLAVOR_GROWTH</FlavorType>
9=				<Flavor>18</Flavor>
10=			</Row>
11=			<Row>
12=				<BuildingType>BUILDING_GRANARY</BuildingType>
13=				<FlavorType>FLAVOR_SCIENCE</FlavorType>
14=				<Flavor>5</Flavor>
15=			</Row>
16=			<Row>
17=				<BuildingType>BUILDING_GRANARY</BuildingType>
18=				<FlavorType>FLAVOR_PRODUCTION</FlavorType>
19=				<Flavor>5</Flavor>
20=			</Row>
21=			<Row>
22=				<BuildingType>BUILDING_GRANARY</BuildingType>
23=				<FlavorType>FLAVOR_EXPANSION</FlavorType>
24=				<Flavor>5</Flavor>
25=			</Row>[/COLOR]
Lines # 6 through # 25 add back in flavor setting for the Granary building. I did not really alter any of the four building flavors I added back in for the Granary from what was original in the game. To make these new lines stand out a bit better I have made them appear blue.

Next I would want to add flavorings for the Workshop and the Longhouse: (click on the spoiler button)
Spoiler :
Code:
1=	<GameData>
2=		<Building_Flavors>
3=			<Delete BuildingType="BUILDING_GRANARY"/>
4=			<Delete BuildingType="BUILDING_WORKSHOP"/>
5=			<Delete BuildingType="BUILDING_LONGHOUSE"/>
6=			<Row>
7=				<BuildingType>BUILDING_GRANARY</BuildingType>
8=				<FlavorType>FLAVOR_GROWTH</FlavorType>
9=				<Flavor>18</Flavor>
10=			</Row>
11=			<Row>
12=				<BuildingType>BUILDING_GRANARY</BuildingType>
13=				<FlavorType>FLAVOR_SCIENCE</FlavorType>
14=				<Flavor>5</Flavor>
15=			</Row>
16=			<Row>
17=				<BuildingType>BUILDING_GRANARY</BuildingType>
18=				<FlavorType>FLAVOR_PRODUCTION</FlavorType>
19=				<Flavor>5</Flavor>
20=			</Row>
21=			<Row>
22=				<BuildingType>BUILDING_GRANARY</BuildingType>
23=				<FlavorType>FLAVOR_EXPANSION</FlavorType>
24=				<Flavor>5</Flavor>
25=			</Row>
[COLOR="blue"]26=			<Row>
27=				<BuildingType>BUILDING_WORKSHOP</BuildingType>
28=				<FlavorType>FLAVOR_GROWTH</FlavorType>
29=				<Flavor>5</Flavor>
30=			</Row>
31=			<Row>
32=				<BuildingType>BUILDING_WORKSHOP</BuildingType>
33=				<FlavorType>FLAVOR_EXPANSION</FlavorType>
34=				<Flavor>5</Flavor>
35=			</Row>
36=			<Row>
37=				<BuildingType>BUILDING_WORKSHOP</BuildingType>
38=				<FlavorType>FLAVOR_PRODUCTION</FlavorType>
39=				<Flavor>30</Flavor>
40=			</Row>
41=			<Row>
42=				<BuildingType>BUILDING_WORKSHOP</BuildingType>
43=				<FlavorType>FLAVOR_WONDER</FlavorType>
44=				<Flavor>10</Flavor>
45=			</Row>
46=			<Row>
47=				<BuildingType>BUILDING_WORKSHOP</BuildingType>
48=				<FlavorType>FLAVOR_SPACESHIP</FlavorType>
49=				<Flavor>5</Flavor>
50=			</Row>
51=			<Row>
52=				<BuildingType>BUILDING_WORKSHOP</BuildingType>
53=				<FlavorType>FLAVOR_GREAT_PEOPLE</FlavorType>
54=				<Flavor>2</Flavor>
55=			</Row>
56=			<Row>
57=				<BuildingType>BUILDING_LONGHOUSE</BuildingType>
58=				<FlavorType>FLAVOR_GROWTH</FlavorType>
59=				<Flavor>10</Flavor>
60=			</Row>
61=			<Row>
62=				<BuildingType>BUILDING_LONGHOUSE</BuildingType>
63=				<FlavorType>FLAVOR_EXPANSION</FlavorType>
64=				<Flavor>10</Flavor>
65=			</Row>
66=			<Row>
67=				<BuildingType>BUILDING_LONGHOUSE</BuildingType>
68=				<FlavorType>FLAVOR_PRODUCTION</FlavorType>
69=				<Flavor>50</Flavor>
70=			</Row>
71=			<Row>
72=				<BuildingType>BUILDING_LONGHOUSE</BuildingType>
73=				<FlavorType>FLAVOR_WONDER</FlavorType>
74=				<Flavor>10</Flavor>
75=			</Row>
76=			<Row>
77=				<BuildingType>BUILDING_LONGHOUSE</BuildingType>
78=				<FlavorType>FLAVOR_SPACESHIP</FlavorType>
79=				<Flavor>5</Flavor>
80=			</Row>
81=			<Row>
82=				<BuildingType>BUILDING_LONGHOUSE</BuildingType>
83=				<FlavorType>FLAVOR_GREAT_PEOPLE</FlavorType>
84=				<Flavor>2</Flavor>
85=			</Row>[/COLOR]
The reason that Workshops and Longhouses have flavors for "FLAVOR_WONDER" and "FLAVOR_SPACESHIP" is they both increase production in a city and thereby make it easier to construct both Wonders and Spaceship parts.

Before I could close out my mod I would need to think about the flavorings for the Caravansary, and what I need to do for it. The Caravansary has flavoring of "10" for "FLAVOR_GOLD", "10" for "FLAVOR_I_LAND_TRADE_ROUTE", and "10" for "FLAVOR_I_TRADE_ORIGIN". It does not have anything for "FLAVOR_I_SEA_TRADE_ROUTE", whereas the Granary and the Workshop both had flavorings of "5" for this.

To finish my mod, I would probably add a "FLAVOR_I_SEA_TRADE_ROUTE" flavoring to the Caravansary with a flavoring of "10", and I might very well leave the other flavorings alone.
(click on the spoiler button)
Spoiler :
Code:
1=	<GameData>
2=		<Building_Flavors>
3=			<Delete BuildingType="BUILDING_GRANARY"/>
4=			<Delete BuildingType="BUILDING_WORKSHOP"/>
5=			<Delete BuildingType="BUILDING_LONGHOUSE"/>
6=			<Row>
7=				<BuildingType>BUILDING_GRANARY</BuildingType>
8=				<FlavorType>FLAVOR_GROWTH</FlavorType>
9=				<Flavor>18</Flavor>
10=			</Row>
11=			<Row>
12=				<BuildingType>BUILDING_GRANARY</BuildingType>
13=				<FlavorType>FLAVOR_SCIENCE</FlavorType>
14=				<Flavor>5</Flavor>
15=			</Row>
16=			<Row>
17=				<BuildingType>BUILDING_GRANARY</BuildingType>
18=				<FlavorType>FLAVOR_PRODUCTION</FlavorType>
19=				<Flavor>5</Flavor>
20=			</Row>
21=			<Row>
22=				<BuildingType>BUILDING_GRANARY</BuildingType>
23=				<FlavorType>FLAVOR_EXPANSION</FlavorType>
24=				<Flavor>5</Flavor>
25=			</Row>
26=			<Row>
27=				<BuildingType>BUILDING_WORKSHOP</BuildingType>
28=				<FlavorType>FLAVOR_GROWTH</FlavorType>
29=				<Flavor>5</Flavor>
30=			</Row>
31=			<Row>
32=				<BuildingType>BUILDING_WORKSHOP</BuildingType>
33=				<FlavorType>FLAVOR_EXPANSION</FlavorType>
34=				<Flavor>5</Flavor>
35=			</Row>
36=			<Row>
37=				<BuildingType>BUILDING_WORKSHOP</BuildingType>
38=				<FlavorType>FLAVOR_PRODUCTION</FlavorType>
39=				<Flavor>30</Flavor>
40=			</Row>
41=			<Row>
42=				<BuildingType>BUILDING_WORKSHOP</BuildingType>
43=				<FlavorType>FLAVOR_WONDER</FlavorType>
44=				<Flavor>10</Flavor>
45=			</Row>
46=			<Row>
47=				<BuildingType>BUILDING_WORKSHOP</BuildingType>
48=				<FlavorType>FLAVOR_SPACESHIP</FlavorType>
49=				<Flavor>5</Flavor>
50=			</Row>
51=			<Row>
52=				<BuildingType>BUILDING_WORKSHOP</BuildingType>
53=				<FlavorType>FLAVOR_GREAT_PEOPLE</FlavorType>
54=				<Flavor>2</Flavor>
55=			</Row>
56=			<Row>
57=				<BuildingType>BUILDING_LONGHOUSE</BuildingType>
58=				<FlavorType>FLAVOR_GROWTH</FlavorType>
59=				<Flavor>10</Flavor>
60=			</Row>
61=			<Row>
62=				<BuildingType>BUILDING_LONGHOUSE</BuildingType>
63=				<FlavorType>FLAVOR_EXPANSION</FlavorType>
64=				<Flavor>10</Flavor>
65=			</Row>
66=			<Row>
67=				<BuildingType>BUILDING_LONGHOUSE</BuildingType>
68=				<FlavorType>FLAVOR_PRODUCTION</FlavorType>
69=				<Flavor>50</Flavor>
70=			</Row>
71=			<Row>
72=				<BuildingType>BUILDING_LONGHOUSE</BuildingType>
73=				<FlavorType>FLAVOR_WONDER</FlavorType>
74=				<Flavor>10</Flavor>
75=			</Row>
76=			<Row>
77=				<BuildingType>BUILDING_LONGHOUSE</BuildingType>
78=				<FlavorType>FLAVOR_SPACESHIP</FlavorType>
79=				<Flavor>5</Flavor>
80=			</Row>
81=			<Row>
82=				<BuildingType>BUILDING_LONGHOUSE</BuildingType>
83=				<FlavorType>FLAVOR_GREAT_PEOPLE</FlavorType>
84=				<Flavor>2</Flavor>
85=			</Row>
[COLOR="blue"]86=			<Row>
87=				<BuildingType>BUILDING_CARAVANSARY</BuildingType>
88=				<FlavorType>FLAVOR_I_SEA_TRADE_ROUTE</FlavorType>
89=				<Flavor>10</Flavor>
90=			</Row>
91=		</Building_Flavors>
92=	</GameData>[/COLOR]
The example I have shown here for altering the flavorings of multiple buildings is probably an extreme case in terms of the number of entries that need to be "built-back-in" to a game table after using the <Delete> command to remove multiple pre-existing entries within the same game table. The <Building_Flavors> table has more entries within it than probably any other Buildings-related XML table within the game, so altering it for existing buildings is always (potentially) going to require far more lines of code.
 
MAKING CHANGES TO THE FIRAXIS XML: Game Errata

(I) In the original version of Civ5, Firaxis left a very confusing (to modders) bit of errata in the buildings definitions of three world wonders: Taj Mahal, Pyramids, and Chichen Itza.

The error that was let stand was that the text <Help> TXT-KEY references in these three wonders were distributed incorrectly. In the subsequent expansions for Gods & Kings and Brave New World these confusing erratic references were not altered to correct them.

Here are the three confusing commands as they exist in the Firaxis-supplied XML:
Code:
Taj Mahal		<Help>TXT_KEY_WONDER_PYRAMIDS_HELP</Help>
Pyramids			<Help>TXT_KEY_WONDER_CHICHEN_ITZA_HELP</Help>
Chichen Itza		<Help>TXT_KEY_WONDER_TAJ_MAHAL_HELP</Help>
To alter the in-game help for the Taj Mahal, if you were adding a free social Policy to the effects of the Taj Mahal, you would need to structure your language table as:
Code:
<Language_en_US>
	<Update>
		<Set Text="The empire enters a [ICON_GOLDEN_AGE] Golden Age.[NEWLINE]1 Free Social Policy."/>
		<Where Tag="TXT_KEY_WONDER_PYRAMIDS_HELP"/>
	</Update>
</Language_en_US>
To alter the in-game help for the Chichen Itza, if you were adding a free social Policy to the effects of the Chichen Itza, you would need to structure your language table as:
Code:
<Language_en_US>
	<Update>
		<Set Text="1 Free Social Policy.[NEWLINE]Length of [ICON_GOLDEN_AGE] Golden Ages increased by 50%."/>
		<Where Tag="TXT_KEY_WONDER_TAJ_MAHAL_HELP"/>
	</Update>
</Language_en_US>
To alter the in-game help for the Pyramids, if you were adding a free social Policy to the effects of the Pyramids, you would need to structure your language table as:
Code:
<Language_en_US>
	<Update>
		<Set Text="Requires Liberty. Tile improvement construction speed increased by 25% and two Workers appear near the City.[NEWLINE]1 Free Social Policy."/>
		<Where Tag="TXT_KEY_WONDER_CHICHEN_ITZA_HELP"/>
	</Update>
</Language_en_US>
 
ADDING AUDIO TO WORLD WONDERS
(Supplement to Buildings Guide)


by lshipp
v5.0​
INTRODUCTION:​
In this supplement to the Buildings Guide I'll discuss methods for adding audio to a new World Wonder. I will be making the assumption that you have read through the Buildings Guide to a sufficient extent that you at least understand the concepts of the various XML tables that relate to buildings and wonders. I am not expecting that you will be a grand master class expert at everything presented in the Buildings Guide.
SPECIAL THANKS:​
Sun Ce of Wu has graciously allowed me to use his Colosseum and Amphitheater mod as a practical and working example of the XML code required to add custom audio files to world wonders. After reading through this supplement, you should examine his mod and the files within it to see how the XML interplays with the actual audio files. You can find his mod here:


CIVFANATICS RESOURCES:​
To learn a little more about adding audio files to the game, you can refer to the following tutorial by Leugi available on the CivFanatcis website. Leugi's guide is intended for adding audio to Civilization Leaders, but his explanations of the audio XML-table commands also apply to adding audio speech to World Wonders. Here is the direct address to Leugi's Tutorial: http://forums.civfanatics.com/showthread.php?t=493367
AUDIO TABLES:​
Two new XML tables have been added to "handle" custom audio files, so far as XML-code is concerned. These two tables are:
Code:
<Audio_Sounds>
<Audio_2DSounds>
You must have properly-formatted commands in BOTH tables to get custom audio files to work. While I am specifically showing what is required and known to work with world wonders, these same tables are used for Dawn of Man Speech, Great Works speech or music, and civilization "theme music", such as the war and the peace music specific to a Civ.
REQUIREMENTS BESIDES THE AUDIO TABLES:​
Besides the audio XML-tables, it is also necessary to have a command under the <Buildings> table for <WonderSplashAudio>.
You must treat the ".MP3" audio files as if they were art icon files and set the file property Import into VFS to true.
In ModBuddy, you must check the box called Reload Audio System in the Mod's Properties > Mod Info TAB.
AUDIO FILE FORMATS:​
The current method being used by mod-creators is to use MP3 files for custom CIV5 audio. I would advise not fighting uphill against this trend. I am not enough of an expert on audio file formats to say one way or another whether an alternative file format type is better or will even work. MP3 is known to work.

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

<BUILDINGS> TABLE COMMANDS:​
In the <Buildings> table for a World Wonder it is necessary to add a command for <WonderSplashAudio>. This command is similar to an <IconAtlas> command in that it doesn't do anything directly within the <Buildings> table, but is a reference to a set of audio XML-commands contained within other XML-tables. You should use a format like the following:
Code:
[COLOR="Blue"]<WonderSplashAudio>AS2D_WONDER_EXAMPLE</WonderSplashAudio>[/COLOR]
  • The game really likes to see AS2D_ at the beginning of the reference you fill in. It also seems to like certain types of text strings to follow the AS2D_ in order to properly insert the audio file into the correct place within the overall game. It likes to see AS2D_DOM_SPEECH_EXAMPLE for a civ's Dawn of Man speech, and AS2D_LEADER_MUSIC_EXAMPLE_LEADER_NAME_WAR or AS2D_LEADER_MUSIC_EXAMPLE_LEADER_NAME_PEACE for a custom leader's war or peace background music. Some of these front-end character strings are hard-coded into the game so that it looks for AS2D_LEADER_MUSIC_EXAMPLE_LEADER_NAME at the beginning of the reference when looking up either the Peace or War music, and will not accept deviations from this format.
  • You should always have AS2D_WONDER_ at the beginning of your reference.
PRACTICAL EXAMPLE FOR THE <BUILDINGS> TABLE​
Here is what Sun Ce of Wu used in his Theater of Dionysus world wonder for the <Buildings> table:
Spoiler :
Code:
<Buildings>
	<Row>
		<Type>BUILDING_DIONYSUS</Type>
		<BuildingClass>BUILDINGCLASS_DIONYSUS</BuildingClass>
		<Cost>300</Cost>
		<PrereqTech>TECH_DRAMA</PrereqTech>
		<Description>TXT_KEY_BUILDING_DIONYSUS</Description>
		<Quote>TXT_KEY_BUILDING_DIONYSUS_QUOTE</Quote>
		<Civilopedia>TXT_KEY_CIV5_BUILDINGS_DIONYSUS_TEXT</Civilopedia>
		<Help>TXT_KEY_WONDER_DIONYSUS_HELP</Help>
		<ArtDefineTag>ART_DEF_BUILDING_GLOBE_THEATER</ArtDefineTag>
		<MaxStartEra>ERA_MEDIEVAL</MaxStartEra>
		<NukeImmune>true</NukeImmune>
		<HurryCostModifier>-1</HurryCostModifier>
		<MinAreaSize>-1</MinAreaSize>
		<DisplayPosition>2</DisplayPosition>
		<ConquestProb>100</ConquestProb>
		<GreatWorkSlotType>GREAT_WORK_SLOT_LITERATURE</GreatWorkSlotType>
		<GreatWorkCount>1</GreatWorkCount>
		<FreeGreatWork>GREAT_WORK_PERSIANI</FreeGreatWork>
		<IconAtlas>EXPANSION_BW_ATLAS_1</IconAtlas>
		<PortraitIndex>0</PortraitIndex>
		<WonderSplashImage>dionysus.dds</WonderSplashImage>
		[COLOR="Blue"]<WonderSplashAudio>AS2D_WONDER_DIONYSUS</WonderSplashAudio>[/COLOR]
		<Happiness>2</Happiness>
	</Row>
</Buildings>
PRACTICAL EXAMPLE FOR ADDING A GREAT WORK:​
Sun Ce of Wu also added a great work of literature to the game to fill-in the <FreeGreatWork> command in the Theater of Dionysus <Buildings> table:
Spoiler :
Code:
<GreatWorks>
	<Row>
		<Type>GREAT_WORK_PERSIANI</Type>
		<GreatWorkClassType>GREAT_WORK_LITERATURE</GreatWorkClassType>
		<Description>TXT_KEY_GREAT_WORK_PERSIANI</Description>
		<Quote>TXT_KEY_GREAT_WORK_QUOTE_PERSIANI</Quote>
		<Audio>AS2D_WORK_PERSIANI</Audio>
		<Image>GreatWriter_Background.dds</Image>
	</Row>
</GreatWorks>
His <Image> reference is to the standard Great Work of Literature background splash, whereas his <Audio> command references to an added audio file. Note that here also it is best to use a format of AS2D_WORK_GREAT_WORK_NAME.


------------------------------------------------------------------------------------------------------------------------------------------
AUDIO TABLE COMMANDS:​
<Audio_2DSounds>
I like to think of the <Audio_2DSounds> as being your sound "atlas" table. This is not a one-for-one analogy to the artwork Icon Atlases table, but I find it easier to understand what the <Audio_2DSounds> table is for when I think of it this way. There are multiple commands that can be used with the <Audio_2DSounds> table depending on what sort of audio file you are adding to the game. I will only cover those required for World Wonders, and those for Great Works of Literature as used by Sun Ce of Wu.

<ScriptID>
Functions as a tag name, for lack of a better description, to which the <WonderSplashAudio> command references. The name of the <ScriptID> must be EXACTLY THE SAME as what you enter for <WonderSplashAudio> under the <Buildings> table.​
<SoundID>
  • Creates a definition for the <Audio_Sounds> table to use. You must use the same <SoundID> XML-name here as you use in the <Audio_Sounds> table. Conventions for this is to name your <SoundID> based on the name used for the <ScriptID>.
  • If you used AS2D_WONDER_NEW_WONDER as your <ScriptID>, then you should use SND_WONDER_NEW_WONDER as your <SoundID>
  • I am not at this time certain whether or not there is a hidden hard-coding in the game software that makes it look for a match-up between <ScriptID> and <SoundID> as I have shown, but everyone has so far been following that convention so you should save yourself a load of trouble and do likewise.
<SoundType>
Defines the type of audio file. Is it background music, is it speech for the Dawn of Man of a new Civ, is it a game effect "sounder", etc. For World Wonders you need GAME_MUSIC_STINGS.​
<MinVolume>
Sets the "minimum" volume to use. The defualt is 100. If your audio speech is not coming across loud enough, make your setting higher than 100. If it is too loud, make your setting lower than 100. Each audio file created by differnt mod-authors is probably going to perform a little differently, so you will have to force the game to use your audio file, and then decide whether or not you need to adjust up or down. Since there is a default setting of 100 used by the game, if your audio plays at a good volume without any commands for <MinVolume> and <MaxVolume>, you can omit these two commands entirely. So far, all mods I have seen with custom audio are using the same setting for <MinVolume> and for <MaxVolume>.​
<MaxVolume>
Sets the "maximum" volume to use. The defualt is 100. Otherwise refer to <MinVolume> for more information.​
<IsMusic>
Tells the game that your audio is music. This command does not have to be included for a World Wonder audio speech. Sun Ce of Wu used this command in his Theater of Dionysus wonder, but the recently-published Alamo World Wonder does not use this command. The Theater of Dionysus includes a little background music before the speech begins, where the Alamo world wonder does not. If you add background music before your wonder audio speech actually starts, you may need this command set to true, as Sun Ce of Wu did.​
<TaperSoundtrackVolume>
Cuts any other game music or sounders that would want to play while your World Wonder or Great Work audio is playing when you set this command to 0.0.​
SOME FURTHER NOTES ON <WonderSplashAudio>, <ScriptID>, AND <SoundID>
  1. <WonderSplashAudio> tells the game which <ScriptID> to refer to in the <Audio_2DSounds> table.
  2. <SoundID> is defined in the <Audio_2DSounds> table and is added to the other commands for an individual <ScriptID> that is "fleshed-out" under the <Audio_2DSounds> table.
  3. Later on, the <Audio_Sounds> table will use the <SoundID> to assign the actual audio file to the <ScriptID>, and then, going back up the "tree" of reference commands, to the <WonderSplashAudio> command.
PRACTICAL EXAMPLE OF <Audio_2DSounds> TABLE (FROM Sun Ce of Wu'S MOD):
Code:
<Audio_2DSounds>
	<Row>
		<ScriptID>AS2D_WONDER_DIONYSUS</ScriptID>
		<SoundID>SND_WONDER_DIONYSUS</SoundID>
		<SoundType>GAME_MUSIC_STINGS</SoundType>
		<MinVolume>120</MinVolume>
		<MaxVolume>120</MaxVolume>
		<IsMusic>true</IsMusic>
		<TaperSoundtrackVolume>0.0</TaperSoundtrackVolume>
	</Row>
	<Row>
		<ScriptID>AS2D_WORK_PERSIANI</ScriptID>
		<SoundID>SND_WORK_PERSIANI</SoundID>
		<SoundType>GAME_MUSIC_STINGS</SoundType>
		<MinVolume>120</MinVolume>
		<MaxVolume>120</MaxVolume>
		<IsMusic>true</IsMusic>
		<TaperSoundtrackVolume>0.0</TaperSoundtrackVolume>
	</Row>
</Audio_2DSounds>

<Audio_Sounds>
I like to think of the <Audio_Sounds> table as being your audio-file designation table. This is where you tell the game what the name of your audio file is. You only need, and should only try to use, three commands in this table:

<SoundID>
is an identifier for the game to tell it where the information added in the <Audio_Sounds> table needs to go, in relation to the commands given in the <Audio_2DSounds> table. If you create a <SoundID> designation of SND_WONDER_DIONYSUS in the <Audio_2DSounds> table, you neeed to use that same <SoundID> designation of SND_WONDER_DIONYSUS in the <Audio_Sounds> table.​
<Filename>
is the actual file name of your MP3 file. the name you use does not need to really bear any resemblance to your <SoundID> or <ScriptID> designations, or even to the XML-name of the World Wonder or Great Work of Literature. You can name your audio file George.MP3 if you want to. If George.MP3 is the filename of your audio file, your command for <Filename> should be:
<Filename>George</Filename>​
DO NOT include the extension ".MP3" within the <Filename> command. The file extension type is neither needed nor liked by the game.​
<LoadType>
Essentially is telling the game how to load the audio file. My research into this shows that there is really only one format for this command that you should use:
<LoadType>DynamicResident</LoadType>​
You always need this command, and you need it EXACTLY as shown. DynamicResident tells the game to load the audio file at launch of the mod as opposed to launch of the game.​
PRACTICAL EXAMPLE OF <Audio_Sounds> TABLE (FROM Sun Ce of Wu'S MOD):
Code:
<Audio_Sounds>
	<Row>
		<SoundID>SND_WONDER_DIONYSUS</SoundID>
		<Filename>ENGdionysus</Filename>
		<LoadType>DynamicResident</LoadType>
	</Row>
	<Row>
		<SoundID>SND_WORK_PERSIANI</SoundID>
		<Filename>ENGPersiani</Filename>
		<LoadType>DynamicResident</LoadType>
	</Row>
</Audio_Sounds>
------------------------------------------------------------------------------------------------------------------------------------------

REFERENCE -- Sun Ce of Wu'S Theater of Dionysus Wonder XML-commands as they relate to adding audio files, without commentaries:
Spoiler :
Code:
<GameData>
	<Buildings>
		<Row>
			<Type>BUILDING_DIONYSUS</Type>
			<BuildingClass>BUILDINGCLASS_DIONYSUS</BuildingClass>
			<Cost>300</Cost>
			<PrereqTech>TECH_DRAMA</PrereqTech>
			<Description>TXT_KEY_BUILDING_DIONYSUS</Description>
			<Quote>TXT_KEY_BUILDING_DIONYSUS_QUOTE</Quote>
			<Civilopedia>TXT_KEY_CIV5_BUILDINGS_DIONYSUS_TEXT</Civilopedia>
			<Help>TXT_KEY_WONDER_DIONYSUS_HELP</Help>
			<ArtDefineTag>ART_DEF_BUILDING_GLOBE_THEATER</ArtDefineTag>
			<MaxStartEra>ERA_MEDIEVAL</MaxStartEra>
			<NukeImmune>true</NukeImmune>
			<HurryCostModifier>-1</HurryCostModifier>
			<MinAreaSize>-1</MinAreaSize>
			<DisplayPosition>2</DisplayPosition>
			<ConquestProb>100</ConquestProb>
			<GreatWorkSlotType>GREAT_WORK_SLOT_LITERATURE</GreatWorkSlotType>
			<GreatWorkCount>1</GreatWorkCount>
			<FreeGreatWork>GREAT_WORK_PERSIANI</FreeGreatWork>
			<IconAtlas>EXPANSION_BW_ATLAS_1</IconAtlas>
			<PortraitIndex>0</PortraitIndex>
			<WonderSplashImage>dionysus.dds</WonderSplashImage>
			<WonderSplashAudio>AS2D_WONDER_DIONYSUS</WonderSplashAudio>
			<Happiness>2</Happiness>
		</Row>
	</Buildings>
	<GreatWorks>
		<Row>
			<Type>GREAT_WORK_PERSIANI</Type>
			<GreatWorkClassType>GREAT_WORK_LITERATURE</GreatWorkClassType>
			<Description>TXT_KEY_GREAT_WORK_PERSIANI</Description>
			<Quote>TXT_KEY_GREAT_WORK_QUOTE_PERSIANI</Quote>
			<Audio>AS2D_WORK_PERSIANI</Audio>
			<Image>GreatWriter_Background.dds</Image>
		</Row>
	</GreatWorks>
	<Audio_Sounds>
		<Row>
			<SoundID>SND_WONDER_DIONYSUS</SoundID>
			<Filename>ENGdionysus</Filename>
			<LoadType>DynamicResident</LoadType>
		</Row>
		<Row>
			<SoundID>SND_WORK_PERSIANI</SoundID>
			<Filename>ENGPersiani</Filename>
			<LoadType>DynamicResident</LoadType>
		</Row>
	</Audio_Sounds>
	<Audio_2DSounds>
		<Row>
			<ScriptID>AS2D_WONDER_DIONYSUS</ScriptID>
			<SoundID>SND_WONDER_DIONYSUS</SoundID>
			<SoundType>GAME_MUSIC_STINGS</SoundType>
			<MinVolume>120</MinVolume>
			<MaxVolume>120</MaxVolume>
			<IsMusic>true</IsMusic>
			<TaperSoundtrackVolume>0.0</TaperSoundtrackVolume>
		</Row>
		<Row>
			<ScriptID>AS2D_WORK_PERSIANI</ScriptID>
			<SoundID>SND_WORK_PERSIANI</SoundID>
			<SoundType>GAME_MUSIC_STINGS</SoundType>
			<MinVolume>120</MinVolume>
			<MaxVolume>120</MaxVolume>
			<IsMusic>true</IsMusic>
			<TaperSoundtrackVolume>0.0</TaperSoundtrackVolume>
		</Row>
	</Audio_2DSounds>
</GameData>
 
USING HIDDEN BUILDINGS TO CREATE UNIQUE CIV LEADER TRAITS
(Supplement to Main Tutorial)​

This absolutely REQUIRES Brave New World to function. Gods & Kings and Vanilla will not work for this.


INTRODUCTION:​

In this supplement to the Main Body of the Tutorial I'll discuss methods for adding a hidden building to the game. Hidden buildings can be used to create uniquely new civilization leader traits where what a modder wishes to accomplish with a civilization trait is not really available via the normal leader trait commands. I will be making the assumption that you have read through the main portion of this tutorial to a sufficient extent that you at least understand the concepts of the various XML tables that relate to buildings. I am also making the assumption that you wish to add a new civ or leader to the game, or that you want to alter an existing leader's trait.

Credit for finding this capability of the game goes to "Irkalla" on the CivFanatics website. Here is a direct link the Civfanatics discussion thread where this is discussed: Irkalla's Original Tutorial For Hiding Buildings


(I) XML CODE COMMANDS NEEDED TO HIDE A BUILDING

The Ability to add a hidden building is based on an exploit where certain commands being set to values of "-1" will cause the building to "fall through the code cracks" of the city display. The hidden building will be added to the city, but it will not show anywhere in-game in the city display. No LUA program is required, nor any SQL coding. Everything can be done by pretty simple XML commands. This exploit will only work for Brave New Worlds. The commands that Irkalla found to hide a building only using XML are:
Code:
<GreatWorkCount>-1</GreatWorkCount>
<PrereqTech>NULL</PrereqTech>
<Cost>-1</Cost>
<FaithCost>-1</FaithCost>
Adding this somewhere in the <Buildings> table of a building will make the building hidden. All four commands are needed to make this work properly.

(II) CREATING A NEW LEADER TRAIT AND ADDING A HIDDEN BUILDING TO THAT TRAIT

Adding the hidden building to a civilization's traits is done via the leader of the civilization. In the leader <Traits> table where you define the TRAIT of a new leader, you simply add a command for <FreeBuilding> with the simple XML building name, not the CLASS of the building, such as (click the spoiler button):
Spoiler :
The required line to add the hidden building to the leader trait is shown in red
Code:
<Traits>
	<Row>
		<Type>TRAIT_HIDDEN</Type>
		<Description>TXT_KEY_TRAIT_HIDDEN</Description>
		<ShortDescription>TXT_KEY_TRAIT_HIDDEN_SHORT</ShortDescription>
		<FasterAlongRiver>true</FasterAlongRiver>
		<LandBarbarianConversionPercent>50</LandBarbarianConversionPercent>
		[COLOR="Red"]<FreeBuilding>BUILDING_HIDDEN</FreeBuilding>[/COLOR] 
	</Row>
</Traits>
As shown, the trait would make the units of the civilization cross rivers without movement penalties, would give a 50% chance to capture barbarian units when an encampment is destroyed, AND WOULD ADD "BUILDING_HIDDEN" IN EVERY CITY OF THE EMPIRE.

(III) SPECIFYING THE NEW TRAIT TO BE USED BY A NEW LEADER

You then add the trait name (in this case "TRAIT_HIDDEN") to the new LEADER you are creating for your custom civilization.
Code:
<Leader_Traits>
	<Row>
		<LeaderType>LEADER_NEW_LEADER</LeaderType>
		<TraitType>TRAIT_HIDDEN</TraitType>
	</Row>
</Leader_Traits>

(IV) ADDING THE FREE HIDDEN BUILDING TO AN EXISTING LEADER'S TRAIT

If you wanted to ADD this hidden building to an existing civilization (meaning one of those supplied by Firaxis with the game), you do not need to create a new leader trait as shown under "(II)" above, nor do you need to have an entry in the <Leader_Traits> table as shown in "(III)" above. All you need is to add the <FreeBuilding> command to the appropriate pre-existing leader's TRAIT. Here is how I would do it if I wanted to add this Hidden Building to the American Civilization:
Code:
<Traits>
	<Update>
		<Where Type="TRAIT_RIVER_EXPANSION"/>
		<Set>
			<FreeBuilding>BUILDING_HIDDEN</FreeBuilding>
		</Set>
	</Update>
</Traits>
"TRAIT_RIVER_EXPANSION" is the actual XML-name of Washington's Leader Trait, even though it shows as "Manifest Destiny" in the Dawn of Man screen.

(V) SUBSTITUTING A NEW TRAIT (THAT INCLUDES THE HIDDEN BUILDING) FOR AN EXISTING LEADER'S OLD TRAIT

If you want to SUBTITUTE your new trait for the usual trait of an existing leader, you will will need to create the new trait as shown in "(II)" above. Instead of adding the new trait to that leader (tacking the new trait on to what was already there), you replace the old trait-name for the leader with the new trait name. Again, if I want to do this for the American civ, here is what is required:
Code:
<Leader_Traits>
	<Update>
		<Where LeaderType="LEADER_WASHINGTON"/>
		<Set>
			<TraitType>TRAIT_HIDDEN</TraitType>
		</Set>
	</Update>
</Leader_Traits>

(VI) LIMITS TO HOW MUCH "STUFF" YOU CAN ADD TO A TRAIT THAT INCLUDES <FreeBuilding>BUILDING_HIDDEN</FreeBuilding>

The game will limit you to how much stuff you can add to a single leader and still have the <FreeBuilding> command work properly. Every COMMAND you add to a single leader trait plus every LEADER TRAIT you add to a single leader will count toward this limit. I encountered this when I found that some of the "super-duper" civilization mods on the Steam Workshop weren't actually functioning as far as adding a bit of everything to the same leader ability was concerned.

When I first found this limitation, I experimented with how much "stuff" could be added. I added Temples as a free building for the American civilization (because that was the civ I was experimenting around with at the time), and found that the following was pretty much the limit to what could be added. Anything more additional I tried to tack onto Leader Washington caused the game to cease using the <FreeBuilding> command. Everything else worked properly. It did not make any difference whether I included the <FreeBuilding> command at the top of all this stuff, or near the bottom, as shown (click on the spoiler button to see):
Spoiler :
Code:
<Leader_Traits>
	<Row>
		<LeaderType>LEADER_WASHINGTON</LeaderType>
		<TraitType>TRAIT_VIKING_FURY</TraitType>
	</Row>
	<Row>
		<LeaderType>LEADER_WASHINGTON</LeaderType>
		<TraitType>TRAIT_CULTURE_FROM_KILLS</TraitType>
	</Row>
</Leader_Traits>
<Traits>
	<Update>
		<Where Type="TRAIT_RIVER_EXPANSION"/>
		<Set>
			<LandUnitMaintenanceModifier>-25</LandUnitMaintenanceModifier>
			<PlunderModifier>200</PlunderModifier>
			<FasterAlongRiver>true</FasterAlongRiver>
			<RazeSpeedModifier>200</RazeSpeedModifier>
			<CityCultureBonus>1</CityCultureBonus>
			<LandBarbarianConversionPercent>50</LandBarbarianConversionPercent>
			<NaturalWonderYieldModifier>100</NaturalWonderYieldModifier>
			<NaturalWonderHappinessModifier>100</NaturalWonderHappinessModifier>
			<FreeBuilding>BUILDING_TEMPLE</FreeBuilding>
			<ExtraFoundedCityTerritoryClaimRange>6</ExtraFoundedCityTerritoryClaimRange>
		</Set>
	</Update>
</Traits>


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

CREATING THE HIDDEN BUILDING:​

Usually, when you add a building to the game, you need to have a default building, and any buildings that are given only to a specific civilization are in addition to that default building. In the case of hidden buildings this strategy for adding the building and its class to the game is neither necessary or desired. It is better to simply create only the building that will be given by the Leader Trait, and to set that building as the default for the building class. So, at the minimum, you need to add the hidden building to the <Buildings> table, and you need to add the CLASS of the building to the <BuildingClasses> table (click on the spoiler button):
Spoiler :
Code:
<Buildings>
	<Row>
		<Type>BUILDING_HIDDEN</Type>
		<BuildingClass>BUILDINGCLASS_HIDDEN</BuildingClass>
		<Cost>-1</Cost>
		<FaithCost>-1</FaithCost>
		<PrereqTech>NULL</PrereqTech>
		<GreatWorkCount>-1</GreatWorkCount>
		<ArtDefineTag>NONE</ArtDefineTag>
		<MinAreaSize>-1</MinAreaSize>
		<NeverCapture>true</NeverCapture>
		<HurryCostModifier>-1</HurryCostModifier>
		<Happiness>1</Happiness>
		<PortraitIndex>19</PortraitIndex>
		<IconAtlas>BW_ATLAS_1</IconAtlas>
		<Description>TXT_KEY_BUILDING_HIDDEN</Description>
	</Row>
</Buildings>

<BuildingClasses>
	<Row>
		<Type>BUILDINGCLASS_HIDDEN</Type>
		<DefaultBuilding>BUILDING_HIDDEN</DefaultBuilding>
		<Description>TXT_KEY_BUILDING_HIDDEN</Description>
	</Row>
</BuildingClasses>
As shown above, this hidden building would add one (1) additional simple happiness to every city in the empire. That could be the entire unique ability added by a hidden building, though that might be a bit underpowered vis-a-vis the other standard unique abilities in the game.

I believe the game wants to see a <PortraitIndex> and <IconAtlas> command even though they will not actually be used anywhere. Remember that we are employing some exploit trickery here, so even though some commands won't ever actually be used they are still required. I think <ArtDefineTag> and <HurryCostModifier> could be safely omitted, but in my experimentations I used them, therefore I included them here and will do so elsewhere in this Supplement. I also have always added <NeverCapture> to be sure no other civ can conquer a city and get the benefits of the hidden building. You should also, as shown, have a TXT_KEY <Description> in both the <Buildings> and the <BuildingClasses> table.


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


<Buildings> TABLE COMMANDS TO AVOID USING:

You should not use any of the following commands of the <Buildings> table since they will tend to conflict with the hidden building effect (click on the spoiler button):
Spoiler :
Code:
<MutuallyExclusiveGroup>
<FreeStartEra>
<MaxStartEra>
<Help>..................since the whole idea is to hide the building
<Civilopedia>...........since the whole idea is to hide the building
<Strategy>..............since the whole idea is to hide the building
<ConquestProb>
<Espionage>.............since it can cause a potential conflict between the Leader "FreeBuilding" effect and the espionage system
			when a player selects "No Espionage" as a gameplay option.
<SpecialistCount>.......this would tend to make the game want to unhide the building. You can add great person points, just
			don't add citizen specialists.
<NumCityCostMod>........this is meant for national wonders, so shouldn't be used with a hidden building
<FreeGreatWork>
<GreatWorkSlotType>
You should generally avoid the following commands though they will probably not cause game crashes or wierd interactions if you do include them in a hidden building. Just bear in mind that I don't humanly have the time to test all these possible conditions, so do not be suprised if including any of these commands in a hidden building has an odd or unanticipated effect. For the most part these are terrain requirements, commands specifically added to the game for national wonders, and global effect commands (click on the spoiler button).
Spoiler :
Code:
<GlobalCultureRateModifier>		<ReligiousPressureModifier>
<WorkerSpeedModifier>			<GoldenAgeModifier>
<GoldenAge>				<PolicyCostModifier>
<FreePolicies>				<InstantMilitaryIncrease>
<UnitUpgradeCostMod>			<MinorFriendshipChange>
<GlobalDefenseMod>			<HolyCity>
<FreeBuildingThisCity>			<PolicyBranchType>
<GlobalGreatPeopleRateModifier>		<HappinessPerCity>
<GreatGeneralRateModifier>		<GlobalPopulationChange>
<GreatPersonExpendGold>			<ExtraLeagueVotes>
<GreatScientistBeakerModifier>		<GlobalEspionageModifier>
<FreeGreatPeople>			<ExtraSpies>
<MedianTechPercentChange>		<InstantSpyRankChange>
<FreeTechs>				<LandmarksTourismPercent>
<AffectSpiesNow>				<SpyRankChange>
<FreePromotion>				<GreatWorksTourismModifier>
<TechEnhancedTourism>			<HappinessPerCity>
<GlobalPopulationChange>			<HappinessPerXPolicies>
<CityCountUnhappinessMod>		<UnhappinessModifier>
<FreeBuilding>				<BorderObstacle>
<XBuiltTriggersIdeologyChoice>		<GlobalSpaceProductionModifier>
<NullifyInfluenceModifier>		<Capital>
<ArtInfoEraVariation>			<DisplayPosition>
<ArtInfoRandomVariation>			<ArtInfoCulturalVariation>
You should also never include any of the commands for a world wonder splash screen. If you use a template that has these, or copy an XML file to use as a template, delete completely any wonder splash screen commands.

DO NOT UNDER ANY CIRCUMSTANCES USE THE FOLLOWING COMMAND WITH A HIDDEN BUILDING:
Code:
<SpecialistExtraCulture>


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


SOME IDEAS ON <Buildings> TABLE COMMANDS THAT YOU WOULD OTHERWISE GENERALLY NOT USE:

Although I have already said you should generally avoid using certain commands, here are some ideas that might not be too overpowered to use with a hidden building. You would just need to balance the overall affect of everything you are adding to a new civilization so that it doesn't get to be too outragiously overpowered. Unless, of course, your intention is to create a super duper overpowered civilization, and you advertise it as such when (if) you post it to the Steam Workshop. In which case, go for it: make it fun!

(1) Golden Ages 1% Longer For Every City Built In An Empire:

If the effect you want is that every city built by an empire extends golden age lengths by 1%, you could add a <GoldenAgeModifier> command to your hidden building. But you shouldn't do something like add 25% to the length of golden ages for every city built within an empire. Here is what you would need to make Golden Ages 1% longer for every city built in the empire:
Code:
<GoldenAgeModifier>1</GoldenAgeModifier>

(2) Extra Missionary Spreads In Every City

You could add 1 Missionary Religion Spread "Mission" to every missionary built in the empire by adding an <ExtraMissionarySpreads> command to your hidden building. Here is what you would need to add the 1 extra religion spread to every missionary built in the empire:
Code:
<ExtraMissionarySpreads>1</ExtraMissionarySpreads>

(3) Gold for Great People

You could add a command to your hidden building that would make every city generate +1 Gold for the empire every time a Great Person is expended:
Code:
<GreatPersonExpendGold>1</GreatPersonExpendGold>
So, if a player had 10 cities, they would get an extra 10 Gold every time they used up a Great Person.

You can probably think of other ways to use the commands that I stated you should generally avoid. Mostly the ones you might try for a test run will be the commands that have a global effect. In such cases you should not make any one city add too great an effect, since these commands will stack and be cumulative.

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


TABLES TO NOT USE:​

You should not use any of the following building-related tables since they are either unnecessary or will cause conflicts with the hidden building effect (click on the spoiler button):
Spoiler :
Code:
<Civilization_BuildingClassOverrides>
	Use of this table will cause serious errors with the civilopedia. It is also not needed because
	of the way the hidden building is added to the game by the Leader Trait.
<Building_ClassesNeededInCity>
<Building_LockedBuildingClasses>
<Building_TechAndPrereqs>
<Building_DomainFreeExperiencePerGreatWork>
<Building_LocalResourceAnds>
<Building_LocalResourceOrs>
<Building_ResourceQuantityRequirements>
<Building_Flavors>
<Building_PrereqBuildingClasses>
<Building_ThemingBonuses>


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


TABLES TO GENERALLY AVOID USING:​

You should as a general rule avoid using any of these tables, since they would have an overpowering effect. All these tables are global in their affects in one way or another, so will stack with the effect from every other city.
Code:
<Building_GlobalYieldModifiers>
<Building_AreaYieldModifiers>
<Building_HurryModifiers>
<Building_SpecialistYieldChanges>
<Building_BuildingClassYieldChanges>
<Building_BuildingClassHappiness>

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


<Buildings> COMMANDS AND FOLLOW-ON TABLES THAT ARE GOOD TO USE:​

You can use any of the following commands for the <Buildings> table. Remember that I never advocate that you should use any particular command. I am merely showing which commands won't break the hidden building effect nor be too overpowering in and of themselves:
Spoiler :
Code:
<SpecialistType>
	needed if you wish a GreatPeopleRateChange
<GreatPeopleRateChange>
<AllowsRangeStrike>
<Defense>
<ExtraCityHitPoints>
<EnhancedYieldTech>
	you will also need a <Building_TechEnhancedYieldChanges>
	table. I would not recommend <TechEnhancedTourism>.
<TradeRouteSeaGoldBonus>
<TradeRouteLandGoldBonus>
<TradeRouteLandDistanceModifier>
<TradeRouteSeaDistanceModifier>
<AllowsProductionTradeRoutes>
<AllowsFoodTradeRoutes>
<AllowsWaterRoutes>
<TradeRouteTargetBonus>
<TradeRouteRecipientBonus>
<EspionageModifier>
<UnmoddedHappiness>
<Happiness>
<NoOccupiedUnhappiness>
<MilitaryProductionModifier>
<BuildingProductionModifier>
<SpaceProductionModifier>
<TrainedFreePromotion>
<CultureRateModifier>
<CityStateTradeRouteProductionModifier>
<NukeImmune>
<NukeModifier>
<ExtraLuxuries>
<FoodKept>
<AirModifier>
<CapturePlunderModifier>
<Gold>
<PlotCultureCostModifier>
<PlotBuyCostModifier>
<WonderProductionModifier>
Terrain requirements can be used, and will have the same effect as they would with a normal building:
Code:
<Water>
<River>
<FreshWater>
<Mountain>
<NearbyMountainRequired>
<Hill>
<Flat>
<NearbyTerrainRequired>
<ProhibitedCityTerrain>
You can use any of the following game tables that relate to buildings. Remember that I never advocate that you should use any particular command or table. I am merely showing which commands or tables won't break the hidden building effect nor be too overpowering in and of themselves:
Spoiler :
Code:
<Building_YieldModifiers>
<Building_YieldChanges>
<Building_YieldChangesPerPop>
<Building_YieldChangesPerReligion>
<Building_RiverPlotYieldChanges>
<Building_SeaPlotYieldChanges>
<Building_LakePlotYieldChanges>
<Building_SeaResourceYieldChanges>
<Building_ResourceYieldChanges>
<Building_FeatureYieldChanges>
	Remember that the natural wonders can be adjusted
	with this table, so a unique ability to increase or
	otherwisse change natural wonder yields can be used
	with this table and the hidden building effect.
<Building_TerrainYieldChanges>
<Building_TechEnhancedYieldChanges>
	Remember that you also have to specify a tech in
	the buildings table that enhances such yields
<Building_FreeUnits>
<Building_DomainFreeExperiences>
<Building_UnitCombatFreeExperiences>
<Building_UnitCombatProductionModifiers>
<Building_DomainProductionModifiers>
<Building_ResourceQuantity>
	You could use this table, but the total amount of
	resources you would have your hidden building give
	should be limited.
<Belief_BuildingClassYieldChanges> *
<Belief_BuildingClassHappiness> *
<Belief_BuildingClassTourism> *
<Policy_BuildingClassYieldChanges> *
<Policy_BuildingClassTourismModifiers> *
<Policy_BuildingClassHappiness> *
<Policy_BuildingClassYieldModifiers> *
<Policy_BuildingClassCultureChanges> *
The Belief and Policy Tables with the * symbol after them denote where you would enter BUILDINGCLASS_HIDDEN instead of BUILDING_HIDDEN. By using these tables, or some combination of them, you could create either a religious belief affinity for a new civilization, or an affinity for a particular social policy. When that social policy or belief is adopted by a player, they would get extra benefits within their cities. I have tested this very sort of thing, and will show it in the practical example with which I will close this Supplement.


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


EXECUTABLE EXAMPLE OF A HIDDEN BUILDING:​

I performed a test on this Hidden Building capability, and so will show you all the code I used to make that test. I did not create an entirely new civilization to conduct my test. I simply used the America Civ and the Washington Leader to perform my test. I decided to make an entirely new leader trait for Washington, and substitute that trait for the one normally used in the game. In terms of XML naming, I called the new trait "TRAIT_HIDDEN", and I called the building "BUILDING_HIDDEN" with a building-class of "BUILDINGCLASS_HIDDEN".

(1) I created the trait. This is pretty much the trait I showed as an example earlier:
Code:
<Traits>
	<Row>
		<Type>TRAIT_HIDDEN</Type>
		<Description>TXT_KEY_TRAIT_HIDDEN</Description>
		<ShortDescription>TXT_KEY_TRAIT_HIDDEN_SHORT</ShortDescription>
		<FasterAlongRiver>true</FasterAlongRiver>
		<LandBarbarianConversionPercent>50</LandBarbarianConversionPercent>
		<FreeBuilding>BUILDING_HIDDEN</FreeBuilding>
	</Row>
</Traits>
(2) I substituted this trait for the one Washington normally uses in-game:
Code:
<Leader_Traits>
	<Update>
		<Where LeaderType="LEADER_WASHINGTON"/>
		<Set>
			<TraitType>TRAIT_HIDDEN</TraitType>
		</Set>
	</Update>
</Leader_Traits>
(3) I added a "<Language_en_US>" table for the new trait, and for the Hidden Building:
Code:
<Language_en_US>
	<Row Tag="TXT_KEY_TRAIT_HIDDEN">
		<Text>50% Chance of converting barbarians in encampments. Units are faster along rivers. Every policy branch adopted increases
		[ICON_CULTURE] Culture by 1 in every city.</Text>
	</Row>
	<Row Tag="TXT_KEY_TRAIT_HIDDEN_SHORT">
		<Text>Cultural Destiny</Text>
	</Row>
	<Row Tag="TXT_KEY_BUILDING_HIDDEN">
		<Text>Hidden</Text>
	</Row>
</Language_en_US>
(4) I created my hidden building in the <Buildings> table. As I structured it, the hidden building doesn't do anything directly from the commands within the "<Buildings>" table, but I could have added more commands to make it do things directly from the <Buildings> table:
Code:
<Buildings>
	<Row>
		<Type>BUILDING_HIDDEN</Type>
		<BuildingClass>BUILDINGCLASS_HIDDEN</BuildingClass>
		<Cost>-1</Cost>
		<FaithCost>-1</FaithCost>
		<PrereqTech>NULL</PrereqTech>
		<GreatWorkCount>-1</GreatWorkCount>
		<ArtDefineTag>NONE</ArtDefineTag>
		<MinAreaSize>-1</MinAreaSize>
		<NeverCapture>true</NeverCapture>
		<HurryCostModifier>-1</HurryCostModifier>
		<PortraitIndex>19</PortraitIndex>
		<IconAtlas>BW_ATLAS_1</IconAtlas>
		<Description>TXT_KEY_BUILDING_HIDDEN</Description>
	</Row>
</Buildings>
(5) I created a <BuildingClasses> table for the hidden building. Note that the default building within the class is my hidden building:
Code:
<BuildingClasses>
	<Row>
		<Type>BUILDINGCLASS_HIDDEN</Type>
		<DefaultBuilding>BUILDING_HIDDEN</DefaultBuilding>
		<Description>TXT_KEY_BUILDING_HIDDEN</Description>
	</Row>
</BuildingClasses>
(6) I added a <Building_FreeUnits> table with a worker given for free by the hidden building. I did this so it would be a little easier for me to verify early-on that the hidden building was being properly added to my cities. After I was sure my hidden building was being added to my cities, I eliminated the "<Building_FreeUnits>" table with the free worker, and ran a "full-out" test on my hidden building. If the effects of your hidden building won't necessarily be obvious on the first turns of the game, you may want to use a similar strategy to test that the hidden building is being properly added to all cities:
Code:
<Building_FreeUnits>
	<Row>
		<BuildingType>BUILDING_HIDDEN</BuildingType>
		<UnitType>UNIT_WORKER</UnitType>
		<NumUnits>1</NumUnits>
	</Row>
</Building_FreeUnits>
(7) Last, I added a <Policy_BuildingClassCultureChanges> table that adds one (1) culture to every city for each and every social policy branch adopted. To do this I used the policy branch "opener" policies. Since there are no "opener" or "finisher" policies for the three Ideology branches, I could not include anything for them. In this game table, I have to use the CLASS of the hidden building, so my table to do this was:
Spoiler :
Code:
<Policy_BuildingClassCultureChanges>
	<Row>
		<PolicyType>POLICY_LIBERTY</PolicyType>
		<BuildingClassType>BUILDINGCLASS_HIDDEN</BuildingClassType>
		<CultureChange>1</CultureChange>
	</Row>
	<Row>
		<PolicyType>POLICY_TRADITION</PolicyType>
		<BuildingClassType>BUILDINGCLASS_HIDDEN</BuildingClassType>
		<CultureChange>1</CultureChange>
	</Row>
	<Row>
		<PolicyType>POLICY_HONOR</PolicyType>
		<BuildingClassType>BUILDINGCLASS_HIDDEN</BuildingClassType>
		<CultureChange>1</CultureChange>
	</Row>
	<Row>
		<PolicyType>POLICY_PIETY</PolicyType>
		<BuildingClassType>BUILDINGCLASS_HIDDEN</BuildingClassType>
		<CultureChange>1</CultureChange>
	</Row>
	<Row>
		<PolicyType>POLICY_PATRONAGE</PolicyType>
		<BuildingClassType>BUILDINGCLASS_HIDDEN</BuildingClassType>
		<CultureChange>1</CultureChange>
	</Row>
	<Row>
		<PolicyType>POLICY_COMMERCE</PolicyType>
		<BuildingClassType>BUILDINGCLASS_HIDDEN</BuildingClassType>
		<CultureChange>1</CultureChange>
	</Row>
	<Row>
		<PolicyType>POLICY_RATIONALISM</PolicyType>
		<BuildingClassType>BUILDINGCLASS_HIDDEN</BuildingClassType>
		<CultureChange>1</CultureChange>
	</Row>
	<Row>
		<PolicyType>POLICY_AESTHETICS</PolicyType>
		<BuildingClassType>BUILDINGCLASS_HIDDEN</BuildingClassType>
		<CultureChange>1</CultureChange>
	</Row>
	<Row>
		<PolicyType>POLICY_EXPLORATION</PolicyType>
		<BuildingClassType>BUILDINGCLASS_HIDDEN</BuildingClassType>
		<CultureChange>1</CultureChange>
	</Row>
</Policy_BuildingClassCultureChanges>
As a final note, I will add a file with all these commands in the Templates folder. Feel free to add that file into a mod so you can see the changes in-game. Be sure, of course, to use America as the player civilization when you do so.
 
currently just a placeholder. I will probably just add a link here to a mediafire filesharing address for these since none of them are quite small enough to fit within the single-post limitations
 
currently this is just a placeholder. like the post for templates I will probably just add links to mediafire filesharing addresses for these files. I want to make them readily accessible but I think I've already upped the number of posts on this guide to an eggregious degree.
 
This is an amazing thread, with information I have referenced over and over again personally.

Thank you so much for taking your time to collect this extensive data.

With that, I have a few comments:
First, in your notes for the Harbors, you are correct that its TradeRouteSeaGoldBonus works the same way its Land-based counterpart does. That is, a value of 100 is equivalent to +1 Gold. I have tested this in my current trade-based mod. However, the reason the Harbor says it provides +2 Gold is because it really does provide +2 Gold -- this is because all Sea trade routes have an intrinsic x2 multiplier attached to them, so the value of 100 providing +1 Gold is doubled to +2 Gold once the trade route is established.

Next, for the ExtraSpies parameter, attaching this to a custom building that is available -before- the Renaissance Era -still- grants you a free Spy, essentially allowing you to get into the espionage game much earlier. I tested this by attaching it to an early National Wonder replacement. Another issue: If your city gets captured, and this building gets destroyed, not only do you -keep- your free spy, but you get -another- one upon the reconstruction of the building.
This could probably cause issues unless you leave it attached to World Wonders which cannot / do not need to be rebuilt.

Finally, in my tests, MilitaryProductionModifier, BuildingProductionModifier, and WonderProductionModifier all accept negative values, and will apply a production penalty to the city. I have not yet tested SpaceProductionModifier, but I imagine it will do the same.

Along the lines of MilitaryProductionModifier, I assume every combat unit in the game falls under it. However, for units that aren't combat units, Settlers, Workers and Archaeologists are not affected by MilitaryProductionModifier. These are the only 3 units I've found which are not.
In contrast, Work Boats, Caravans, and Cargo Ships -are- affected by MilitaryProductionModifier.
 
LeeS: How would I go about making a building give +1 :c5gold: Gold from each tile worked by the city? It's a UB for my experimental Swiss civilization.
Thanks!

Code:
	<!-- any of the terrains GRASS, PLAINS, DESERT, TUNDRA, SNOW can be used -->
	<!-- any of the yields PRODUCTION, GOLD, FOOD, CULTURE, FAITH, SCIENCE can be used -->
<Building_TerrainYieldChanges>
	<Row>
		<BuildingType>BUILDING_NEW_BUILDING</BuildingType>
		<TerrainType>TERRAIN_GRASS</TerrainType>
		<YieldType>YIELD_GOLD</YieldType>
		<Yield>1</Yield>
	</Row>
</Building_TerrainYieldChanges>

You'll need to add a separate <row > for each terrain type. Simply replace _GRASS with _PLAINS, etc.

See Post 50 for further info on land tiles (the table I showed you is at the bottom of the post) and for info on lake plots and sea plots.
 
This was extremely helpful but I'm having one strange issue arise that I just noticed on my mod. It seems I'm having a random building appear when I start a new game with my custom civ, and I double checked to make sure that it's happening specifically from my mod. The first time I noticed, every city started with a Military Acadamy, and the second time, after turning off all other civs, every city started with a Floating Gardens. Is this a common issue? I can't seem to find any direct problems with the xml files, but it only started happening after I added the hidden building to the mod.

Spoiler :
<GameData>
<Buildings>
<Row>
<Type>BUILDING_CSATRAIT</Type>
<ThemingBonusHelp></ThemingBonusHelp>
<Quote></Quote>
<GoldMaintenance>0</GoldMaintenance>
<MutuallyExclusiveGroup>-1</MutuallyExclusiveGroup>
<TeamShare>0</TeamShare>
<Water>0</Water>
<River>0</River>
<FreshWater>0</FreshWater>
<Mountain>0</Mountain>
<NearbyMountainRequired>0</NearbyMountainRequired>
<Hill>0</Hill>
<Flat>0</Flat>
<FoundsReligion>0</FoundsReligion>
<IsReligious>0</IsReligious>
<BorderObstacle>0</BorderObstacle>
<PlayerBorderObstacle>0</PlayerBorderObstacle>
<Capital>0</Capital>
<GoldenAge>0</GoldenAge>
<MapCentering>0</MapCentering>
<NeverCapture>1</NeverCapture>
<NukeImmune>0</NukeImmune>
<AllowsWaterRoutes>0</AllowsWaterRoutes>
<ExtraLuxuries>0</ExtraLuxuries>
<DiplomaticVoting>0</DiplomaticVoting>
<AffectSpiesNow>0</AffectSpiesNow>
<NullifyInfluenceModifier>0</NullifyInfluenceModifier>
<Cost>-1</Cost>
<FaithCost>-1</FaithCost>
<LeagueCost>0</LeagueCost>
<UnlockedByBelief>0</UnlockedByBelief>
<UnlockedByLeague>0</UnlockedByLeague>
<HolyCity>0</HolyCity>
<NumCityCostMod>0</NumCityCostMod>
<HurryCostModifier>-1</HurryCostModifier>
<MinAreaSize>-1</MinAreaSize>
<ConquestProb>0</ConquestProb>
<CitiesPrereq>0</CitiesPrereq>
<LevelPrereq>0</LevelPrereq>
<CultureRateModifier>0</CultureRateModifier>
<GlobalCultureRateModifier>0</GlobalCultureRateModifier>
<GreatPeopleRateModifier>0</GreatPeopleRateModifier>
<GlobalGreatPeopleRateModifier>0</GlobalGreatPeopleRateModifier>
<GreatGeneralRateModifier>0</GreatGeneralRateModifier>
<GreatPersonExpendGold>0</GreatPersonExpendGold>
<GoldenAgeModifier>0</GoldenAgeModifier>
<UnitUpgradeCostMod>0</UnitUpgradeCostMod>
<Experience>0</Experience>
<GlobalExperience>0</GlobalExperience>
<FoodKept>0</FoodKept>
<Airlift>0</Airlift>
<AirModifier>0</AirModifier>
<NukeModifier>0</NukeModifier>
<NukeExplosionRand>0</NukeExplosionRand>
<HealRateChange>0</HealRateChange>
<Happiness>0</Happiness>
<UnmoddedHappiness>0</UnmoddedHappiness>
<UnhappinessModifier>0</UnhappinessModifier>
<HappinessPerCity>0</HappinessPerCity>
<HappinessPerXPolicies>0</HappinessPerXPolicies>
<CityCountUnhappinessMod>0</CityCountUnhappinessMod>
<NoOccupiedUnhappiness>0</NoOccupiedUnhappiness>
<WorkerSpeedModifier>0</WorkerSpeedModifier>
<MilitaryProductionModifier>0</MilitaryProductionModifier>
<SpaceProductionModifier>0</SpaceProductionModifier>
<GlobalSpaceProductionModifier>0</GlobalSpaceProductionModifier>
<BuildingProductionModifier>0</BuildingProductionModifier>
<WonderProductionModifier>0</WonderProductionModifier>
<CityConnectionTradeRouteModifier>0</CityConnectionTradeRouteModifier>
<CapturePlunderModifier>0</CapturePlunderModifier>
<PolicyCostModifier>0</PolicyCostModifier>
<PlotCultureCostModifier>0</PlotCultureCostModifier>
<GlobalPlotCultureCostModifier>0</GlobalPlotCultureCostModifier>
<PlotBuyCostModifier>0</PlotBuyCostModifier>
<GlobalPlotBuyCostModifier>0</GlobalPlotBuyCostModifier>
<GlobalPopulationChange>0</GlobalPopulationChange>
<TechShare>0</TechShare>
<FreeTechs>0</FreeTechs>
<FreePolicies>0</FreePolicies>
<FreeGreatPeople>0</FreeGreatPeople>
<MedianTechPercentChange>0</MedianTechPercentChange>
<Gold>0</Gold>
<AllowsRangeStrike>0</AllowsRangeStrike>
<Espionage>0</Espionage>
<AllowsFoodTradeRoutes>0</AllowsFoodTradeRoutes>
<AllowsProductionTradeRoutes>0</AllowsProductionTradeRoutes>
<Defense>0</Defense>
<ExtraCityHitPoints>0</ExtraCityHitPoints>
<GlobalDefenseMod>0</GlobalDefenseMod>
<MinorFriendshipChange>0</MinorFriendshipChange>
<VictoryPoints>0</VictoryPoints>
<ExtraMissionarySpreads>0</ExtraMissionarySpreads>
<ReligiousPressureModifier>0</ReligiousPressureModifier>
<EspionageModifier>0</EspionageModifier>
<GlobalEspionageModifier>0</GlobalEspionageModifier>
<ExtraSpies>0</ExtraSpies>
<SpyRankChange>0</SpyRankChange>
<InstantSpyRankChange>0</InstantSpyRankChange>
<TradeRouteRecipientBonus>0</TradeRouteRecipientBonus>
<TradeRouteTargetBonus>0</TradeRouteTargetBonus>
<NumTradeRouteBonus>0</NumTradeRouteBonus>
<LandmarksTourismPercent>0</LandmarksTourismPercent>
<InstantMilitaryIncrease>0</InstantMilitaryIncrease>
<GreatWorksTourismModifier>0</GreatWorksTourismModifier>
<XBuiltTriggersIdeologyChoice>0</XBuiltTriggersIdeologyChoice>
<TradeRouteSeaDistanceModifier>0</TradeRouteSeaDistanceModifier>
<TradeRouteSeaGoldBonus>0</TradeRouteSeaGoldBonus>
<TradeRouteLandDistanceModifier>0</TradeRouteLandDistanceModifier>
<TradeRouteLandGoldBonus>0</TradeRouteLandGoldBonus>
<GreatScientistBeakerModifier>0</GreatScientistBeakerModifier>
<BuildingClass>BUILDINGCLASS_CSATRAIT</BuildingClass>
<ArtDefineTag>NONE</ArtDefineTag>
<NearbyTerrainRequired></NearbyTerrainRequired>
<ProhibitedCityTerrain></ProhibitedCityTerrain>
<VictoryPrereq></VictoryPrereq>
<FreeStartEra></FreeStartEra>
<MaxStartEra></MaxStartEra>
<ObsoleteTech></ObsoleteTech>
<EnhancedYieldTech></EnhancedYieldTech>
<TechEnhancedTourism>0</TechEnhancedTourism>
<FreeBuilding>BUILDING_CSATRAIT</FreeBuilding>
<FreeBuildingThisCity></FreeBuildingThisCity>
<FreePromotion></FreePromotion>
<TrainedFreePromotion></TrainedFreePromotion>
<FreePromotionRemoved></FreePromotionRemoved>
<ReplacementBuildingClass></ReplacementBuildingClass>
<PrereqTech>NULL</PrereqTech>
<PolicyBranchType></PolicyBranchType>
<SpecialistType></SpecialistType>
<SpecialistCount>0</SpecialistCount>
<GreatWorkSlotType></GreatWorkSlotType>
<FreeGreatWork></FreeGreatWork>
<GreatWorkCount>-1</GreatWorkCount>
<SpecialistExtraCulture>0</SpecialistExtraCulture>
<GreatPeopleRateChange>0</GreatPeopleRateChange>
<ExtraLeagueVotes>0</ExtraLeagueVotes>
<CityWall>0</CityWall>
<DisplayPosition>0</DisplayPosition>
<PortraitIndex>0</PortraitIndex>
<WonderSplashImage></WonderSplashImage>
<WonderSplashAnchor>R,T</WonderSplashAnchor>
<WonderSplashAudio></WonderSplashAudio>
<IconAtlas>CIV_COLOR_ATLAS</IconAtlas>
<ArtInfoCulturalVariation>0</ArtInfoCulturalVariation>
<ArtInfoEraVariation>0</ArtInfoEraVariation>
<ArtInfoRandomVariation>0</ArtInfoRandomVariation>
</Row>
</Buildings>

<!-- Building_AreaYieldModifiers -->
<!-- Building_BuildingClassHappiness -->
<!-- Building_BuildingClassYieldChanges -->
<!-- Building_ClassesNeededInCity -->
<!-- Building_FreeUnits -->
<!-- Building_DomainFreeExperiences -->
<!-- Building_DomainProductionModifiers -->
<!-- Building_FreeSpecialistCounts -->
<!-- Building_GlobalYieldModifiers -->
<!-- Building_HurryModifiers -->
<!-- Building_LocalResourceAnds -->
<!-- Building_LocalResourceOrs -->
<!-- Building_LockedBuildingClasses -->
<!-- Building_PrereqBuildingClasses -->
<!-- Building_ResourceQuantity -->
<!-- Building_ResourceQuantityRequirements -->
<!-- Building_ResourceYieldModifiers -->
<!-- Building_ResourceCultureChanges -->
<!-- Building_ResourceFaithChanges -->
<!-- Building_RiverPlotYieldChanges -->
<!-- Building_SeaPlotYieldChanges -->
<!-- Building_LakePlotYieldChanges -->
<!-- Building_SeaResourceYieldChanges -->
<!-- Building_ResourceYieldChanges -->
<Building_ResourceYieldChanges>
<Row>
<BuildingType>BUILDING_CSATRAIT</BuildingType>
<ResourceType>RESOURCE_COTTON</ResourceType>
<YieldType>YIELD_GOLD</YieldType>
<Yield>1</Yield>
</Row>
<Row>
<BuildingType>BUILDING_CSATRAIT</BuildingType>
<ResourceType>RESOURCE_COTTON</ResourceType>
<YieldType>YIELD_CULTURE</YieldType>
<Yield>1</Yield>
</Row>
<Row>
<BuildingType>BUILDING_CSATRAIT</BuildingType>
<ResourceType>RESOURCE_SUGAR</ResourceType>
<YieldType>YIELD_GOLD</YieldType>
<Yield>1</Yield>
</Row>
<Row>
<BuildingType>BUILDING_CSATRAIT</BuildingType>
<ResourceType>RESOURCE_SUGAR</ResourceType>
<YieldType>YIELD_CULTURE</YieldType>
<Yield>1</Yield>
</Row>
<Row>
<BuildingType>BUILDING_CSATRAIT</BuildingType>
<ResourceType>RESOURCE_WINE</ResourceType>
<YieldType>YIELD_GOLD</YieldType>
<Yield>1</Yield>
</Row>
<Row>
<BuildingType>BUILDING_CSATRAIT</BuildingType>
<ResourceType>RESOURCE_WINE</ResourceType>
<YieldType>YIELD_CULTURE</YieldType>
<Yield>1</Yield>
</Row>
</Building_ResourceYieldChanges>
<!-- Building_FeatureYieldChanges -->
<!-- Building_TerrainYieldChanges -->
<!-- Building_SpecialistYieldChanges -->
<!-- Building_UnitCombatFreeExperiences -->
<!-- Building_UnitCombatProductionModifiers -->
<!-- Building_TechAndPrereqs -->
<!-- Building_YieldChanges -->
<!-- Building_YieldChangesPerReligion -->
<!-- Building_TechEnhancedYieldChanges -->
<!-- Building_YieldModifiers -->
<!-- Building_ThemingBonuses -->

<BuildingClasses>
<Row>
<Type>BUILDINGCLASS_CSATRAIT</Type>
<DefaultBuilding>BUILDING_CSATRAIT</DefaultBuilding>
</Row>
</BuildingClasses>
</GameData>
 
Jesus.

Can you, like, delete every single line that has a 0 as its value, because it already is set to 0 without you having to define it.

And your problem is probably this:
<FreeBuilding>BUILDING_CSATRAIT</FreeBuilding>
 
Haha, I'm sorry about that. I did actually go through afterwards to shorten it and, yes, that was exactly the problem.
 
Top Bottom