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

LeeS

Imperator
Joined
Jul 23, 2013
Messages
7,241
Location
Illinois, USA
XML (Advanced) Guide to Adding Buildings and Wonders to Brave New World

Support Issues Related to the Impending Release of Civ6:
  1. Other than to clean up any small whoopses or typos that may exist in the information presented I have no intentions of adding to the information nor of making any great changes to format of how the info is presented
  2. I am attempting to wind-down my Civ5 modding in preperation for the release of 6.
  3. I am not abandoning the Civ5 modding forum, I am just winding down the stuff I have in the works and that I can reasonably expect to put to bed prior to the release of 6.
  4. I intend to move on to 6 modding for the most part (or for the all part), assuming 6 is not a mess or a BE

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

I originally posted this as a Mod on the Steam Workshop. It can be found at Buildings Guide on the Steam Workshop. It is also now available here on CivFanatics at Forum Download of Buildings Guide. To give you an idea of the scope and nature of this guide I am including a link to a mediafire holdbox where you can look at and download the core document of my guide. The mediafire link is Buildings_Guide.xml. My intensions with this guide is to add all of the information in the core "Buildings_Guide.xml" file to this tutorial/reference. For now I do not intend to add any information that will be different from that provided in the download or steam versions of the guide, but I will be taking advantage of the much more powerful formatting capabilities of the forum as compared to a text-only file.

Notes on scope and purpose of the guide as it has been packaged in the download link and on my Steam Workshop mod
  • Note that the downloadable versions of this tutorial are not as up-to-date so far as new added information is concerned as is the version here on the forum. I have been updating a 'master' version of the tutorial that in the near future I will re-publish to the downloadable versions, but I am also trying to keep the need for numerous small 'updates' to a minimum.

  • I built the downloaded versions of the guide so that they could be posted to Steam, or here, and downloaded by potential users without having to worry about needing any program besides notepad to read them.

  • I wanted the core part of the guide to be a reference that anyone could easily refer to while adding a new building or wonder to the game. I therefore wanted it to be able to "live on" a user's computer, quick to refer to.

  • I wanted to make it at an accessible level to the new modder as well as to the experienced hand. When faced with "what was that darn command, again?", I wanted both sorts of modder to find the Guide a quick, easy, and useful reference.

This is my mod description as it appears on Steam. Except for the bits about downloading from steam, I think it might help give a better idea of how the downloaded version of the guide is intended to be used:

Spoiler :

Detailed XML Guide to adding Buildings and Wonders to the Game for the Brave New World expansion. Covers all XML tables that relate to buildings and wonders. If you've had trouble getting your mod to do what you want it to do, this should be the guide for you.

Also adds three range-unit enhancing buildings to the game when the MOD is enabled.

1) Subscribe to the mod and let it download to your MODs folder in the normal way.
2) exit the game.
3) navigate to your MyGames/Civilization5/MODS folder and then to the Buildings Guide mod
4) double-click on the BUILDINGS_GUIDE.XML file and it should open in notepad. If it opens in Wordpad or Word you might have to resize the margins. Or simply close the file and set your computer to open .XML files with Notepad.
5) The Guide is a text-only file with tabs as the only "special formatting", so anyone ought to be able to open it. There are a few instructions at the top of the BUILDINGS_GUIDE.XML file that tell you what the other included files are for.
6) I have added a file called Changes_2_FIRAXIS.xml that discusses formats and some strategies for changing exisitng firaxis-supplied buildings, and a file that contains all text strings (tags) that are used in-game by the firaxis-supplied buildings for the civilopedia, help pop-ups, etc.

Enabling the MOD will not try to activate the BUILDINGS_GUIDE.XML file in-game, but will activate the three buildings in the Archery Buildings folder. They are Practice Range, Archery Range, and Artillery Range. Each of these buildings gives a slight buff to constructing archery or siege units, and add small buffs to experience or quality of newly-made archery or siege units.

I REALLY SUCK AT ARTWOK so the in-game icons for the three ranged unit buildings is borrowed from existing in-game artwork.

Special Thanks and Credit should go to:

Irkalla on the CivFanatics site for figuring out how to hide a building without needing an LUA
Sun Ce of Wu of the Steam Workshop for graciously allowing me to use his Theater of Dionysus as a practical code-example for adding audio to wonder splashes
Leugi for his useful Tutorial on the CivFanatics forum for adding audio files to Civs, etc.
Ceej12 here on the Steam Workshop for his very useful intro guide to modding.


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

THREAD PAGE 1 Table of Contents

Clicking the 'Navigation Links' in this Table of Contents will cause the post # indicated to appear as a pop-up window. Simply close the pop-up window to return to the table of contents.


Post 3 : Navigation Link: Introduction

Post 4 : Navigation Link: Miscellanea
Commands: Comments Format

Post 5 : Navigation Link: <GameData> Command
Commands: <GameData>

Post 6 : Navigation Link: <Buildings> Game Table Overview
Table: <Buildings>

Post 7 : Navigation Link: Opening the <Buildings> game table
Table: <Buildings>
Commands: <Buildings>

Post 8 : Navigation Link: Start of Defining Your Building and XML-Name of Your Building
Table: <Buildings>
Commands: <Row>, <Type>

Post 9 : Navigation Link: Defining the Building Class Your Building Fits Into
Table: <Buildings>
Commands: <BuildingClass>
Includes Review Example​

Post 10 : Navigation Link: Building is free based on start eras
Table: <Buildings>
Commands: <FreeStartEra>
Includes List of usable settings for <FreeStartEra>

Post 11 : Navigation Link: Building Hammer Cost
Table: <Buildings>
Commands: <Cost>
Includes Review Example​

Post 12 : Navigation Link: World congress building projects
Table: <Buildings>
Commands: <UnlockedByLeague>

Post 13 : Navigation Link: BUILDING GOLD MAINTENANCE COST PER TURN and REQUIRED TECH TO BUILD THE BUILDING
Table: <Buildings>
Commands: <GoldMaintenance>, <PrereqTech>
Includes Review Example​

Post 14 : Navigation Link: Building is un-locked or purchasable with faith
Table: <Buildings>
Commands: <FaithCost>, <UnlockedByBelief>
Includes Review Example​

Post 15 : Navigation Link: Building civilopedia and help-tip text-look-ups
Table: <Buildings>
Commands: <Help>, <Description>, <Civilopedia>, <Strategy>, <ThemingBonusHelp>, <Quote>, and use of <Gender> within the <Language_en_US> table.
Includes Review and other Examples​

Post 16 : Navigation Link: Building render art type
Table: <Buildings>
Commands: <ArtDefineTag>, <ArtInfoCulturalVariation>, <ArtInfoEraVariation>, <ArtInfoRandomVariation>, <DisplayPosition>
Includes Review Example​

Post 17 : Navigation Link: Building is unavailable based on player start eras
Table: <Buildings>
Commands: <MaxStartEra> and listing of valid era names
Includes Review Example​

Post 18 : Navigation Link: Specialists and great person points
Table: <Buildings>
Commands: <SpecialistType>, <SpecialistCount>, <GreatPeopleRateChange>
Includes Examples​

Post 19 : Navigation Link: Specialist extra culture
Table: <Buildings>
Commands: <SpecialistExtraCulture>

Post 20 : Navigation Link: Min area size
Table: <Buildings>
Commands: <MinAreaSize>
 
For subsequent pages of the thread, clicking the 'Navigation Links' in this Table of Contents will cause the post # indicated to appear as a pop-up window. Simply close the pop-up window to return to this table of contents page.

THREAD PAGE 2 Table of Contents


Post 21 : Navigation Link: Walls, castle, arsenal, and military base defintions
Table: <Buildings>
Commands: <AllowsRangeStrike>, <Defense>, <ExtraCityHitPoints>, <CityWall>
Includes Examples as used by Firaxis​

Post 22 : Navigation Link: Building Capture probabilities on city conquest
Table: <Buildings>
Commands: <NeverCapture>, <ConquestProb>
Includes Examples as used by Firaxis, and Code Review​

Post 23 : Navigation Link: Specify a tech that enhances building yields
Table: <Buildings>
Commands: <EnhancedYieldTech>, <TechEnhancedTourism>
Includes Examples as used by Firaxis, and Code Review​

Post 24 : Navigation Link: "global" and "local" commands
Table: <Buildings>
Discusses difference between Global Effect commands and Local Effect commands​

Post 25 : Navigation Link: City tile-acquisition-cost modifiers
Table: <Buildings>
Commands: <GlobalPlotCultureCostModifier>, <GlobalPlotBuyCostModifier>, <PlotCultureCostModifier>, <PlotBuyCostModifier>
Includes Examples as used by Firaxis​

Post 26 : Navigation Link: Hurrying cost modifier
Table: <Buildings>
Commands: <HurryCostModifier>

Post 27 : Navigation Link: Terrain requirements
Table: <Buildings>
Commands: <Water>, <River>, <FreshWater>, <Mountain>, <NearbyMountainRequired>, <Hill>, <Flat>, <NearbyTerrainRequired>, <ProhibitedCityTerrain>
Includes Examples as used by Firaxis, and Code Review, and complete listing of valid settings for <NearbyTerrainRequired> and <ProhibitedCityTerrain>

Post 28 : Navigation Link: Caravan and cargo-ship trade routes
Table: <Buildings>
Commands: <TradeRouteSeaGoldBonus>, <TradeRouteLandGoldBonus>, <TradeRouteLandDistanceModifier>, <TradeRouteSeaDistanceModifier>, <AllowsProductionTradeRoutes>, <AllowsFoodTradeRoutes>, <AllowsWaterRoutes>
Includes Examples as used by Firaxis and Shows differences between G&K/Vanilla trade-route commands and BNW commands​

Post 29 : Navigation Link: MUTUALLY EXCLUSIVE GROUP, TOURISM MODIFIERS, and GREAT WORK SLOTS
Table: <Buildings>
Commands: <MutuallyExclusiveGroup>, <LandmarksTourismPercent>, <GreatWorksTourismModifier>, <GreatWorkSlotType>, and <GreatWorkCount>
Includes Code Review​

Post 30 : Navigation Link: Espionage attributes
Table: <Buildings>
Commands: <Espionage>, <EspionageModifier>, <EspionageModifier>, <GlobalEspionageModifier>, <AffectSpiesNow>, <ExtraSpies>, <SpyRankChange>, <InstantSpyRankChange>
Includes Examples as used by Firaxis​

Post 31 : Navigation Link: Miscellaneous Commands To Allow World Wonder Special Capabilities
Table: <Buildings>
Commands: <BorderObstacle>, <ObsoleteTech>, <MedianTechPercentChange>, <UnhappinessModifier>, <ExtraLeagueVotes>
Includes Examples as used by Firaxis​

Post 32 : Navigation Link: FREE BUILDINGS and FREE PROMOTIONS
Table: <Buildings>
Commands: <FreeBuildingThisCity>, <FreeBuilding>, <TrainedFreePromotion>, <FreePromotion>, <FreePromotionRemoved>
Includes Examples as used by Firaxis​

