How to give extra starting unit or technology?

MisterBarca

Prince
Joined
May 22, 2006
Messages
536
Hi, I am trying to give Rome an extra starting unit and/or technology in the Civ5Civilization XML file, and I've tried several combinations but can't get it to work.

For instance, this is what I tried for an extra technology:

"<Row>
<CivilizationType>CIVILIZATION_ROME</CivilizationType>
<TechType>TECH_AGRICULTURE</TechType>
<TechType>TECH_POTTERY</TechType>
</Row>"

And this is what I tried for an extra unit:

"<Row>
<CivilizationType>CIVILIZATION_ROME</CivilizationType>
<UnitClassType>UNITCLASS_SETTLER</UnitClassType>
<Count>1</Count>
<UnitAIType>UNITAI_SETTLE</UnitAIType>
<UnitClassType>UNITCLASS_SCOUT</UnitClassType>
<Count>1</Count>
<UnitAIType>UNITAI_EXPLORE</UnitAIType>
</Row>"

What am I doing wrong?
 
For instance, this is what I tried for an extra technology:
"<Row>
<CivilizationType>CIVILIZATION_ROME</CivilizationType>
<TechType>TECH_AGRICULTURE</TechType>
<TechType>TECH_POTTERY</TechType>
</Row>"

You can't do that. One tech per Row. So write it as
Code:
<GameData>
  <Civilization_FreeTechs>
    <Row>
      <CivilizationType>CIVILIZATION_ROME</CivilizationType>
      <TechType>TECH_AGRICULTURE</TechType>
    </Row>
    <Row>
      <CivilizationType>CIVILIZATION_ROME</CivilizationType>
      <TechType>TECH_POTTERY</TechType>
    </Row>
  </Civilization_FreeTechs>
</GameData>
Except since the Agriculture one is already set up in the game for Rome, you only need the one Pottery entry. I seriously hope you're not editing the actual raw files in your database directory, because if you are, then we're going to have to come to your house and slap you silly. Create a mod.

Same goes for the units. Each Row can only have one value for each entry in XML, no matter what type of table it is. That's how XML works.
 
Thanks so much! But I am actually replacing the original files. It seems easier and more intuitive this way ;)
 
Thanks so much! But I am actually replacing the original files. It seems easier and more intuitive this way ;)
Bad idea. Ignoring the philosophical issues, the big one is that you will lose your changes when the game updates. Mods are easy to produce, and then you can even share them with others.
 
What he said. Reasons not to update the original files directly:

1> All of your changes will be destroyed the next time the game patches.
2> If you screw it up, you can't temporarily go back to a working baseline to debug what went wrong. All you can do is overwrite with the originals (see #1).
3> The logfiles, which are very useful for debugging, won't give you as good information about what went wrong.
4> If you try using any mods, things will go badly, because you've changed the baseline on which they operate.

Seriously, just learn how to do it right. It doesn't take long.
 
Top Bottom