Help with rearranging city names

T.c.w7468

...
Joined
Jan 23, 2008
Messages
88
Location
US
Hello,

I would like to change the order (and add a few names) of cities in the city list for particular civilisations. I understand how to do it manually by directly changing the xml file; in the past, I just directly hacked the assets xml file and made a few small changes, which worked for a while, until Steam updated the game. and now even if I rehack the file, it will still miraculously remain the original city list somehow. Thus I would like to create a mod that makes a few changes to the city list.

I tried making a very small mod that would load an xml file that would supposedly delete the entire list of city names and remake them in the order I'd like, but somehow this is not working. I am not sure if my reasoning in the code is incorrect or if I did something wrong in ModBuddy (all I did was update the database with that xml file.) The code is as follows

Spoiler :
Code:
<GameData>
  <Civilization_CityNames>
    <Delete CivilizationType="CIVILIZATION_AMERICA"/>
    <Delete CivilizationType="CIVILIZATION_ARABIA"/>
    <Delete CivilizationType="CIVILIZATION_AZTEC"/>
    <Delete CivilizationType="CIVILIZATION_CHINA"/>
    <Delete CivilizationType="CIVILIZATION_EGYPT"/>
    <Delete CivilizationType="CIVILIZATION_ENGLAND"/>
    <Delete CivilizationType="CIVILIZATION_FRANCE"/>
    <Delete CivilizationType="CIVILIZATION_GERMANY"/>
    <Delete CivilizationType="CIVILIZATION_GREECE"/>
    <Delete CivilizationType="CIVILIZATION_INDIA"/>
    <Delete CivilizationType="CIVILIZATION_IROQUOIS"/>
    <Delete CivilizationType="CIVILIZATION_JAPAN"/>
    <Delete CivilizationType="CIVILIZATION_OTTOMAN"/>
    <Delete CivilizationType="CIVILIZATION_PERSIA"/>
    <Delete CivilizationType="CIVILIZATION_ROME"/>
    <Delete CivilizationType="CIVILIZATION_RUSSIA"/>
    <Delete CivilizationType="CIVILIZATION_SIAM"/>
    <Delete CivilizationType="CIVILIZATION_SONGHAI"/>
    <Delete CivilizationType="CIVILIZATION_KOREA"/>

... proceeds to add the city list in the order I like

</GameData>
</Civilization_CityNames>

When tested, the game still works like unmodded. When I changed the first city of China to "Chang'an" it still shows up as "Beijing" when I create my first city with the mod loaded.

Can anyone point me as to where my logic is flawed, what I did wrong, or a better way to go about doing this?
 
I have a clue but please show us your actual INSERT code to be sure :)
 
I just went on with

Spoiler :

Code:
      <Row>
        <CivilizationType>CIVILIZATION_AMERICA</CivilizationType>
        <CityName>TXT_KEY_CITY_NAME_WASHINGTON</CityName>
      </Row>
      <Row>
        <CivilizationType>CIVILIZATION_AMERICA</CivilizationType>
        <CityName>TXT_KEY_CITY_NAME_NEW_YORK</CityName>
      </Row>
      <Row>
        <CivilizationType>CIVILIZATION_AMERICA</CivilizationType>
        <CityName>TXT_KEY_CITY_NAME_BOSTON</CityName>
      </Row>
 ... ...

for the entirety of the city list. Do I need to add "INSERT" somewhere? World this be better done with an SQL file then?
 
Have you enabled logging and checked the log files for errors (1st link in my sig)
Have you added an OnModActivated->UpdateDatabase entry for the xml file (3rd link)

If neither of the above fix the problem, the complete mod is always more useful for trouble shooting than snippets (2nd link)
 
Thank you for your help! I found the problem and it is now fixed as far as I know. There was a small typo in the sea of city names that I overlooked, which was the problem.
 
Top Bottom