Post 33 : Navigation Link: CULTURE RATE MODIFIERS, HAPPINESS AND UNHAPPINESS, and GOLDEN AGES
Table: <Buildings>
Commands: <CultureRateModifier>, <GlobalCultureRateModifier>, <UnmoddedHappiness>, <Happiness>, <UnhappinessModifier>, <NoOccupiedUnhappiness>, <HappinessPerCity>, <GlobalPopulationChange>, <HappinessPerXPolicies>, <CityCountUnhappinessMod>, <GoldenAgeModifier>, and <GoldenAge>

Post 34 : Navigation Link: PRODUCTION MODIFIERS and GREAT PEOPLE ACQUISITION-RATE MODIFIERS
Table: <Buildings>
Commands: <MilitaryProductionModifier>, <WonderProductionModifier>, <BuildingProductionModifier>, <SpaceProductionModifier>, <GlobalSpaceProductionModifier>, <GreatGeneralRateModifier>, <GlobalGreatPeopleRateModifier>, and <GreatPeopleRateModifier>

Post 35 : Navigation Link: WONDER BUILD REQUIREMENTS and SOCIAL POLICY COST COMMANDS
Table: <Buildings>
Commands: <HolyCity>, <PolicyBranchType>, <PolicyCostModifier>, and <FreePolicies>
Includes properly-formatted list of all the valid Social Policy Branch XML-Names.​

Post 36 : Navigation Link: National Wonder Commands
Table: <Buildings>
Commands: <Capital>, <NumCityCostMod>, <ReligiousPressureModifier>

Post 37 : Navigation Link: Miscellaneous commands
Table: <Buildings>
Commands: Click on the Spoiler button to see a full listing of the column commands covered.
Spoiler :
Code:
<NullifyInfluenceModifier>
<ExtraLuxuries>
<Airlift>
<AirModifier>
<NukeImmune>
<NukeModifier>
<FreeTechs>
<WorkerSpeedModifier>
<GlobalPopulationChange>
<HappinessPerCity>
<XBuiltTriggersIdeologyChoice>
<CapturePlunderModifier>
<UnitUpgradeCostMod>
<FoodKept>
<GreatScientistBeakerModifier>
<GreatPersonExpendGold>
<FreeGreatPeople>
<GlobalDefenseMod>
<MinorFriendshipChange>
<CityStateTradeRouteProductionModifier>
<ExtraMissionarySpreads>
<InstantMilitaryIncrease>
<GreatWorkSlotType>
<GreatWorkCount>
<FreeGreatWork>
<Gold>
<Experience>
<VictoryPrereq>
<DiplomaticVoting>
<Teamshare>
<TechShare>
<HealRateChange>

NON-FUNCTIONAL COMMANDS:
	(either tested and found to do nothing,
	or tested but the effect was not apparant)

GlobalExperience
CitiesPrereq
LevelPrereq

UNKNOWN OR NON-FUNCTIONAL COMMANDS
	(not tested and I have no idea about them)

NukeExplosionRand
VictoryPoints
ReplacementBuildingClass	(I have tested this and will be added an update to the guide)
FoundsReligion
IsReligious
PlayerBorderObstacle
MapCentering

Post 38 : Navigation Link: Game art changes with eras or cultures
Table: <Buildings>
Commands: <ArtDefineTag>, <ArtInfoEraVariation>, <ArtInfoCulturalVariation>, <ArtInfoRandomVariation>, <DisplayPosition>
Includes Examples as used by Firaxis​

Post 39 : Navigation Link: Art definitions for icons used in city screen, civilopedia, and tech tree displays
Table: <Buildings> Commands: <Portrait Index>, <IconAtlas>
Table: <IconTextureAtlases> Commands: All commands for the <IconTextureAtlases> table.
Includes Examples as used by Firaxis, and Code Samples​

Post 40 : Navigation Link: Wonder splash screen
Table: <Buildings>
Commands: <WonderSplashImage>, <WonderSplashAnchor>, <WonderSplashAudio>, <Quote>

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

THREAD PAGE 3 Table of Contents


Post 41 : Navigation Link: End of defining your building
Table: <Buildings>
Commands: </Row>
Includes Code Reviews for ways a building defintion can be used: World Wonder, "Regular" Building, with a properly-formatted example for an <IconTextureAtlases> table​

Post 42 : Navigation Link: Building classes table
Table: <BuildingClasses>
Commands: All commmands for the table
Examples Shown​

Post 43 : Navigation Link: Civilization building class overrides table
Table: <Civilization_BuildingClassOverrides>
Commands: All commmands for the table
Examples Shown​

Post 44 : Navigation Link: Building PrereqBuildingClasses
Table: <Building_PrereqBuildingClasses>
Commands: All for Table​

Post 45 : Navigation Link: Building classes needed in city table
Table: <Building_ClassesNeededInCity>
Commands: All commmands for the table
Examples Shown​

Post 46 : Navigation Link: Locked Building Classes Table
Table: <Building_LockedBuildingClasses>
Commands: All for Table​

Post 47 : Navigation Link: Tech and prereqs table
Table: <Building_TechAndPrereqs>
Commands: All commmands for the table
Examples Shown​

Post 48 : Navigation Link: Modifier Tables
Table: <Building_YieldModifiers>, <Building_GlobalYieldModifiers>, <Building_AreaYieldModifiers>, <Building_HurryModifiers>
Commands: All commmands for the tables
Discussion of Difference between modifier and changes tables. Examples Shown for all tables covered.​

Post 49 : Navigation Link: Yield Changes Tables
Table: <Building_YieldChanges>, <Building_SpecialistYieldChanges>, <Building_YieldChangesPerPop>, <Building_BuildingClassYieldChanges>, <Building_BuildingClassHappiness>, <Building_YieldChangesPerReligion>
Commands: All for all tables shown
Includes info on Specialist Yields as related to Buildings​

Post 50 : Navigation Link: Terrain-Related Yield Changes Tables
Table: <Building_RiverPlotYieldChanges>, <Building_SeaPlotYieldChanges>, <Building_LakePlotYieldChanges>, <Building_SeaResourceYieldChanges>, <Building_FeatureYieldChanges>, <Building_TerrainYieldChanges>
Commands: All commmands for the table
Examples Shown​

Post 51 : Navigation Link: Resource Yield Changes and Resource Building Construction Requirements
Table: <Building_ResourceYieldModifiers>, <Building_ResourceYieldChanges>, <Building_LocalResourceAnds>, <Building_LocalResourceOrs>, <Building_ResourceQuantityRequirements>, <Building_ResourceQuantity>
Commands: All commmands for the table
Examples Shown​

Post 52 : Navigation Link: TECH ENHANCED YIELD CHANGES TABLE and FREE UNITS TABLE
Table: <Building_TechEnhancedYieldChanges> and <Building_FreeUnits>
Commands: All commmands for the table
Examples Shown. Includes a listing of Unit designations for the <Building_FreeUnits> table.​

Post 53 : Navigation Link: UNIT DOMAINS AND UNITCOMBAT TYPE tables
Table: <Building_DomainFreeExperiences>, <Building_UnitCombatFreeExperiences>, <Building_UnitCombatProductionModifiers>, <Building_DomainProductionModifiers>, <Building_DomainFreeExperiencePerGreatWork>
Commands: All commmands for the table
Examples Shown. Includes a listing of properly-formatted XML-code for Unit Domain Types, Unit Combat Types, and the units assigned to each.​

Post 54 : Navigation Link: Building flavors table
Table: <Building_Flavors>
Commands: All commmands for the table
Includes a list of all valid Building Flavors, with Examples Shown, and some guidance on certain flavors.​

Post 55 : Navigation Link: Theming bonuses table (1)
Table: <Building_ThemingBonuses>
Commands: All commmands for the table
Includes charts for theming bonuse commands as used by Firaxis. Examples of how to use are shown in Post # 56.​

Post 56 : Navigation Link: Theming Bonuses Table (2)
Table: <Building_ThemingBonuses>
Commands: All commmands for the table
Examples Shown as were used by Firaxis for all Firaxis-supplied buildings and wonders with Theming Bonuses. Includes info on how to structure entries in the <Language_en_US> as they relate to Theming Bonuses.​

Post 57 : Navigation Link: Belief tables that affect, control, or reference buildings
Table: <Belief_BuildingClassYieldChanges>, <Belief_BuildingClassHappiness>, <Belief_BuildingClassTourism>, <Belief_BuildingClassFaithPurchase>
Commands: All Commands for Tables shown, including examples of how Firaxis used the tables​

Post 58 : Navigation Link: Policy tables that affect, control, or reference buildings
Table: <Policy_BuildingClassYieldChanges>, <Policy_BuildingClassProductionModifiers>, <Policy_BuildingClassTourismModifiers>, <Policy_BuildingClassHappiness>, <Policy_BuildingClassYieldModifiers>, <Policy_BuildingClassCultureChanges>
Commands: All Commands for Tables shown, including examples of how Firaxis used the tables​

Post 59 : Navigation Link: Non-functional tables
Table: <Building_FreeSpecialistCounts>, <Building_ResourceFaithChanges>, <Building_ResourceCultureChanges>

Post 60 : Navigation Link: Guide for Changing Firaxis' XML (1)
Commands that are discussed in this supplement are:
  1. <Update>
  2. <Set>
  3. <Where>
  4. <Replace>
  5. <Delete>
Post # 60 Includes Advices and Practical Examples for Changing the in-game effects of Firaxis-Made Buildings
  1. Where to find the existing Firaxis-made XML files on your computer
  2. How to understand the XML file-naming conventions employed for BNW
  3. Methods for structuring an <Update> command set
  4. Use of the <Row> command set in subsidiary Building tables when adding a new effect to an existing building
  5. Mixing of <Row> and <Update> to achieve a desired group of changes

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

THREAD PAGE 4 Table of Contents


Post 61 : Navigation Link: Guide for Changing Firaxis' XML (2)
Post # 61 Includes Advices and Practical Examples for Changing the in-game effects of Firaxis-Made Buildings
Determining what TXT_KEY <Text> strings might need alterations to the <Language_en_US> table, and strategies for making the changes.

Post 62 : Navigation Link: Guide for Changing Firaxis' XML (3)
Commands that are discussed in this supplement are:
Post # 62 Includes Advices and Practical Examples for Changing the in-game effects of Firaxis-Made Buildings
  1. The <Buildings> table and <Update>
  2. <Replace> and <InsertOrAbort>
  3. <Delete>

Post 63 : Navigation Link: Guide for Changing Firaxis' XML (Game Errata)
Post # 63 Includes Information on Erratic usages by Firaxis of the Civilopedia <Help> Command in three of the Firaxis-supplied World Wonders
  1. Taj Mahal
  2. Pyramids
  3. Chichen Itza

Post 64 : Navigation Link: Adding audio to world wonders
A complete supplimentary tutorial with practical exmaples shown​

Post 65 : Navigation Link: Using hidden buildings to create unique civ leader traits
A complete supplimentary tutorial with practical exmaples shown​

Post 66 : Navigation Link: Building and Wonder Templates
Links to mediafire storage sites where templates can be downloaded. will be added soon​

Post 67 : Navigation Link: Files referenced in the Guide
Links to mediafire storage sites where all off-site files mentioned or referred to in this guide can be downloaded. will be added soon​

Post 68 : Navigation Link: placeholder 1
placeholder​

