LeeS
Imperator
END OF DEFINING YOUR BUILDING
You need to tell the XML that you are done ADDING a NEW building; you do this using the following command:
Code:
</Row>
You MUST include this command at the end of EACH new BUILDING you are adding to the game.
.....................................................................................................................................................................
END OF DEFINING BUILDINGS
You need to tell the XML that you are done adding information to the "<Buildings>" table; you do this by the following command:
Code:
</Buildings>
You MUST include this command at the end of your new-building(s) definition(s). If you are adding more than one new building, you wait to include this command until after the end of the LAST building you are adding to the XML.
</GameData> here ?
Spoiler :
Because there is still information you will normally need to give the game, you would not want to place </GameData> here below the </Buildings> command. Or you could do so and then add that other information in a different file within your mod. Neither ModBuddy nor the game care which way you do it. For the purposes of this manual I am going to present a </GameData> in the following code review examples. Just keep in mind that in reality you could leave off the </GameData> until you are done adding other stuff you will need for your building or wonder.
.....................................................................................................................................................................
EXECUTABLE CODE REVIEW
NOT A WORLD WONDER
If I DON'T want my building to be a world wonder, I would change my buildings table code as shown, assuming I didn't want to add anything new to my building except a reference to a custom-made icon group:
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>
<ArtDefineTag>NONE</ArtDefineTag>
<SpecialistType>SPECIALIST_MERCHANT</SpecialistType>
<SpecialistCount>2</SpecialistCount>
<GreatPeopleRateChange>1</GreatPeopleRateChange>
<MinAreaSize>-1</MinAreaSize>
<ConquestProb>66</ConquestProb>
<HurryCostModifier>25</HurryCostModifier>
<PlotBuyCostModifier>-10</PlotBuyCostModifier>
[B][COLOR="Red"]<!-- NEW STUFF -->
<IconAtlas>MY_NEW_ICON_ATLAS</IconAtlas>
<PortraitIndex>0</PortraitIndex>[/COLOR][/B]
</Row>
</Buildings>
</GameData>
A WORLD WONDER
If I DO want my building to be a world wonder, and I wanted to add "1" free social policy to my world wonder, I would add-in the "FreePolicies" command. I might also decide to remove the two (2) merchant specialist slots, since World Wonders no longer are "meant" to have specialists attached to them (though the game WILL let you add specialists to wonders). In either case, I can keep the great merchant great-person points, however.
I would want to add the "NukeImmune" attribute, bump the conquest probability to 100%, eliminate the "FreeStartEra", and set "HurryCostModifier" to "-1". I would also want to eliminate the "GoldMaintenance" since wonders don't require any. Obviously, if I were "really" adding a new World Wonder, I would set a much higher hammers cost, but I think there are enough changes for you to digest between the two versions of my example building, so I'll leave that alone.
Spoiler :
Code:
<GameData>
<Buildings>
<Row>
<Type>BUILDING_EXAMPLE</Type>
<BuildingClass>BUILDINGCLASS_EXAMPLE</BuildingClass>
<Cost>100</Cost>
<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>
<ArtDefineTag>NONE</ArtDefineTag>
<SpecialistType>SPECIALIST_MERCHANT</SpecialistType>
<GreatPeopleRateChange>1</GreatPeopleRateChange>
<MinAreaSize>-1</MinAreaSize>
[B][COLOR="red"]<ConquestProb>100</ConquestProb>[/COLOR][/B]
[B][COLOR="red"]<HurryCostModifier>-1</HurryCostModifier>[/COLOR][/B]
[B][COLOR="Red"]<NukeImmune>true</NukeImmune>[/COLOR][/B]
<PlotBuyCostModifier>-10</PlotBuyCostModifier>
[B][COLOR="red"]<FreePolicies>1</FreePolicies>[/COLOR][/B]
<IconAtlas>MY_NEW_ICON_ATLAS</IconAtlas>
<PortraitIndex>0</PortraitIndex>
[B][COLOR="red"]<!-- WONDER SPLASH STUFF -->
<WonderSplashImage>MyNewWonder.dds</WonderSplashImage>
<WonderSplashAnchor>L,B</WonderSplashAnchor>
<WonderSplashAudio>NONE</WonderSplashAudio>
<Quote>TXT_KEY_WONDER_MYNEWWONDER_QUOTE</Quote>[/COLOR][/B]
</Row>
</Buildings>
</GameData>
I didn't change the entries for "Type" and "BuildingClass" between the two versions of the "building", not-wonder and wonder, because I don't actually need to.
ICON ATLASES TABLE
Since I made a reference in both of these buildings examples to an icon atlas called "MY_NEW_ICON_ATLAS" I would also need to include entries in the "IconTextureAtlases" table for that atlas somewhere in my mod. Here's what I would add, assuming I would be using the same artwork files as were discussed earlier.
Spoiler :
Code:
<GameData>
<IconTextureAtlases>
<Row>
<Atlas>MY_NEW_ICON_ATLAS</Atlas>
<IconSize>256</IconSize>
<Filename>MyNewAtlas256.dds</Filename>
<IconsPerRow>8</IconsPerRow>
<IconsPerColumn>8</IconsPerColumn>
</Row>
<Row>
<Atlas>MY_NEW_ICON_ATLAS</Atlas>
<IconSize>128</IconSize>
<Filename>MyNewAtlas128.dds</Filename>
<IconsPerRow>8</IconsPerRow>
<IconsPerColumn>8</IconsPerColumn>
</Row>
<Row>
<Atlas>MY_NEW_ICON_ATLAS</Atlas>
<IconSize>64</IconSize>
<Filename>MyNewAtlas64.dds</Filename>
<IconsPerRow>8</IconsPerRow>
<IconsPerColumn>8</IconsPerColumn>
</Row>
<Row>
<Atlas>MY_NEW_ICON_ATLAS</Atlas>
<IconSize>45</IconSize>
<Filename>MyNewAtlas45.dds</Filename>
<IconsPerRow>8</IconsPerRow>
<IconsPerColumn>8</IconsPerColumn>
</Row>
</IconTextureAtlases>
</GameData>
This is what my XML would look like without any intermediary commentary between the "<Buildings>" table and the "<IconTextureAtlases>" table, and if everything were placed within the same ".XML" file:
Spoiler :
Code:
<GameData>
<Buildings>
<Row>
<Type>BUILDING_EXAMPLE</Type>
<BuildingClass>BUILDINGCLASS_EXAMPLE</BuildingClass>
<Cost>100</Cost>
<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>
<ArtDefineTag>NONE</ArtDefineTag>
<SpecialistType>SPECIALIST_MERCHANT</SpecialistType>
<GreatPeopleRateChange>1</GreatPeopleRateChange>
<MinAreaSize>-1</MinAreaSize>
<ConquestProb>100</ConquestProb>
<HurryCostModifier>-1</HurryCostModifier>
<NukeImmune>true</NukeImmune>
<PlotBuyCostModifier>-10</PlotBuyCostModifier>
<FreePolicies>1</FreePolicies>
<IconAtlas>MY_NEW_ICON_ATLAS</IconAtlas>
<PortraitIndex>0</PortraitIndex>
<!-- WONDER SPLASH STUFF -->
<WonderSplashImage>MyNewWonder.dds</WonderSplashImage>
<WonderSplashAnchor>L,B</WonderSplashAnchor>
<WonderSplashAudio>NONE</WonderSplashAudio>
<Quote>TXT_KEY_WONDER_MYNEWWONDER_QUOTE</Quote>
</Row>
</Buildings>
<IconTextureAtlases>
<Row>
<Atlas>MY_NEW_ICON_ATLAS</Atlas>
<IconSize>256</IconSize>
<Filename>MyNewAtlas256.dds</Filename>
<IconsPerRow>8</IconsPerRow>
<IconsPerColumn>8</IconsPerColumn>
</Row>
<Row>
<Atlas>MY_NEW_ICON_ATLAS</Atlas>
<IconSize>128</IconSize>
<Filename>MyNewAtlas128.dds</Filename>
<IconsPerRow>8</IconsPerRow>
<IconsPerColumn>8</IconsPerColumn>
</Row>
<Row>
<Atlas>MY_NEW_ICON_ATLAS</Atlas>
<IconSize>64</IconSize>
<Filename>MyNewAtlas64.dds</Filename>
<IconsPerRow>8</IconsPerRow>
<IconsPerColumn>8</IconsPerColumn>
</Row>
<Row>
<Atlas>MY_NEW_ICON_ATLAS</Atlas>
<IconSize>45</IconSize>
<Filename>MyNewAtlas45.dds</Filename>
<IconsPerRow>8</IconsPerRow>
<IconsPerColumn>8</IconsPerColumn>
</Row>
</IconTextureAtlases>
</GameData>
NOTE:
I generally will not be including the </IconTextureAtlases> table in future code examples simply because I want to keep the amount of stuff you have to look through to a minimum.
WHAT'S NEXT ?
At this point I've completed the discussion of the <Buildings> table, and I've explained the function and format for the <IconTextureAtlases> table. I'll move on from the <Buildings> table, and begin to discuss other tables that can affect your building, or that are required to properly insert your building into the game. Most of the tables that will follow will have pretty short "sections" devoted to them, since any one building doesn't add much total XML code when it has an entry in a particular table.
END OF THE <Buildings> TABLE -- END OF THE <Buildings> TABLE -- END OF THE <Buildings> TABLE -- END OF THE <Buildings> TABLE