1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Adding city names for a new Civ

Discussion in 'Civ5 - Creation & Customization' started by rhettrongun, Jul 16, 2011.

  1. rhettrongun

    rhettrongun Prince

    Joined:
    Mar 19, 2011
    Messages:
    341
    Location:
    TX
    It appears that the names are supposed to simply be added directly into the <Civilizations_CityNames> section. As in:

    <Row>
    <CivilizationType>CIVILIZATION_SPARTA</CivilizationType>
    <CityName>New Sparta</CityName>
    </Row>

    instead of:

    <Row>
    <CivilizationType>CIVILIZATION_SPARTA</CivilizationType>
    <CityName>TXT_KEY_CITY_NAME_NEW_SPARTA</CityName>
    </Row>

    I guess this wouldn't be so bad, seeing that it's actually less work to do, if I had known this before I went and made dozens of worthless txt key entry references.

    Am I missing something, or is this really the way city names have to be added for a new Civ?
     
  2. Locutus

    Locutus King of the Collective

    Joined:
    Oct 30, 2001
    Messages:
    365
    Location:
    Hengelo/Enschede, the Netherlands
    The second approach allows for localisation, the first one does not.

    What you might call New Sparta in English, a German might want to call Neu Sparta, a Spanish speaker Esparta Nova and a Greek &#925;&#941;&#945; &#931;&#960;&#940;&#961;&#964;&#951;. If you use text strings it's fairly easy for someone to translate your mod to another language (should it ever become popular enough that there would be an audience for that), if you don't do it it would be a major hassle to do so.

    If you're certain you will never want to support localisation, you don't have to bother with the strings. But I would say, if you plan to release your mod publically, you never know... (I think many modders would be surprised to find how many translations of mods there are in Russian, German, Chinese and other non-English Civ communities)

    BTW, this goes for pretty much all the text in the game, not just the city names.
     
  3. rhettrongun

    rhettrongun Prince

    Joined:
    Mar 19, 2011
    Messages:
    341
    Location:
    TX
    That's a very good point I hadn't considered.

    I originally tried to go with text strings and they didn't work for the city names. Instead they would show up as "TXT_KEY_CITY_NAME_NEW_SPARTA" for some reason. I have gotten other txt strings to show up just fine, but for some reason the city names required me to literally type them into the civilizations xml section.

    This is actually why I made the topic. I didn't and still don't understand why those txt strings weren't working.
     
  4. Spatzimaus

    Spatzimaus Mad Scientist

    Joined:
    Sep 21, 2005
    Messages:
    3,063
    Location:
    Los Angeles, CA
    That's not because it's a civilization, it's because one of the text keys you'd added was a duplicate of one already in the game. So you had a TXT_KEY_CITY_NAME_ROME or something like that, where the game already had one by that name. This is the main cause of text key issues among custom civs; sooner or later, one tries to add a city name that's already in the game, often something being used for a city-state.

    Text keys work just fine for city names. If it didn't work for you, it was because you broke something else.
     
  5. rhettrongun

    rhettrongun Prince

    Joined:
    Mar 19, 2011
    Messages:
    341
    Location:
    TX
    Ah that is good to know. Then the problem was I used Sparta as the capital of Sparta, which is also used by the vanilla Greek civ.

    Thanks a lot for clearing that up for me.
     
  6. Spatzimaus

    Spatzimaus Mad Scientist

    Joined:
    Sep 21, 2005
    Messages:
    3,063
    Location:
    Los Angeles, CA
    Yes, that'd do it.

    There are two basic ways around this:
    1> When creating a custom civ, don't follow the same pattern of text key names as the vanilla game uses.
    If you'd had your keys named TXT_KEY_CITY_SPATZ_SPARTA (replacing "Spatz" with something appropriate to your mod) then there'd be no conflict; it WOULD be a little strange, still, in that you could have two Spartas on the map (one founded by your custom civ, one founded by Greece), but it'd work.
    2> Go through and if you find a city that is on the list of city names in the vanilla game, just don't define that text key.
    So you could keep it as TXT_KEY_CITY_NAME_SPARTA, you just wouldn't define that variable in your own Language_en_US block since it's already been done. To avoid a conflict in-game, you'd probably then want to remove that city name from whatever other civ is using it (in this case, Greece).

    Bottom line, as long as you're careful not to have conflicts like this, you should be using TXT_KEY entries wherever possible. This not only helps with the foreign-language support discussed earlier, but it allows the game to more easily use that key in multiple places without any formatting issues.
     

Share This Page