Post 69 : Navigation Link: placeholder 2
placeholder​

Post 70 : Navigation Link: placeholder 3
placeholder​

Post 71 : Navigation Link: placeholder 4
placeholder​

Post 72 : Navigation Link: placeholder 5
placeholder​

Post 73 : Navigation Link: placeholder 6
placeholder​
 
BUILDINGS GUIDE
V5.0
by lshipp (Steam)
LeeS (Civfanatics)​


1)If you have not already done so I highly recommend you download and read through Derek "Kael" Paxton's modding guide for Civilization V. It can be found at the following web address:

Derek "Kael" Paxton's Modding Guide:​

It is a PDF file which you can save to your computer, and thereby use as neeeded without having to be online to do so.​

2) I also highly recommend you look through "ceej12's" guide to mod creation and uploading, located on Steam at:


Ceej12 has a few nuggets for the beginning modder which saved me no end of trouble, since ModBuddy is really not as intuitive as one would like, as a newbie modder.​

3) If you are a member of the CivFanatics forum you can contact me at "LeeS" for help or advice.


4) On The Structure of This Tutorial, as it is downloaded either via the Steam Workshop or the CivFanatics download database:

All files within this tutorial were created using Notepad, are text-only, and do not contain any special or hidden formatting codes. Within this tutorial you will find a few sub-folders. The sub-folders contain reference files that you can use to help you in the creation of MODS.​

A) Under the "Archery Buildings" folder are three files called "Archery Range.xml", "Artillery Range.xml", and "Practice Range.xml". These files will add three ranged-unit-related-buildings to the game if you "enable" the MOD in the MODS game-menu. These three files are the ONLY ones that will be activated by the game when the MOD is enabled. You can also use these buildings for practice in creating a mod by adding them to your own at-home mod using Modbuddy. They are good to go and have no "troubles" with them. You can read the descriptions within the actual files themselves to see what each of these buildings does in-game.

The primary reason these three buildings are inlcuded is to give a few examples of fully-functional buildings that can be added to the game and will operate as advertised. You can then compare what shows up in-game to the actual XML text of these three buildings.

B) Under the "Lists" folder are numerous files with names like "List_IconsTextCommands.xml". All of these files are inlcuded for your use as reference material. All of the commands included within them are properly formatted for use in the game. So if you want to add the proper icon for the Wheat resource into the text descriptions of your mod, you can look in the "List_IconsTextCommands.xml" file and find the properly-formatted command for that without having to wade through the entire FIRAXIS-supplied XML to find it.

C) Under the "Templates" folder are three files called "TEMPLATE_BUILDING.xml", "TEMPLATE_WONDER_NATIONAL.xml", and "TEMPLATE_WONDER_WORLD.xml". These files contain example building templates for each of the three main types of buildings that can be added to the game, with all appropriate commands for a regular building, a National Wonder, and a World Wonder. They are intended for your use. Anything that does not apply to the building you are creating can be deleted. Each of these files include properly-commented notes on what commands you need, what "command-groups" do, etc. My advice in using these templates would be to first copy the file or files "as is" into your mod using the ModBuddy tool, and then within ModBuddy rename the file as appropriate, and to then edit as needed. Recently I have added a hidden building template called "TEMPLATE_HIDDEN_BUILDING.xml".

D) Under the "FIRAXIS In-Game Text" folder is a file called "Text_Buildings.xml" which contains all of the text-generating commands used by FIRAXIS for buildings and wonders. You can use this file to search for a particualar "TXT_KEY_" tag when altering the effects of a pre-existing building or wonder. Makes it a lot easier to see what text already is used in-game, and to then decide if you need to alter it in any way to conform to the changes you are making with your mod. Currently this file could use a little organizational smoothing to put all of the Description tags together, for example, but so long as you use "Edit > Find" that won't really matter so far as making this a usable tool.

E) I have added a new folder called "Suppliments". In this folder I have placed the suppliments I have added to this guide since I first published it to the workshop. Currently these Suppliments are:

1) Changes_2_FIRAXIS.xml

Has info on making changes to FIRAXIS-supplied buildings and covers the difference between <Row> and <Update> commands, and discusses <Where>, <Set>, Delete>, and <Replace> commands. Shows a few practical examples of simple mods that alter existing FIRAXIS-supplied buildings.

2) Hidden Buildings.xml

Has info on adding a hidden building to the game. Hidden buildings can be useful for creating a new unique trait for a civilization leader. Shows how to create a leader trait with the hidden building as one of its capabilities, how to add a leader trait to a leader, and shows one example of how a hidden building can be structured to allow a unique civilization ability that can't be done with the commands available in the Leader Traits XML-tables. I have added a file called "TEMPLATE_HIDDEN_BUILDING.xml" to the TEMPLATES folder that contains the commands I used in testing this ability. You can use this template as a starting point, or you can directly add it to a test mod of your own to see in-game how the hidden building works. Just remember that in-game the building will be hidden so you won't be able to see it referenced anywhere, nor will it appear in the city buildings list.

3) Buffs_and_Samples.xml

Has some samples of Updating and Altering various different sorts of in-game tables. There are also a few building and wonder samples. All of these samples are properly formatted so you can directly copy them to a test mod you are making. Or you can use them as a starting point for something you want to do yourself. I included a buff I did to the Alhambra wonder that adds a new promotion to the game and makes the Alhambra world wonder give this promotion for free to all appropriate units everywhere on the map (similar to the Great Lighthouse and Statue of Zeus promotions). This does make the Alhambra a bit OP, and the promotion itself might be a bit overpowered, but I am less interested in that than in showing you how to add a promotion to the game as a direct and inherent property of a world wonder.

4) Adding Audio.xml

Includes instructions on what new XML-tables are required to add custom audio speech to a new world wonder. It also covers the ModBuddy requirements in order to add-in your audio files to the game. This supplement supercedes anything contained within the Buildings_Guide.xml document so far as audio files are concerned. I would like to thank Sun Ce of Wu once more for the use of his Theater of Dionysus world wonder as a practical example of the XML commands required to add audio speech to a World Wonder. Also a lot of credit should accrue to Leugi from the CivFanatics website for a good explanation of what the various audio table commands do. I have included link info to Leugi's Tutorial, and to Sun Ce of Wu's excellent mod from the Steam Workshop.
I have also updated the World Wonder template so that it includes the necessary commands and tables for custom World Wonder audio speech.​

Structure of the Guide as it is here and in the downloadable versions:

I have written the Guide as if everything shown within it is something new that will be added to the game by your mod. Therefore everything is shown as "<Row>" commands instead of "<Update>" commands. The "words" for the various commands shown is the same whether the "<Row>" or the "<Update>" command is used within a mod, but the "syntax" is a little different. I have kept to this convention of using "<Row>" even in the few cases where I am showing an example and in the specific case being discussed I would actually use an "<Update>" command if I were creating a mod I intended to use in the game.

Here is the way a series of commands might look when using the "<Row>" command:

Code:
<Building_YieldChanges>
	<Row>
		<BuildingType>BUILDING_GIANT_REFRIDGERATOR</BuildingType>
		<YieldType>YIELD_GOLD</YieldType>
		<Yield>1</Yield>
	</Row>
</Building_YieldChanges>


In such a case I would be telling the game that my new building "BUILDING_GIANT_REFRIDGERATOR" will give 1 (one) Gold per turn.

If there were such a building as a "BUILDING_GIANT_REFRIDGERATOR" already in the game as supplied by FIRAXIS, I might want to make a simple mod that boosts its Gold output to "2" Gold per turn instead of only "1" Gold per turn. In such a case I would use the "<Update>" command to give this instruction, instead of the "<Row>" command:

Code:
<Building_YieldChanges>
	<Update>
		<Where BuildingType="BUILDING_GIANT_REFRIDGERATOR" YieldType="YIELD_GOLD"/>
		<Set Yield="2"/>
	</Update>
</Building_YieldChanges>


NOTE: For more info and hints on altering existing buildings or wonders, refer to the file called "Changes_2_FIRAXIS.xml" located in the "Suppliments" folder.

"<ROW>" OR "<UPDATE>" GENERAL RULE OF THUMB

It is generally better to adopt the rule of thumb where anything new you add to the game should be presented using the "<Row>" format, and anything THAT ALREADY EXISTS within the game AS SUPPLIED BY FIRAXIS should be changed using the "<Update>" format.

BECAUSE I SUCK AT ARTWORK I will not attempt to discuss how to draw artwork, how to store it correctly in "art atlas files", or anything else directly-connected to the creation of artwork. I will only discuss how to make the game XML use artwork once it is made.

ALL IN CAPS
Many commands are shown ALL IN CAPS. This is the standard convention adopted by FIRAXIS. It is possible to show most commands that are normally shown ALL IN CAPS in smallcase, but this is not a good strategy to adopt. First, it is easier to read the XML-text of your mod when normally all-caps commands are shown in all caps. Second, many of the commands that reference pre-existing FIRAXIS-supplied XML must be presented exactly as supplied by FIRAXIS in order to get your mode to work correctly, and these referenced commands are almost exclusively presented ALL IN CAPS. You never can tell whether the command is hard-coded by the game to look for all caps, so why give yourself troubleshooting headaches ?

Other commands are shown in combinations of CAPS and smallcase. These commands should be presented EXACTLY as shown, as any deviations might be interpreted by the game software as invalid commands. Typos really do matter. In trouble-shooting why your mod does not seem to be working correctly, look for typos first.

FALL 2013 UPDATE PATCH
1) The release of the fall update patch now allows the import of custom audio files to world wonders, great works, etc. You can safely ignore the comments in this guide that were based on the earlier inability to include custom audio files with world wonder mods.

2) I have updated this guide to include the building commands that have become "usable" with the fall update patch.

3) Many of the examples I have shown demonstrating a properly-formatted building attribute, or a properly-formatted entry for various of the "buildings" tables, use the actual commands used by FIRAXIS for a particular building supplied with the game. I adopted this approach in many cases because I felt it would allow easy comparison of those examples with the game documentation (civilopedia) specifying what a building does in-game, and therefore would allow an easier understanding of what a particular table or attribute does.

Since the release of the Fall 2013 patch, some of the particulars of these examples may have changed insofar as some buildings may have had the FIRAXIS-supplied XML altered for a particular attribute or table entry. I have not attempted to chase down every possible case where this is true. The examples as shown, however outdated in the particulars, are still valid in that they show the correct format for whatever building attribute or table they were intended to demonstrate.​
 
XML "COMMENT" COMMANDS

The following characters, in the order shown, signal the game that a human-readable comment is about to be inserted within the XML:


Code:
<!--


The following characters, in the order shown, signal the end of a human-readable comment inserted within the XML:


Code:
-->

Anything that appears between these two character groups will be ignored by the game. The following are all considered human-readable comments by the game software:


(1) Short comment


Code:
<!-- here is a short comment -->

(2) Multi-line comment that also disables an entire game table


Code:
<!-- here is a multi-line comment that also serves to disable the commands within it
<Building_GlobalYieldModifiers>
	<Row>
		<BuildingType>BUILDING_TEMPLE_ARTEMIS</BuildingType>
		<YieldType>YIELD_FOOD</YieldType>
		<Yield>10</Yield>
	</Row>
