I need some help with muh buildings

unknownhybrid

Chieftain
Joined
Jul 24, 2011
Messages
1
Hey everyone,
I'm new here and to Civilization, and, most importantly, Civilization V modding. I've been playing extensively this summer with two friends, and since I had some programming experience I decided I wanted to try making a civilization for each of us.

I read Kael's modding guide, as I saw that it was a staple of modding textbookery, and followed its details through to the end. However, I'm having a fairly large problem that was not addressed in the guide.

While it definitely detailed within it how to create or modify buildings, its informative pages seem to have not included how to bind unique buildings to custom civilizations. I don't want to create any wonders or anything (I found out that that is presently not a possibility anyway, perhaps my information is wrong but I read that somewhere), I just want to make a new building stemming from an existent BuildingClass and replace the original in-game building with my own personal one.

I attached my mod files, so you should be able to view them pretty easily in case you need more information, but here is what I figure is most relevant:

//-------From the CIV5Buildings.xml file ------//
<GameData>
<Buildings>
<Row>
<Type>BUILDING_HIDDEN_CACHE</Type>
<BuildingClass>BUILDINGCLASS_GRANARY</BuildingClass>
<FreeStartEra>ERA_RENAISSANCE</FreeStartEra>
<Cost>60</Cost>
<GoldMaintenance>1</GoldMaintenance>
<PrereqTech>TECH_POTTERY</PrereqTech>
<Help>TXT_KEY_BUILDING_HIDDEN_CACHE_HELP</Help>
<Description>TXT_KEY_BUILDING_HIDDEN_CACHE</Description>
<Civilopedia>TXT_KEY_CIV5_BUILDINGS_GRANARY_TEXT</Civilopedia>
<Strategy>TXT_KEY_BUILDING_HIDDEN_CACHE_STRATEGY</Strategy>
<ArtDefineTag>ART_DEF_BUILDING_GRANARY</ArtDefineTag>
<MinAreaSize>-1</MinAreaSize>
<ConquestProb>66</ConquestProb>
<HurryCostModifier>25</HurryCostModifier>
<IconAtlas>BW_ATLAS_1</IconAtlas>
<PortraitIndex>0</PortraitIndex>
</Row>
<Row>
<Type>BUILDING_ENGINEERED_CORE</Type>
<BuildingClass>BUILDINGCLASS_MILITARY_BASE</BuildingClass>
<Cost>450</Cost>
<PrereqTech>TECH_TELEGRAPH</PrereqTech>
<Help>TXT_KEY_BUILDING_ENGINEERED_CORE_HELP</Help>
<Description>TXT_KEY_BUILDING_ENGINEERED_CORE</Description>
<Civilopedia>TXT_KEY_CIV5_BUILDINGS_MILITARYBASE_TEXT</Civilopedia>
<Strategy>TXT_KEY_BUILDING_ENGINEERED_CORE_STRATEGY</Strategy>
<ArtDefineTag>MILITARY BASE</ArtDefineTag>
<NukeImmune>true</NukeImmune>
<MinAreaSize>-1</MinAreaSize>
<ConquestProb>66</ConquestProb>
<AllowsRangeStrike>true</AllowsRangeStrike>
<Defense>3500</Defense>
<HurryCostModifier>25</HurryCostModifier>
<IconAtlas>BW_ATLAS_1</IconAtlas>
<DisplayPosition>2</DisplayPosition>
<NeverCapture>true</NeverCapture>
<PortraitIndex>10</PortraitIndex>
</Row>
</Buildings>
...
</GameData>

//-------From the civilization files that reference each new building (Civ_TheCountsMen.xml and Civ_Atlantis.xml respectively)-------//

<Civilization_BuildingClassOverrides>
<Row>
<CivilizationType>CIVILIZATION_TCM</CivilizationType>
<BuildingClassType>BUILDINGCLASS_GRANARY</BuildingClassType>
<BuildingType>BUILDING_HIDDEN_CACHE</BuildingType>
</Row>
</Civilization_BuildingClassOverrides>

<Civilization_BuildingClassOverrides>
<Row>
<CivilizationType>CIVILIZATION_ATLANTIS</CivilizationType>
<BuildingClassType>BUILDINGCLASS_MILITARY_BASE</BuildingClassType>
<BuildingType>BUILDING_ENGINEERED_CORE</BuildingType>
</Row>
</Civilization_BuildingClassOverrides>



That's everything. I've seen invalid text strings just cause the game to show the name of the string since it doesn't point anywhere correct, so I figured that would not be an imminent problem. If it is, like I said, I attached the mod files below.

Thanks so much if you can help. I'd really appreciate it; this is, in part, for my friend's birthday, so.

--unknownhybrid

P.S. - Yes there are only supposed to be two unique buildings. The third civ has two unique units, and that runs fine.
 

Attachments

Your XML is fine, mostly. I'll get to that in a second.

Here are a few things you did wrong in your mod.

1> OnModActivated/UpdateDatabase is ONLY used for XML and SQL that modify <GameData> entries. You do NOT use it for .dds files, .Lua files, or any non-Gamedata XML; those go through FVS. This means your DOM picture; you've done the VFS correctly, so just remove that one OnModActivated.

2> Punctuation in file names is a bad thing. I'm referring specifically to Civ_TheCount'sMen.xml. Some operating systems have problems with this.

3> Your civs are completely unbalanced, of course, but you already knew that.

4> The rule of thumb in Civ5 is this: if ANYTHING in a file is invalid, the entire file is dumped from the database. So any one error in, say, Civ_Atlantis.xml will cause the entire Atlantis civilization to fail to load. It might have nothing to do with your unique buildings.
This is why you turn on logging. If you had your logfiles enabled, then the xml.log will tell you exactly what failed when it tried to assemble the database.

I don't see anything obviously wrong in your files, so go turn on the logs and see why the game is freaking out. (To enable logging, and FireTuner, go into your config.ini file in the Civ5 user directory. Change the appropriate "0" values to 1. Like EnableTuner, EnableLogging, and so on.) XML failures will be stored in the xml.log file in the Logs directory once this is done.

Also...
I don't want to create any wonders or anything (I found out that that is presently not a possibility anyway, perhaps my information is wrong but I read that somewhere)

Your information is wrong. The only Wonder-related thing we cannot create, at present, is the 3D terrain model that gets placed outside the city that builds one. In terms of effects, there's no problem; my own mod adds dozens of Wonders and National Wonders.
 
Back
Top Bottom