How to overide original XML files

j51

Blue Star Cadet
Joined
Oct 22, 2006
Messages
1,743
Location
Ping Island
I made a mod using mod-buddy (following Kael's instructions) that changes the city lists, colours, and various names for the civs, city-states, objects, etc. But when I load it in the mod section the changes won't take place, because it still reads the original xml files first and not the changed files in the mod folder. Ho do I overide the original files using mod buddy?
 
Did you add your XML files to the Actions tab in ModBuddy (OnModActivated/UpdateDatabase)?

Do you have Logging turned on for errors?

I can take a look at it if you want, see if there's something wrong in the code. Kael's tutorial is a little out of date, some of the core XML files have changed slightly since he released that.
 
But when I load it in the mod section the changes won't take place, because it still reads the original xml files first and not the changed files in the mod folder. Ho do I overide the original files using mod buddy?

You don't "override" the original files. If your file looks like the original, AT ALL, then you're doing it completely wrong. XML changes you make are loaded in addition to the originals, not instead of the originals.

Even if you created your XML using the correct Update syntax, there are many things you could have done wrong, and doing any of those prevents your XML file from loading. Without seeing your mod's files, though, we have no way to gauge that.
 
You don't "override" the original files. If your file looks like the original, AT ALL, then you're doing it completely wrong. XML changes you make are loaded in addition to the originals, not instead of the originals.

Yeah, I did that. Here's an example of a file I altered:

Spoiler :

<GameData>
<Language_en_US>
<Row Tag="TXT_KEY_CIV_AMERICA_ADJECTIVE">
<Text>American</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_AMERICA_DESC">
<Text>American Empire</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_AMERICA_SHORT_DESC">
<Text>The United States</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_ARABIA_ADJECTIVE">
<Text>Arabian</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_ARABIA_DESC">
<Text>Arabian Empire</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_ARABIA_SHORT_DESC">
<Text>Arabia</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_AZTEC_ADJECTIVE">
<Text>Aztec</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_AZTEC_DESC">
<Text>Aztec Empire</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_AZTEC_SHORT_DESC">
<Text>The Aztecs</Text>
<Gender>neuter:an</Gender>
<Plurality>2</Plurality>
</Row>
<Row Tag="TXT_KEY_CIV_BARBARIAN_ADJECTIVE">
<Text>Barbarian</Text>
</Row>
<Row Tag="TXT_KEY_CIV_BARBARIAN_DESC">
<Text>Barbarian State</Text>
</Row>
<Row Tag="TXT_KEY_CIV_BARBARIAN_SHORT_DESC">
<Text>Barbarians</Text>
<Plurality>2</Plurality>
</Row>
<Row Tag="TXT_KEY_CIV_CHINA_ADJECTIVE">
<Text>Chinese</Text>
</Row>
<Row Tag="TXT_KEY_CIV_CHINA_DESC">
<Text>Chinese Empire</Text>
</Row>
<Row Tag="TXT_KEY_CIV_CHINA_SHORT_DESC">
<Text>China</Text>
</Row>
<Row Tag="TXT_KEY_CIV_EGYPT_ADJECTIVE">
<Text>Egyptian</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_EGYPT_DESC">
<Text>Egyptian Empire</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_EGYPT_SHORT_DESC">
<Text>Egypt</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_ENGLAND_ADJECTIVE">
<Text>British</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_ENGLAND_DESC">
<Text>British Empire</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_ENGLAND_SHORT_DESC">
<Text>Britain</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_FRANCE_ADJECTIVE">
<Text>French</Text>
</Row>
<Row Tag="TXT_KEY_CIV_FRANCE_DESC">
<Text>French Empire</Text>
</Row>
<Row Tag="TXT_KEY_CIV_FRANCE_SHORT_DESC">
<Text>France</Text>
</Row>
<Row Tag="TXT_KEY_CIV_GERMANY_ADJECTIVE">
<Text>German</Text>
</Row>
<Row Tag="TXT_KEY_CIV_GERMANY_DESC">
<Text>German Empire</Text>
</Row>
<Row Tag="TXT_KEY_CIV_GERMANY_SHORT_DESC">
<Text>Germany</Text>
</Row>
<Row Tag="TXT_KEY_CIV_GREECE_ADJECTIVE">
<Text>Greek</Text>
</Row>
<Row Tag="TXT_KEY_CIV_GREECE_DESC">
<Text>Greek Empire</Text>
</Row>
<Row Tag="TXT_KEY_CIV_GREECE_SHORT_DESC">
<Text>Greece</Text>
</Row>
<Row Tag="TXT_KEY_CIV_INDIA_ADJECTIVE">
<Text>Indian</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_INDIA_DESC">
<Text>Indian Empire</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_INDIA_SHORT_DESC">
<Text>India</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_IROQUOIS_ADJECTIVE">
<Text>Iroquois</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_IROQUOIS_DESC">
<Text>Iroquois Empire</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_IROQUOIS_SHORT_DESC">
<Text>The Six Nations</Text>
<Plurality>2</Plurality>
</Row>
<Row Tag="TXT_KEY_CIV_JAPAN_ADJECTIVE">
<Text>Japanese</Text>
</Row>
<Row Tag="TXT_KEY_CIV_JAPAN_DESC">
<Text>Japanese Empire</Text>
</Row>
<Row Tag="TXT_KEY_CIV_JAPAN_SHORT_DESC">
<Text>Japan</Text>
</Row>
<Row Tag="TXT_KEY_CIV_MINOR_ADJECTIVE">
<Text>City State</Text>
</Row>
<Row Tag="TXT_KEY_CIV_MINOR_DESC">
<Text>City State</Text>
</Row>
<Row Tag="TXT_KEY_CIV_MINOR_SHORT_DESC">
<Text>City State</Text>
</Row>
<Row Tag="TXT_KEY_CIV_OTTOMAN_ADJECTIVE">
<Text>Ottoman</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_OTTOMAN_DESC">
<Text>Ottoman Empire</Text>
<Gender>neuter:an</Gender>
</Row>
<Row Tag="TXT_KEY_CIV_OTTOMAN_SHORT_DESC">
<Text>Turkey</Text>
</Row>
<Row Tag="TXT_KEY_CIV_PERSIA_ADJECTIVE">
<Text>Persian</Text>
</Row>
<Row Tag="TXT_KEY_CIV_PERSIA_DESC">
<Text>Persian Empire</Text>
</Row>
<Row Tag="TXT_KEY_CIV_PERSIA_SHORT_DESC">
<Text>Persia</Text>
</Row>
<Row Tag="TXT_KEY_CIV_ROME_ADJECTIVE">
<Text>Roman</Text>
</Row>
<Row Tag="TXT_KEY_CIV_ROME_DESC">
<Text>Roman Empire</Text>
</Row>
<Row Tag="TXT_KEY_CIV_ROME_SHORT_DESC">
<Text>Rome</Text>
</Row>
<Row Tag="TXT_KEY_CIV_RUSSIA_ADJECTIVE">
<Text>Russian</Text>
</Row>
<Row Tag="TXT_KEY_CIV_RUSSIA_DESC">
<Text>Russian Empire</Text>
</Row>
<Row Tag="TXT_KEY_CIV_RUSSIA_SHORT_DESC">
<Text>Russia</Text>
</Row>
<Row Tag="TXT_KEY_CIV_SIAM_ADJECTIVE">
<Text>Siamese</Text>
</Row>
<Row Tag="TXT_KEY_CIV_SIAM_DESC">
<Text>Siamese Empire</Text>
</Row>
<Row Tag="TXT_KEY_CIV_SIAM_SHORT_DESC">
<Text>Siam</Text>
</Row>
<Row Tag="TXT_KEY_CIV_SONGHAI_ADJECTIVE">
<Text>Songhai</Text>
</Row>
<Row Tag="TXT_KEY_CIV_SONGHAI_DESC">
<Text>Songhai Empire</Text>
</Row>
<Row Tag="TXT_KEY_CIV_SONGHAI_SHORT_DESC">
<Text>Songhai</Text>
</Row>
<Row Tag="TXT_KEY_CIVILIZATION_SECTION_1">
<Text>Civilizations</Text>
</Row>
<Row Tag="TXT_KEY_CIVILIZATION_SECTION_2">
<Text>Leaders</Text>
</Row>
</Language_en_US>
</GameData>


So should I "<Update>" each of the tags I changed instead of merely creating a whole new civ name list?

Also, what do I do with huge lists, like the city lists in the civ5civilizations.xml file, which I altered heavily? Is it a good idea to instead use "<Delete>" to remove the original set of lists whole and then add an entirely new list? What would I title the list? Could I still use "<Civilization_CityNames>" or would I have to rename it?
 
Yeah, I did that. Here's an example of a file I altered:

Again, that's completely wrong. If, for instance, TXT_KEY_CIV_AMERICA_ADJECTIVE already exists in the game database (which it does), then you CANNOT add a <Row> declaration that uses the same Tag. What you had there absolutely would not work.

A <Row> entry means "add a new line to the database, added to the core game's lists". An <Update> entry means "change one or more elements of an existing line in the database".

Either way, if there's an entry in the main database that you don't intend to change, then it should never appear in your file, anywhere.

Go read Kael's beginner's guide a few times.

Could I still use "<Civilization_CityNames>" or would I have to rename it?

Okay, you're really confused on how XML works. XML table names, like Civilization_CityNames, are absolute. They're tied to a table declaration at the top of the original file. Any changes you make MUST use the same table name, unless you want to add an entirely new table declaration (and if you do that, then you also need to write the Lua code to actually do something with that table, since the core game won't look for any tables that didn't already exist).

If you're modifying the city names for an existing civ, then you'll need to use a lot of <Update> tags. If you're creating a list of names for a new civ, you'll need to use a lot of <Row> tags.
 
Thanks for the help bro! :thumbsup:

So there's no way at all to simply edit the existing files like in civ 4? Bummer.
 
Okay, you're really confused on how XML works. XML table names, like Civilization_CityNames, are absolute. They're tied to a table declaration at the top of the original file. Any changes you make MUST use the same table name, unless you want to add an entirely new table declaration (and if you do that, then you also need to write the Lua code to actually do something with that table, since the core game won't look for any tables that didn't already exist).

So is it possible to change the city order list at all?
 
So is it possible to change the city order list at all?

Yes.

Code:
<Civilization_CityNames>
   <Delete CivilizationType="CIVILIZATION_AMERICA"/>
   <Row>
      <CivilizationType>CIVILIZATION_AMERICA</CivilizationType>
      <CityName>TXT_KEY_CITY_NAME</CityName>
   </Row>
   <Row>
      <CivilizationType>CIVILIZATION_AMERICA</CivilizationType>
      <CityName>TXT_KEY_CITY_NAME</CityName>
   </Row>
   <Row>
      <CivilizationType>CIVILIZATION_AMERICA</CivilizationType>
      <CityName>TXT_KEY_CITY_NAME</CityName>
   </Row>
</Civilization_CityNames>

Double check to make sure CityName is the correct tag, and replace NAME with name of the city! Rinse/repeat 40 times for each civ!
 
Back
Top Bottom