</Building_GlobalYieldModifiers>
which has the effect of removing this entire table relating to the Temple
of Artemis world wonder from the game -->


(3) In this example the command for "<FreeStartEra>ERA_MEDIEVAL</FreeStartEra>" has been turned into a comment, and would have no effect on the game. Everything else would still be active.

Code:
<GameData>
	<Buildings>
		<Row>
			<Type>BUILDING_EXAMPLE</Type>
			<BuildingClass>BUILDINGCLASS_EXAMPLE</BuildingClass>
			<!--	<FreeStartEra>ERA_MEDIEVAL</FreeStartEra>	-->
			<Cost>100</Cost>
......................................................................................................................................


I have tried to make this guide "all-inclusive". In doing so there may be segments of the guide that seem like information overkill, but I have included the "full value" of the information to make this guide a more useful reference document.

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


AUTHOR'S NOTES

You may encounter a few comments presented in the following format:

[[not satisfied with this section]]​

These are my notes to myself where I intend to add additional commentary, or to redraft, etc. I am not going to promise that I have deleted all such notes to myself back out of this file. The use of "[[" and "]]" denote a note to myself. A single use of these characters "[" and "]" denote the beginning and end of XML in-game-text formatting commands, but as none of those XML commands appear in this guide, I don't think anyone will really mistake the one for the other.
 
GAME DATA​


At the beginning of every XML file in your mod you must have the command "<GameData>" at the top of the XML commands you include in your mod. At the very end of every XML file in your mod you must have the command "</GameData>". I have not always shown these two commands in examples I have presented. Remember that you MUST have these commands in order for the game software to "read-in" your MOD's XML commands.


NOTE:

Spoiler :
There are some special types of game tables that do not use <GameData> as a starting header, but since none of these tables relate to buildings, or are shown in this guide, we can all pretend they don't exist. Nor do I wish to add another layer of confusion to the new modder's understanding of what is required to make functional XML commands.
 
BUILDINGS TABLE​

The "<Buildings>" table is the most complex of all the tables used to add buildings to the game primarily because it has so many attributes (or command-lines) that can be included within a single building. I will present a "line-by-line" explanation of everything that CAN be included in this table in an entry for a new building, but not every building SHOULD have an entry for every attribute (command-line).

Any attribute that doesn't really apply to a new building you are creating can be omitted. The structure of XML in CIV5 allows for this, and attributes that are left off a building definition are assumed by the game to have values of "NULL", or "false", or "0", depending on the individual attribute.

I will draw a clear distinction between that which is REQUIRED and that which is OPTIONAL by always specifically telling you when you MUST have a command or attribute included in your building definition.
 
START OF DEFINING BUILDINGS

You need to tell the XML that you are about to start adding information to the "<Buildings>" table. You must therefore always include this command:


Code:
<Buildings>


It tells the game to open the <Buildings> table and enter new information under that table. The "new information" part will be the Building or Wonder you are adding to the game.
 
START OF DEFINING YOUR BUILDING

You need to tell the XML that you are about to start adding A NEW BUILDING to the "<Buildings>" table. You must therefore always include this command:


Code:
<Row>


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

NAME OF THE BUILDING

This is the name of the building used in the XML to identify the building. It should be stated ALL IN CAPS. It is not the same thing as the building name that shows up in-game in the city display of buildings built, buildings that can be added to the que, or buildings that can be purchased with gold or faith.

The name of the building SHOULD be made in the format "BUILDING_WHATEVERYOUWANTTOCALLIT" with the "BUILDING_" at the beginning of the building name. Here is a properly formatted command, telling the game that I am going to refer to my new building as "BUILDING_EXAMPLE":


Code:
<Type>BUILDING_EXAMPLE</Type>


You MUST have an entry for "<Type>".
 
BUILDING CLASS THE BUILDING IS PART OF

The building class allows for the replacement of a "generic" building that all players can build with a unique building that only one civ can build. Thus, for example, Barracks, Krepost, and Ikanda all belong to the "BUILDINGCLASS_BARRACKS" building class. Here is a properly formatted command, telling the game that I am going to place my new building that I just named "BUILDING_EXAMPLE", into the Barracks Class of Buildings:

Code:
<BuildingClass>BUILDINGCLASS_BARRACKS</BuildingClass>

You MUST tell the game what CLASS of building your new building belongs to. You can use an existing building class when this is appropriate, but many times you will be creating a whole new buildingclass for your building. To do this you simply make up a new name of buildingclass. When your new building fits within an existing Building-class you must still include the line for "<BuildingClass>" within your building definition, and you MUST state the name of the building-class exactly as FIRAXIS named it, CAPS and all.

The name of the buildingclass SHOULD be made in the format "BUILDINGCLASS_WHATEVERYOUWANTTOCALLIT" with the "BUILDINGCLASS_" at the beginning of the buildingclass name. Here, I have invented a new buildingclass that I have called "BUILDINGCLASS_EXAMPLE":


Code:
<BuildingClass>BUILDINGCLASS_EXAMPLE</BuildingClass>



NOTE:

I must also "register" this new class of building, but as that is done under a different XML table than "<Buildings>" I will explain how to do that elsewhere in this guide. When you are adding a new unique building that fits within a pre-existing class of buildings, you do not need to "register" the CLASS of building with the game, as this has already been done.

Here are the top five lines of XML for my new building "BUILDING_EXAMPLE" showing what they would look like in actual executable code:

Spoiler :
Code:
<GameData>
	<Buildings>
		<Row>
			<Type>BUILDING_EXAMPLE</Type>
			<BuildingClass>BUILDINGCLASS_EXAMPLE</BuildingClass>
 
<FreeStartEra>​

The building will be added for free to every city founded by the player when gameplay is started at this era or a later one. Obviously, ERA_ANCIENT is never included.

Wonders should not be assigned a "FreeStartEra"

This is the list you would pick from, shown in properly-formatted code:

Spoiler :
<FreeStartEra>ERA_CLASSICAL</FreeStartEra>
<FreeStartEra>ERA_MEDIEVAL</FreeStartEra>
<FreeStartEra>ERA_RENAISSANCE</FreeStartEra>
<FreeStartEra>ERA_INDUSTRIAL</FreeStartEra>
<FreeStartEra>ERA_MODERN</FreeStartEra>
<FreeStartEra>ERA_POSTMODERN</FreeStartEra>
<FreeStartEra>ERA_FUTURE</FreeStartEra>​

Pick ONLY ONE for your building, or none at all. You can omit this command entirely.
 
Building Hammers Cost​

The cost in hammers that shows up in-game will be modified somewhat from this number based on player difficulty level, starting era, and game speed. The hammer costs shown in the "<Buildings>" table are those that would apply to the PRINCE difficulty level, Ancient Era Start, and Standard game speed. You should not concern yourself too much with this game-mechanic. Just pick a hammers cost number that seems reasonable based on similar-building hammer costs and for buildings that become available at about the same place in the tech tree.

A building that replaces gardens should have approximately the same hammer cost as gardens. If such a replacement building for gardens has a much more powerful effect than the standard gardens, the hammers cost should probably reflect this greater capabilty. Alternatively, such a building could be given the same hammer cost as gardens, but be given a higher per-turn gold maintenance cost to compensate for its greater effects.

As shown in the following example, the production cost for the building would be 100 hammers:

Code:
<Cost>100</Cost>

A building that is only intended to be purchasable with faith uses a "-1" for the building "Cost", as in the following:

Code:
<Cost>-1</Cost>

Cathedrals, Mosques, Pagodas, and Monasteries all use a "Cost" of "-1".

A building that is only intended to be constructed by the co-operative World Congress construction method also uses "-1" for the building "Cost".

You MUST have a "<Cost>" entry.

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

EXECUTABLE CODE REVIEW​

To review the executable code that might be added to my building "definition" so far, if I choose "100" as my construction cost, and if I choose to have my building "free" starting in the MEDIEVAL era, my code would look like this:

Spoiler :
Code:
<GameData>
	<Buildings>
		<Row>
			<Type>BUILDING_EXAMPLE</Type>
			<BuildingClass>BUILDINGCLASS_EXAMPLE</BuildingClass>
			<FreeStartEra>ERA_MEDIEVAL</FreeStartEra>
			<Cost>100</Cost>
 
UnlockedByLeague​

Designates that the building can only be built by the co-operative efforts of multiple cities in multiple civilizations, and then only after a favorable World Congress vote. The International Space Station uses this designation. You will not normally include this in your building unless you are attempting to add a World Congress building-type construction project. In which case: "Thou art a better man than I, Gunga Din".

The code to make a building unlocked by the World Congress is:


Code:
<UnlockedByLeague>true</UnlockedByLeague>


(I will not be including "UnlockedByLeague" in the EXECUTABLE CODE REVIEWS)

You can omit the "<UnlockedByLeague>" command.
 
BUILDING GOLD MAINTENANCE COST PER TURN​

This sets how much a building costs in gold maintenance every turn. You can enter any whole number you want, but too high a number will only make your building a "game-breaker". Too low a number based on the power of your building effects will also tend to break game-balance.

You can set this to "0", but you shouldn't try putting a negative number here.

You can omit the line entirely, as the BUILDING_CARAVANSARY does, and as all national and world wonders do.

Here is a properly-formatted line to make a building cost 4 Gold per turn in maintenance:

Code:
<GoldMaintenance>4</GoldMaintenance>

You can omit the "<GoldMaintenance>" command, and for World and National Wonders you should generally omit a gold maintenance cost.

Setting Gold Maintenance to "0" (or omitting the column altogether) has the result of making the building unsellable.
.....................................................................................................................................................................


REQUIRED TECH TO BUILD THE BUILDING​

You can set this to any of the techs in the game, or you can make a new tech in your mod and then specify that your building requires this new tech. You can omit the line entirely, as the BUILDING_MONUMENT does. This makes the building available to build from the 1st turn.

Here is a properly-formatted line to make a building require the Mathematics technolgy before the building can be constructed:


Code:
<PrereqTech>TECH_MATHEMATICS</PrereqTech>


You can omit the "<PrereqTech>" entry. When you do so, the building is available from the very start of the game.

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


EXECUTABLE CODE REVIEW​

To review the executable code that might be added to my building "definition" so far, if I choose "1" gold per turn as my maintenance cost, and if I select "POTTERY" as the required tech to construct my building, my code would look like this:

Spoiler :
Code:
<GameData>
	<Buildings>
		<Row>
			<Type>BUILDING_EXAMPLE</Type>
			<BuildingClass>BUILDINGCLASS_EXAMPLE</BuildingClass>
			<FreeStartEra>ERA_MEDIEVAL</FreeStartEra>
			<Cost>100</Cost>
			<GoldMaintenance>1</GoldMaintenance>
			<PrereqTech>TECH_POTTERY</PrereqTech>
 
[[not satisfied with this section]]
[[seems a little cluttered and confused]]

BUILDING IS UN-LOCKED OR PURCHASABLE WITH FAITH​

Pagodas, Mosques, Monasteries and Cathedrals are ONLY purchasable with faith, while Universities, Public School, Research Labs and the like can be built in the normal way, or purchased either with gold in the normal way, or purchased with faith if a player chooses the proper reformation belief.

Unlocked by a Follower, Founder, or Enhancer Belief:

If the building is to be buyable with faith you need to add both a <FaithCost> and the designator <UnlockedByBelief> when the building is only buyable if the player chooses a specific belief for their religion. You also generally will need to set the normal "Cost" to "-1". Setting <Cost>-1</Cost> is not absolutely required, but it is the way it is usually done.

If you want the building to be purchasable with faith after the player selects a belief for their religion, you will also have to create a new belief for the <Beliefs> XML, or you will have to edit an existing belief to allow that. An entry in the <Belief_BuildingClassFaithPurchase> table is required. Pantheon beliefs are not allowed by the game to have entries in the <Belief_BuildingClassFaithPurchase> table. Attempts to place the name of a Pantheon belief into the <Belief_BuildingClassFaithPurchase> table will be ignored by the game.

Unlocked by a Reformation Belief:

If you want the building to be purchasable with faith after the player selects a Reformation for their religion, you will also have to create a new Reformation belief for the <Beliefs> XML, or you will have to edit an existing Reformation belief to allow that. An entry in the <Belief_BuildingClassFaithPurchase> table is required. You will need to include both a <FaithCost> and the designator <UnlockedByBelief> here in the <Buildings> table.

<FaithCost> and <Cost> commands depend on the type of Belief:
  • Buildings that are made purchasable with faith upon adopting a REFORMATION belief are also generally available in the "normal" ways, by building them or buying them with gold. For these buildings the "<FaithCost>" is additional to the regular "<Cost>".
  • Buildings that are made purchasable with faith upon adopting a FOLLOWER, FOUNDER, or ENHANCER belief are generally ONLY made available to the player by buying them with faith. These types of buildings will have a "<FaithCost>", but will also, as mentioned in the notes on "<Cost>", usually have their regular "<Cost>" value set to "-1".
  • A follower, founder, or enhancer belief can also be used to allow faith purchase of a building in the same manner as a reformation belief. This is not how it is normally done, but there is nothing to stop you from doing so.

NOTE:

Regardless of which method you use to make your building available to buy with faith points, you do not specify which belief unlocks which building anywhere in the "Buildings" XML. That is done under the "Beliefs" segment of XML in the "<Belief_BuildingClassFaithPurchase>" table.

EXAMPLES:

Here are the properly-formatted lines to make a building purchasable with "200" faith points:

Code:
<FaithCost>200</FaithCost>
<UnlockedByBelief>true</UnlockedByBelief>

If I want my example building to ONLY be purchased with faith, instead of available in the regular way, I would have to alter the code for my example building as follows:

Code:
<GameData>
	<Buildings>
		<Row>
			<Type>BUILDING_EXAMPLE</Type>
			<BuildingClass>BUILDINGCLASS_EXAMPLE</BuildingClass>
			<Cost>-1</Cost>
			<FaithCost>200</FaithCost>
			<UnlockedByBelief>true</UnlockedByBelief>


Notice that "Cost" is now set to "-1" to lock the player out of getting the building in the normal way. Notice that the "FreeStartEra", "GoldMaintenance" per turn, and the "PrereqTech" have been eliminated. There is no prerequisite technology because the faith system is the prerequisite for the building. The gold maintenance is gone to stay in line with the other buildings that are available only thru faith. The "FreeStartEra" is also gone because I want the building to be bought by faith, not given out for free when the player starts the game at the MEDIEVAL or later eras.

If I want my example building to be purchased with faith after selection of a particular REFORMATION belief, AND I want it to be available in the regular way, I would have to alter the code for my example building as follows:

Code:
<GameData>
	<Buildings>
		<Row>
			<Type>BUILDING_EXAMPLE</Type>
			<BuildingClass>BUILDINGCLASS_EXAMPLE</BuildingClass>
			<Cost>100</Cost>
			<GoldMaintenance>1</GoldMaintenance>
			<PrereqTech>TECH_POTTERY</PrereqTech>
			<FaithCost>200</FaithCost>
			<UnlockedByBelief>true</UnlockedByBelief>

Notice that the "GoldMaintenance" per turn, and the "PrereqTech" have been restored, and that "Cost" has been set back to "100". The building will be available thru the same mechanics as any other "non-faith" building, but with the difference that I can set a REFORMATION belief to allow the building to be buyable with faith points. The "FreeStartEra" is not restored in this example because this would make the building free in every city when a player begins play at the specified era, and this would likely conflict with the need during such a game for ever selecting the REFORMATION belief allowing purchase of the building with faith points. Depending on the era a player starts at, of course, religion may be entirely disabled, but in those games where it is not, were the building given free based on the start era, no one would ever want to select a Reformation belief to unlock buying the building with faith.

NOTE:

In case it was not obvious, when your building is not to be buyable with faith, you can (and should) omit the entries for "<FaithCost>" and "<UnlockedByBelief>".
 
[[still not satisfied with this section]]
[[seems a little cluttered and confused]]


BUILDING CIVILOPEDIA AND HELP-TIP TEXT-LOOK-UPS​

Text look-ups are used by the game to define where the game should look to find the correct civilopedia and in-game tool-tip texts. The "where to look for it" part is determined by the name of the text "section" you define for <Help>, <Description>, <Civilopedia>, <Strategy>, <ThemingBonusHelp>, or <Quote>. Elsewhere in the XML of your mod, you tell the game what text to display for each of the look-ups you have defined.

<Help>
Used for the tool tips that pop-up in-game on the city-screen and in the tech tree for the building.​

<Description>
Used for the name of the building that actually shows up in-game. You MUST have some entry for this command. There are too many specific conditions where omitting a <Description> column from your building will cause Crash To Desktop (CTD) or lock-up of a player-viewed screen such as the G&K / BNW Spy Assignment Screen.

As part of the command for this you can also specify which grammatical article should preceed the in-game name of your building. You can specify from a selection of "a/an/the" or "none".​

<Civilopedia>
Used for whatever civilopedia entry you wish to add related to the building, but is not strictly necessary.​

<Strategy>
Used for the text inside the "Strategy" balloon in the civilopedia, but is not strictly necessary. In general, FIRAXIS did not include an entry for "strategy" with world wonders, but it does not break the game or anything like that if you do include a "strategy" entry with a world wonder. If you add a "strategy" entry for a Firaxis-supplied wonder, you need to structure the look-up TXT-KEY in the format of "TXT_KEY_WONDER_GLOBE_THEATER_STRATEGY". The game really will care whether you use "WONDER" or "BUILDING" for existing wonders.​

<ThemingBonusHelp>
Used for the theming-bonus tool-tip pop-ups that tell players how to get the most great work or artifact theming bonuses, if any apply, to your building. The text entered for this command or under a languages table for the "TXT_KEY" only show on the Culture Overview panel once the building or wonder has been constructed.​

<Quote>
Used for the wonder splash quote. The text that Sam Sheppard reads for the pre-built wonders supplied with the game. If you are building a new world wonder you will want to include a quote that will show up on the wonder splash screen. You can now add in custom audio to go along with the text displayed for <Quote>. The Quote text will also show up in the Civilopedia for your new wonder.​
Direct Addition of Text Under the "<Buildings>" table:

You can add your text directly to the <Buildings> part of the XML and avoid needing to fool around with adding look-up references elsewhere, but this limits the usefulness of your mod by making it a one-language-only mod. In this case you also cannot specify the leading article for your in-game building name. If I wanted to do my tool tip helps this way for a building I want to call a "Flying School" I could do it by adding the following lines to my building:

Spoiler :
Code:
<Help>+15 XP for air units built in the city.</Help>
<Description>Flying School</Description>
<Civilopedia>A Flying School provides training for pilots, and thus raises the effectiveness of air units.</Civilopedia>
<Strategy>Build a Flying School to gain air superiority, as it allows you to produce better air units.</Strategy>
In that example I would not include a <ThemingBonusHelp> or a <Quote> because they wouldn't apply to my Flying School. Keep in mind that this section of the <Buildings> table doesn't do anything inside the game except handle text displays. I would still have to add the appropriate commands later on to actually make my Flying School add the XPs mentioned above in <Help>.

WHY ALL THE FOL-DER-ALL WITH ALL THESE TEXT LOOKUPS ??

The reason you generally will want to use the text reference look-ups method to add your in-game tool tips and civilopedia helps is that the mod can later be expanded for speakers of languages other than english, or french, or whatever language you originally wrote your tool tips in. All it takes is for someone competent in a second language to translate your text helps into that second language, and adding a section for the second language to the help texts. The rest of the XML remains unchanged.

It is also a bit easier to read your <Buildings> table code should you have to trouble-shoot why your building isn't doing what you thought you told it to.

EXAMPLES USING "FLYING SCHOOL" AS MY BUILDING:

To help make this all a little more clear, take a look at the following example of the <Buildings> table for a building called "FLYING SCHOOL". I've included the same text as shown above for Help, Description, Civilopedia, and Strategy. There are a few entries in my "Flying School" building below "Strategy" that haven't been discussed as yet, but don't worry too much about those.

Spoiler :
Code:
<GameData>
	<Buildings>
		<Row>
			<Type>BUILDING_FLYINGSCHOOL</Type>
			<BuildingClass>BUILDINGCLASS_FLYINGSCHOOL</BuildingClass>
			<Cost>150</Cost>
			<GoldMaintenance>1</GoldMaintenance>
			<PrereqTech>TECH_FLIGHT</PrereqTech>
			<Help>+15 XP for air units built in the city.</Help>
			<Description>Flying School</Description>
			<Civilopedia>A Flying School provides training for pilots, and thus raises the effectiveness of air units.</Civilopedia>
			<Strategy>Build a Flying School to gain air superiority, as it allows you to produce better air units.</Strategy>
			<MinAreaSize>-1</MinAreaSize>
			<ConquestProb>66</ConquestProb>
			<IconAtlas>EXPANSION2_BUILDING_ATLAS</IconAtlas>
			<PortraitIndex>4</PortraitIndex>
		</Row>
	</Buildings>
</GameData>

Now compare to what is directly below. Instead of entering the text I want the game to display in the civilopedia, etc., I've merely entered a "TXT_KEY_" look-up reference:

Spoiler :
Code:
<GameData>
	<Buildings>
		<Row>
			<Type>BUILDING_FLYINGSCHOOL</Type>
			<BuildingClass>BUILDINGCLASS_FLYINGSCHOOL</BuildingClass>
			<Cost>150</Cost>
			<GoldMaintenance>1</GoldMaintenance>
			<PrereqTech>TECH_FLIGHT</PrereqTech>
			[B][COLOR="Red"]<Help>TXT_KEY_BUILDING_FLYINGSCHOOL_HELP</Help>
			<Description>TXT_KEY_BUILDING_FLYINGSCHOOL</Description>
			<Civilopedia>TXT_KEY_CIV5_BUILDINGS_FLYINGSCHOOL_TEXT</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_FLYINGSCHOOL_STRATEGY</Strategy>[/COLOR][/B]
			<MinAreaSize>-1</MinAreaSize>
			<ConquestProb>66</ConquestProb>
			<IconAtlas>EXPANSION2_BUILDING_ATLAS</IconAtlas>
			<PortraitIndex>4</PortraitIndex>
		</Row>
	</Buildings>
</GameData>

The game knows when it encounters one of these "TXT_KEY_" look-ups, it should first check which language the player is using, and then go get the text contained in that "TXT_KEY_" look-up for that language. All I as the builder of a mod would have to do is add a section to my XML somewhere that contains the actual text to be displayed in-game. Here is what I would have to include somewhere in my mod for the english language:

Spoiler :
Code:
<GameData>
	<Language_en_US>
		<Row Tag="TXT_KEY_BUILDING_FLYINGSCHOOL">
			<Text>Flying School</Text>
		</Row>
		<Row Tag="TXT_KEY_BUILDING_FLYINGSCHOOL_HELP">
			<Text>+15 XP for air units built in the city.</Text>
		</Row>
		<Row Tag="TXT_KEY_BUILDING_FLYINGSCHOOL_STRATEGY">
			<Text>Build a Flying School to gain air superiority, as it allows you to produce better air units.</Text>
		</Row>
		<Row Tag="TXT_KEY_CIV5_BUILDINGS_FLYINGSCHOOL_TEXT">
			<Text>A Flying School provides training for pilots, and thus raises the effectiveness of air units.</Text>
		</Row>
	</Language_en_US>
</GameData>

NOTE:

You can omit the entries for <Help>, <Civilopedia>, <Strategy>, <ThemingBonusHelp> and <Quote>. You need the entry for <Description> in order for the game to know what to call your building in-game.

NOTE:

Since in this example "TXT_KEY_BUILDING_FLYINGSCHOOL" is the tag for my building <Description> command I can add an additional line to it that controls the english-language grammatical article which will preceed the words "Flying School" when they are used in notification messages, and in certain other places in-game. I do this by including a command for "gender" as part of my text command for the <Description> of my building. Instead of just this:

Code:
<Row Tag="TXT_KEY_BUILDING_FLYINGSCHOOL">
	<Text>Flying School</Text>
</Row>

I can state this, when I specify my in-game building name:

Code:
<Row Tag="TXT_KEY_BUILDING_FLYINGSCHOOL">
	<Text>Flying School</Text>
	<Gender>neuter:the</Gender>
</Row>

This has the effect of forcing the game to use "the" in front of "Flying School" when generating the text for in-game notifications, when mousing-over a city that is building a Flying School, etc. So, a player would see notifications such as:

"Chicage will build the Flying School in 3 turns"

This is not proper english grammar, so use of "the" in the gender command is not correct for the english language. My other possibilities are:

Code:
<Gender>neuter:an</Gender>
<Gender>neuter:no_article</Gender>

"Chicage will build an Flying School in 3 turns" isn't correct either, so <Gender>neuter:an</Gender> wouldn't be correct. Neither, really, would <Gender>neuter:no_article</Gender>, since that would result in notifications such as "Chicage will build Flying School in 3 turns".

If I omit the <Gender> command entirely, I will get notifications such as "Chicage will build a Flying School in 3 turns". This is the best grammatically correct preceeding article for "Flying School", so I'd be back at my original commands for the Flying School's description tag:

Code:
<Row Tag="TXT_KEY_BUILDING_FLYINGSCHOOL">
	<Text>Flying School</Text>
</Row>

In case you feel I've just wasted your time, how about if my in-game building name were "Inn" ?

Code:
<Row Tag="TXT_KEY_BUILDING_INN">
	<Text>Inn</Text>
	<Gender>neuter:an</Gender>
</Row>

Would result in better in-game messages than

Code:
<Row Tag="TXT_KEY_BUILDING_INN">
	<Text>Inn</Text>
</Row>

These are the three possible preceeding-article commands that can be used with <Description> tags:

Code:
<Gender>neuter:no_article</Gender>
preceeding article "a" is eliminated

Code:
<Gender>neuter:an</Gender>
preceeding article is forced from "a" to "an"

Code:
<Gender>neuter:the</Gender>
preceeding article is forced from "a" to "the"

Plurality: you can also specify "plurality" for your in-game building name when that is appropriate. For English, you would in nearly all such cases add the following command:

Code:
<Plurality>2</Plurality>

This command is telling the game that the in-game name for a building or wonder is already in the grammatically "plural" form.

Examples from Firaxis:


Here are a few examples from FIRAXIS-supplied buildings that use <Plurality> and/or <Gender>

Spoiler :
Code:
<Row Tag="TXT_KEY_BUILDING_NOTRE_DAME">
	<Text>Notre Dame</Text>
	<Gender>neuter:no_article</Gender>
</Row>

<Row Tag="TXT_KEY_BUILDING_IRONWORKS">
	<Text>Ironworks</Text>
	<Gender>neuter:an</Gender>
	<Plurality>2</Plurality>
</Row>

<Row Tag="TXT_KEY_BUILDING_BARRACKS">
	<Text>Barracks</Text>
	<Plurality>2</Plurality>
</Row>

<Row Tag="TXT_KEY_BUILDING_PYRAMID">
	<Text>Pyramids</Text>
	<Gender>neuter:the</Gender>
	<Plurality>2</Plurality>
</Row>

<Row Tag="TXT_KEY_BUILDING_WALLS">
	<Text>Walls</Text>
	<Plurality>2</Plurality>
	<Gender>neuter:no_article</Gender>
</Row>

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

CONVENTIONS FOR "TXT_KEY_" LOOK-UPS: "REGULAR" BUILDINGS AND WONDERS​


REGULAR BUILDING CIVILOPEDIA AND HELP TIP TEXT LOOK-UPS:

Regular buildings follow a slighly different format for their "TXT_KEY_" references from those used by wonders. Regular buildings usually have "TXT_KEY_BUILDING_" at the start of their look-up reference. Wonders tend to have "TXT_KEY_WONDER_" at the start of their look-up reference. It isn't strictly required to use "WONDER" instead of "BUILDING" in order to make your XML function properly. I've seen very skilled modders do it either way. The format conventions that FIRAXIS mostly followed for regular buildings is as shown below:

Code:
<Help>TXT_KEY_BUILDING_EXAMPLE_HELP</Help>
<Description>TXT_KEY_BUILDING_EXAMPLE</Description>
<Civilopedia>TXT_KEY_BUILDING_EXAMPLE_PEDIA</Civilopedia>
<Strategy>TXT_KEY_BUILDING_EXAMPLE_STRATEGY</Strategy>
<ThemingBonusHelp>TXT_KEY_EXAMPLE_THEMING_BONUS_HELP</ThemingBonusHelp>


WONDER CIVILOPEDIA AND HELP TIP TEXT LOOK-UPS:

The format conventions that FIRAXIS mostly followed for world wonders is as shown below:

Code:
<Help>TXT_KEY_WONDER_EXAMPLE_HELP</Help>
<Description>TXT_KEY_BUILDING_EXAMPLE</Description>
<Civilopedia>TXT_KEY_WONDER_EXAMPLE_DESC</Civilopedia>
<ThemingBonusHelp>TXT_KEY_GREAT_LIBRARY_THEMING_BONUS_HELP</ThemingBonusHelp>
<Quote>TXT_KEY_WONDER_EXAMPLE_QUOTE</Quote>

For the theming bonus help, I've used the "TXT_KEY_" reference from the Great Library. FIRAXIS didn't include "_WONDER_" in this reference, they just used the wonder's name directly.

The Following only applies when you are adding a "TXT_KEY_" to an existing Firaxis-Supplied World Wonder:

Spoiler :
If you add a <Help> entry for a Firaxis-supplied wonder, you need to structure the look-up TXT-KEY in the format of "TXT_KEY_WONDER_STONEHENGE_HELP". The game really will care whether you use "WONDER" or "BUILDING" for existing wonders.

I would want to use:

Code:
<Help>TXT_KEY_WONDER_STONEHENGE_HELP</Help>

Rather than:

Code:
<Help>TXT_KEY_BUILDING_STONEHENGE_HELP</Help>

If I make a mod to do this I would want my <Buildings> table change to look like this:

Spoiler :
Code:
<GameData>
	<Buildings>
		<Update>
			<Where Type="BUILDING_STONEHENGE"/>
			<Set>
			<Help>TXT_KEY_WONDER_STONEHENGE_HELP</Help>
			</Set>
		</Update>
	</Buildings>
</GameData>

or this:

Spoiler :
Code:
<GameData>
	<Buildings>
		<Update>
			<Where Type="BUILDING_STONEHENGE"/>
			<Set Help="TXT_KEY_WONDER_STONEHENGE_HELP"/>
		</Update>
	</Buildings>
</GameData>

Both these methods will work and both will make the same exact change to the Stonehenge World Wonder. Later on I would have to add a language table to tell the game what exact text to display for Stonehenge's <Help>.

If you add a <Strategy> entry for a Firaxis-supplied wonder, you need to structure the look-up TXT-KEY in the format of "TXT_KEY_WONDER_GLOBE_THEATER_STRATEGY". The game really will care whether you use "WONDER" or "BUILDING" for existing wonders.

In my Useful Theming Bonus Help mod that I recently published to the Steam Workshop, I added Strategy entries to all the World Wonders that had theming bonuses. In these added Strategy entries I explained to the player what they needed to do to get the Theming Bonus. That way, they could know what they needed to get them, and take a pass on the Theming Bonuses that are often darn near impossible to get without a little IGE. The game would not accept my mod until I formatted my "TXT_KEYS_" as I've instructed you.
 
Building render art type​

So far as I've been able to determine, I believe "<ArtDefineTag>" is used by the game to render 3D effects on or around cities based on what buildings have been built in a city. Some of these rendering "models" change as the player progresses thru successive eras. Others don't. Still others vary depending on the "cultural group" to which a CIV belongs. Determining whether or not to vary the 3D art with eras or cultures is specified later on in the "<Buildings>" table under the "<ArtInfoEraVariation>" or "<ArtInfoCulturalVariation>" lines.

Keep in mind that "<ArtDefineTag>" has absolutely nothing to do with the icon artwork that appears in the tech tree, the civilopedia, and inside the city-screen built-buildings display or producable-buildings displays.

You can only use the pre-existing "<ArtDefineTag>" names that appear in the XML supplied with the game. You cannot add new ones, at least, not directly thru XML coding in the "<Buildings>" table. Using an "<ArtDefineTag>" name that does not already exist in the game will not "break" your building or wonder mod, but it also will not actually accomplish much of anything.

When you add a new building, you need to decide what IF ANY art definition is required. Generally, you should only include an art definition for "regular" type buildings. You should NOT include one for a new World Wonder.*

If your building is a unique building for a CIV you should use the art define for whatever building it is similar to, or a replacement for. If your new building is a replacement for the standard barracks, you should use the ArtDefineTag for barracks. If your new building is a replacement for the standard colosseum, you should use the ArtDefineTag for colosseum, and you would need to add the "<ArtInfoCulturalVariation>" and "<DisplayPosition>" that appears in the standard BUILDING_COLOSSEUM building since colosseum rendering changes with the CIV's culture type. Using the "<ArtDefineTag>" from a similar building to your new building is safe because FIRAXIS themselves re-used the same "<ArtDefineTag>" for multiple different buildings.

HINT:

If you are adding a unique building to replace a standard building in the game, start by copying the entire definition of that standard building into your MODBUDDY "XML" file for your new building, and then edit only what is required to make your new building. In this case you would keep whatever "<ArtDefineTag>", "<ArtInfoCulturalVariation>", "<ArtInfoEraVariation>", "<ArtInfoRandomVariation>", or "<DisplayPosition>" is used in the standard building.

NOTE: Specifying an AtDefineTag is Optional

specifying an ArtDefineTag is not strictly required. In fact, if you are adding a world wonder to the game you should specify nothing for an ArtDefineTag, or you should specify "NONE". Specifying "nothing" in this sense means not even including a line for "<ArtDefineTag>" in your world wonder "building". This is O.K. since the game defaults to "NULL" when "<ArtDefineTag>" is omitted. You can also state "NONE" for ArtDefineTag with regular buildings, or you can omit the line entirely.

NOTE: Shared ArtDefineTags

Cathedrals, Mosques, and Pagodas all use the same "TEMPLE" ArtDefineTag. Power Plant buildings all use the same "ART_DEF_BUILDING_HYDRO_PLANT" ArtDefineTag. Don't be too terribly concerned with which tag you choose to use so long as it's reasonable for the building you are adding.


* NOTE: "Envoy", who is a far more skilled modder than I, used "ART_DEF_BUILDING_OXFORD_UNIVERSITY" from the national wonder Oxford University as the "<ArtDefineTag>" for his "Wonders - Universities of the Ivy League" mod. In his mod, he added 8 new world wonders, each representing a different "school" within the US "Ivy League". Even though he was adding new WORLD wonders, he did not use an "<ArtDefineTag>" from any of the FIRAXIS-supplied World Wonders.

http://steamcommunity.com/sharedfiles/filedetails/?id=160177360&searchtext= is the steam address of Envoy's mod. This was for the Gods & Kings version of the game. I believe Envoy has added a BNW version of the mod to the Steam Workshop, but I don't know the direct address for that.

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


NO ART TAG

To tell the game not to use anything for "ArtDefineTag", use the following:


Code:
<ArtDefineTag>NONE</ArtDefineTag>

This is probably best for beginning modders. By doing this you ensure that no oddball "Art"-y stuff will happen.

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



ARTDEFINETAG USAGES in FIRAXIS-supplied XML

The following "<ArtDefineTag>" tags are used with "regular" buildings. You can safely choose any one of these for use with your building. The list is shown EXACTLY as they appear within the "<ArtDefineTag>" command. Some of the tags are prefaced with "ART_DEF_BUILDING_", but many are not:


Spoiler :
COURTHOUSE
LIGHTHOUSE
ART_DEF_BUILDING_WATERMILL
HARBOR
ART_DEF_BUILDING_CASTLE
COLESSEUM (this is the way it appears in the XML)
ART_DEF_BUILDING_BARRACKS
THEATRE
ART_DEF_BUILDING_FORGE
STADIUM
ART_DEF_BUILDING_MARKET
MONUMENT
ART_DEF_BUILDING_BANK
TEMPLE
ART_DEF_BUILDING_PAPER_MAKER
OPERA_HOUSE
WAT
MUSEUM
MUD_PYRAMID_MOSQUE
RADIO TOWER
BURIAL_TOMB
CASTLE
ART_DEF_BUILDING_SEAPORT
MILITARY BASE
ART_DEF_BUILDING_STABLE
ART_DEF_BUILDING_WALLS
ART_DEF_BUILDING_CIRCUS
ART_DEF_BUILDING_GRANARY
ART_DEF_BUILDING_HYDRO_PLANT
ART_DEF_BUILDING_HOSPITAL
ART_DEF_BUILDING_OBSERVATORY
ART_DEF_BUILDING_FACTORY
MONASTERY
ART_DEF_BUILDING_LIBRARY
ART_DEF_BUILDING_GARDEN
ART_DEF_BUILDING_UNIVERSITY
ART_DEF_BUILDING_MILITARY_ACADEMY
ART_DEF_BUILDING_MEDICAL_LAB
ART_DEF_BUILDING_STOCK_EXCHANGE
ART_DEF_BUILDING_PUBLIC_SCHOOL
ART_DEF_BUILDING_LABORATORY
ART_DEF_BUILDING_WALLS_OF_BABYLON
ART_DEF_BUILDING_DUCAL_STABLE
ART_DEF_BUILDING_CARAVANSARY
ART_DEF_BUILDING_HOTEL
ART_DEF_BUILDING_AIRPORT



The format for the "<ArtDefineTag>" command using a couple of different examples from the list above:

Code:
<ArtDefineTag>ART_DEF_BUILDING_MILITARY_ACADEMY</ArtDefineTag>

or​

Code:
<ArtDefineTag>TEMPLE</ArtDefineTag>

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


ART DEFINE TAGS SHARED BY "REGULAR" BUILDINGS

The following "ArtDefineTags" are shared by multiple buildings in the FIRAXIS-supplied XML.

Spoiler :
All use the ART_DEF_BUILDING_CASTLE "<ArtDefineTag>"

BUILDING_MUGHAL_FORT
BUILDING_CASTLE​

All use the ART_DEF_BUILDING_BARRACKS "<ArtDefineTag>"

BUILDING_BARRACKS
BUILDING_KREPOST
BUILDING_IKANDA
BUILDING_ARMORY​


All use the ART_DEF_BUILDING_FORGE "<ArtDefineTag>"

BUILDING_WORKSHOP
BUILDING_LONGHOUSE
BUILDING_FORGE​

All use the ART_DEF_BUILDING_MARKET "<ArtDefineTag>"

BUILDING_BAZAAR
BUILDING_MARKET​


All use the ART_DEF_BUILDING_BANK "<ArtDefineTag>"

BUILDING_SATRAPS_COURT
BUILDING_MINT
BUILDING_BANK​


All use the ART_DEF_BUILDING_HYDRO_PLANT "<ArtDefineTag>"

BUILDING_HYDRO_PLANT
BUILDING_SOLAR_PLANT
BUILDING_NUCLEAR_PLANT
BUILDING_SPACESHIP_FACTORY
BUILDING_BOMB_SHELTER
BUILDING_RECYCLING_CENTER​

All use the TEMPLE "<ArtDefineTag>"

BUILDING_TEMPLE
BUILDING_SHRINE
BUILDING_MOSQUE
BUILDING_PAGODA
BUILDING_CATHEDRAL​

All use the ART_DEF_BUILDING_MILITARY_ACADEMY "<ArtDefineTag>"

BUILDING_MILITARY_ACADEMY
BUILDING_ARSENAL​

All use the ART_DEF_BUILDING_HOSPITAL "<ArtDefineTag>"

BUILDING_HOSPITAL
BUILDING_AQUEDUCT​

All use the ART_DEF_BUILDING_LIBRARY "<ArtDefineTag>"

BUILDING_ROYAL_LIBRARY
BUILDING_LIBRARY​

All use the ART_DEF_BUILDING_GARDEN "<ArtDefineTag>"

BUILDING_CANDI
BUILDING_GARDEN​

All use the COLESSEUM "<ArtDefineTag>"

BUILDING_CONSTABLE
BUILDING_POLICE_STATION
BUILDING_AMPHITHEATER
BUILDING_COLOSSEUM​

The Colosseum building also contains the command for "ArtInfoCulturalVariation", but the other buildings do not.

All use the MONUMENT "<ArtDefineTag>"

BUILDING_MONUMENT
BUILDING_STELE​


All use the ART_DEF_BUILDING_WATERMILL "<ArtDefineTag>"

BUILDING_FLOATING_GARDENS
BUILDING_WATERMILL​


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

NATIONAL WONDERS "<ArtDefineTag>"

These are included to stay in line with the concept of "completeness" for this guide, but you would not normally pick any of these. You CAN, you just normally wouldn't.

Spoiler :
PALACE
ART_DEF_BUILDING_HEROIC_EPIC
ART_DEF_BUILDING_NATIONAL_COLLEGE
ART_DEF_BUILDING_NATIONAL_EPIC
ART_DEF_BUILDING_CIRCUS_MAXIMUS
ART_DEF_BUILDING_NATIONAL_TREASURY (note that the EAST INDIA COMPANY still uses this tag)
ART_DEF_BUILDING_IRONWORKS
ART_DEF_BUILDING_OXFORD_UNIVERSITY
ART_DEF_BUILDING_HERMITAGE
ART_DEF_BUILDING_TOURIST_CENTER
ART_DEF_BUILDING_INTELLIGENCE_AGENCY​

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


GUILD "ArtDefineTags"

These are included to stay in line with the concept of "completeness" for this guide, but you should not normally pick any of these.

Spoiler :
ART_DEF_BUILDING_WRITERS_GUILD
ART_DEF_BUILDING_ARTISTS_GUILD
ART_DEF_BUILDING_MUSICIANS_GUILD​

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

WORLD WONDERS and LEAGUE PROJECTS

These are included to stay in line with the concept of "completeness" for this guide, but you need to be very certain of what you are doing before you pick one of these, even when your building is a new world wonder.


Spoiler :
GREAT LIGHTHOUSE
PORCELAIN TOWER
SYDNEY OPERA HOUSE
STONEHENGE
HIMEJI CASTLE
ART_DEF_BUILDING_UFFIZI
THE GREAT LIBRARY
SISTINE CHAPEL
ART_DEF_BUILDING_GLOBE_THEATER
THE PYRAMIDS
KREMLIN
ART_DEF_BUILDING_BROADWAY
THE COLOSSUS
FORBIDDEN CITY
ART_DEF_BUILDING_RED_FORT
THE ORACLE
TAJ MAHAL
ART_DEF_BUILDING_PRORA
THE HANGING GARDENS
BIG BEN
ART_DEF_BUILDING_BOROBUDUR
ART_DEF_BUILDING_GREAT_WALL
LOUVRE
ART_DEF_BUILDING_PARTHENON
ANGKOR WAT
BRENDANBURG GATE
STATUE ZEUS
HAGIA SOPHIA
STATUE OF LIBERTY
ALHAMBRA
CHICHEN ITZA
CRISTO REDENTOR
CN TOWER
MACHU PICCHU
EIFFEL TOWER
HUBBLE
NOTRE DAME
PENTAGON
TOWER OF PISA
GREAT MOSQUE DEJENNE
NEUSCHWANSTEIN CASTLE
PETRA
TERRACOTTA ARMY
TEMPLE ARTEMIS
MAUSOLEUM HALICARNASSUS
ART_DEF_BUILDING_INTERNATIONAL_SPACE_STATION




I have experimented with using the standard World Wonder "<ArtDefineTag>", "<ArtInfoCulturalVariation>", "<ArtInfoEraVariation>", "<ArtInfoRandomVariation>", and "<DisplayPosition>" info in a custom World Wonder. I did this by creating a unique replacement for the Great Wall that only Rome could build. I used the same commands for these art rendering attributes as are used by the Great Wall. The game did not crash and burn, but it did have a little trouble rendering the Great Wall main-map artwork. In the three games I experimented with this, the game only rendered the Great Wall "wall" on the main map after the wonder was completed, and then only after I had saved and re-loaded my games.


NOTE IN CASE IT WAS NOT OBVIOUS:

You can omit the entry for "<ArtDefineTag>".

You can also omit the entries for "<ArtInfoCulturalVariation>", "<ArtInfoEraVariation>", "<ArtInfoRandomVariation>", and "<DisplayPosition>"; as a general rule you should omit these entries.
 
Building Max Start Era​

"<MaxStartEra>" disables buildings based on what era the player starts on. If a player decides to start a game in the INDUSTRIAL era, any building that has "<MaxStartEra>" for an era earlier than "INDUSTRIAL" would be unavailable for the duration of that game. This is used with both World Wonders and regular buildings. The Notre Dame world wonder as well as all Temple-class and Shrine-class buildings have a RENAISSANCE era "<MaxStartEra>", so any game started in the RENAISSANCE or EARLIER eras will include them, but any game started in the INDUSTRIAL era or later will not.

A building can have both a "<FreeStartEra>" and a "<MaxStartEra>".

You must pick ONLY ONE of the following as a "<MaxStartEra>", or none at all:

Spoiler :
ERA_CLASSICAL
ERA_MEDIEVAL
ERA_RENAISSANCE
ERA_INDUSTRIAL
ERA_MODERN
ERA_POSTMODERN
ERA_FUTURE​

Here is the properly-formatted code to make a building unavailable when the player starts the game LATER THAN the MEDIEVAL ERA. If the player starts the game AT the MEDIEVAL ERA, the building will still be available:

Code:
<MaxStartEra>ERA_MEDIEVAL</MaxStartEra>

You can omit the entry for "<MaxStartEra>".

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


EXECUTABLE CODE REVIEW​



To review the executable code that might be added to my building "definition" so far, if I choose to use the "ArtDefineTag" of the TEMPLE, and that my building will have a "MaxStartEra" of ERA_MEDIEVAL, my code would look like this. It would mean that if I start the game in the Medieval era, the building is free, and can still be available to the player, but if I start later than ERA_MEDIEVAL the building will not show up in that game.

As a general note, from here I will making the new lines I am adding or altering in these code review show as bold red , to make it easier to see the changes or additions.

Spoiler :
Code:
<GameData>
	<Buildings>
		<Row>
			<Type>BUILDING_EXAMPLE</Type>
			<BuildingClass>BUILDINGCLASS_EXAMPLE</BuildingClass>
			<FreeStartEra>ERA_MEDIEVAL</FreeStartEra>
			<Cost>100</Cost>
			<GoldMaintenance>1</GoldMaintenance>
			<PrereqTech>TECH_POTTERY</PrereqTech>
			<Help>TXT_KEY_BUILDING_EXAMPLE_HELP</Help>
			<Description>TXT_KEY_BUILDING_EXAMPLE</Description>
			<Civilopedia>TXT_KEY_BUILDING_EXAMPLE_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_EXAMPLE_STRATEGY</Strategy>
			[B][COLOR="Red"]<ArtDefineTag>TEMPLE</ArtDefineTag>
			<MaxStartEra>ERA_MEDIEVAL</MaxStartEra>[/COLOR][/B]

If I choose to use no "ArtDefineTag", and no "MaxStartEra" limitation, my code would look like this:

Spoiler :
Code:
<GameData>
	<Buildings>
		<Row>
			<Type>BUILDING_EXAMPLE</Type>
			<BuildingClass>BUILDINGCLASS_EXAMPLE</BuildingClass>
			<FreeStartEra>ERA_MEDIEVAL</FreeStartEra>
			<Cost>100</Cost>
			<GoldMaintenance>1</GoldMaintenance>
			<PrereqTech>TECH_POTTERY</PrereqTech>
			<Help>TXT_KEY_BUILDING_EXAMPLE_HELP</Help>
			<Description>TXT_KEY_BUILDING_EXAMPLE</Description>
			<Civilopedia>TXT_KEY_BUILDING_EXAMPLE_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_EXAMPLE_STRATEGY</Strategy>
			[COLOR="red"][B]<ArtDefineTag>NONE</ArtDefineTag>[/B][/COLOR]

In this case I would simply not have an entry for "MaxStartEra". When you don't need or want a particular attribute assigned to your building, in most cases you can simply omit it altogether. Back in the bad old days of CIV4 XML (as well as I can remember), you still had to have an entry for everything, even if you weren't making an attribute active. It made for some difficult reading of XML to see where you had goofed if something wasn't working, or wasn't working the way you wanted it to.
 
TYPE OF SPECIALISTS

"<SpecialistType>" is used to designate BOTH the type of citizen specialists the building can support as well as the type of great person points the building will add every turn to the generation of the next great person. You must pick ONLY ONE of the following TYPES of SPECIALISTS:


Code:
SPECIALIST_SCIENTIST
SPECIALIST_MERCHANT
SPECIALIST_ENGINEER
SPECIALIST_WRITER
SPECIALIST_ARTIST
SPECIALIST_MUSICIAN


NUMBER OF SPECIALISTS

"<SpecialistCount>" tells the game how many specialist slots the building has. You should limit this to no more than 4, since the in-game city buildings display doesn't have room to properly show more than about that number.

WORLD WONDERS AND NATIONAL WONDERS

You CAN add citizen-specialist slots to Wonders. You should avoid having a Wonder contain BOTH citizen-specialist slots AND Great Works slots since the game does not know how to "display" such a building in the city buildings list -- it sometimes places them in sections of the list where you would not expect in the same sort of wierd way that National Wonders are usually displayed in the wonders section of the city display but depending on how the National Wonder is defined it can sometimes be displayed in the 'regular' buildings section where one would not usually expect to find it. You CANNOT have a World Wonder contain BOTH citizen-specialist slots AND the command for "<SpecialistExtraCulture>". I will explain why you cannot do this later on in the segment of this guide devoted to "<SpecialistExtraCulture>".




GREAT PERSON POINTS

"<GreatPeopleRateChange>" specifies the number of great person POINTS added each turn to the city's cumulative count for spawning a particular type of great person. You can put pretty much any number you want for your building, but remember that ridiculously high numbers won't do much more than break the balance of the game. Properly-formatted line to add 1 Great Person Point per turn;

Code:
<GreatPeopleRateChange>1</GreatPeopleRateChange>

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


SPECIALISTS and GREAT PERSON POINTS examples


If I want my building to have two engineer specialist slots but no great person points I would add this to my building:

Code:
<SpecialistType>SPECIALIST_ENGINEER</SpecialistType>
<SpecialistCount>2</SpecialistCount>

If I want my building to have two great-engineer great-person points per turn, but no citizen-specialists slots of any kind I would add this to my building:

Code:
<SpecialistType>SPECIALIST_ENGINEER</SpecialistType>
<GreatPeopleRateChange>2</GreatPeopleRateChange>

You can specify both "<SpecialistCount>" and "<GreatPeopleRateChange>", but both will apply to the type Specialist you choose. And, as already mentioned, you can only choose one type of Specialist to apply to any one building. As example, the following would add two (2) MERCHANT citizen-specialist slots to a building, as well as adding one (1) point per turn towards the next spawn of a GREAT MERCHANT:

Code:
<SpecialistType>SPECIALIST_MERCHANT</SpecialistType>
<SpecialistCount>2</SpecialistCount>
<GreatPeopleRateChange>1</GreatPeopleRateChange>

NOTE:

The great person points discussed affect only the count towards generation of great persons in the individual city where a building is constructed.


You can omit the commands for "<SpecialistType>", "<SpecialistCount>", and "<GreatPeopleRateChange>".
 
Last edited:
Specialist extra culture​

!! GAME BUG WARNING !! GAME BUG WARNING !! --> SPECIALIST EXTRA CULTURE

I CANNOT RECOMMEND USING THE FOLLOWING COMMAND SINCE TOO MANY CONDITIONS ASSOCIATED WITH INCLUDING IT CAUSE THE CULTURE AND SOCIAL POLICIES SYSTEMS TO "BREAK" MID-GAME

"<SpecialistExtraCulture>" adds EXTRA Culture to every specialist in the empire. Since this command has a global effect the command should only be used with national or world wonders. The format to make every specialist in the empire generate one (1) more Culture per turn than normal is:

Code:
<SpecialistExtraCulture>1</SpecialistExtraCulture>


STACKING:

"<SpecialistExtraCulture>" commands can NOT be "stacked" across multiple buildings, as attempts to do so result in the creation of mystery extra culture coming from "specialists", even in cities that have no buildings yet that contain specialist slots.

SPECIALIST EXTRA CULTURE combined with SPECIALIST COUNTS in THE SAME WONDER:

A serious bug exists in the game whereby a wonder (or regular building) that has the "<SpecialistExtraCulture>" attribute AND ALSO HAS citizen-specialist slots will cause the game to begin generating odd amounts of "mystery specialist culture" in EVERY CITY of the player that constructs such a wonder. The bug also manifests itself if more than one wonder or regular building containing a "<SpecialistExtraCulture>" command is constructed in the same empire. I have seen two or more World Wonder buildings that contain the "<SpecialistExtraCulture>" command causing the game to create as much as +25 per turn "mystery" culture added to city yields IN EVERY CITY IN THE EMPIRE, even where individual cities have not constructed a building yet that has any specialist slots. The mystery culture generated is shown in the city yields box as coming from "specialists".

I use the term "wonder" since most buildings that would have the specialist extra culture command would tend to be national or world wonders, but in fact ANY building that has BOTH specialist extra culture stated and has citizen-specialist slots will cause this odd bug to manifest, and ANY building-type that has the "<SpecialistExtraCulture>" command will cause the bug to manifest once the 2nd city builds such a "regular" building.

I've played around with this command, created all the conditions noted, and found the way the game treats this command to be seriously erratic. JUST --- DON'T !!!
 
Min area size​

  1. Specifies for buildings that must be in cities located adjacent to lakes or oceans the minimum number of water tiles that must exist in the lake or sea. "-1" means there are no restrictions. So,
    Code:
    <MinAreaSize>-1</MinAreaSize>
    tells the game that no additional restrictions are in effect beyond whether or not the city must be located on a coast, or adjacent to a lake or other "freshwater" source.
  2. For coastal buildings, you should set <MinAreaSize> to "10" because "10" is one tile larger than the largest size a lake can be. Any "lake" larger than 9 tiles is considered by the game not to be a lake, but rather a small sea.
  3. For buildings that need to be located next to a lake, you should set this value to "1".
  4. All other buildings should use "-1".
USAGE BY FIRAXIS:
  1. Floating Gardens uses:
    Code:
    <FreshWater>true</FreshWater>
    <MinAreaSize>1</MinAreaSize>
    to ensure that if the city is next to a lake, the lake has at least one water tile. <FreshWater>true</FreshWater> requires the city be next to a lake, oasis, or river.
  2. Lighthouse uses:
    Code:
    <Water>true</Water>
    <MinAreaSize>10</MinAreaSize>
    to ensure that the city must be both coastal (<Water>true</Water>) and that the body of water the city is adjacent to contains at least 10 water tiles. This same method is used by all other buildings and all World Wonders that must be built in coastal cities:
    • Harbors
    • Seaports
    • Great Lighthouse
    • Colossus
    • Sydney Opera House
 
Top Bottom