Changing leader descriptions

Siesta Guru

Prince
Joined
Dec 2, 2007
Messages
498
Location
The Netherlands
Heya, I'm trying to do a balance patch including some leader changes. Unfortunately while my changes in leader description texts work while in game and during loading screens, they don't seem to work during leader selection in the create game screen.

Is there some kind of .modinfo trick necessary to do that? My mod never even seems to get loaded until game loading begins.
 
Changes won't show on the pre-game menus (like on the Create Game screen, or in the Civ Select screen) unless you also create a FrontEndAction for your file(s). InGameAction will only affect the game after "Start" has been pressed, and both are necessary if you wish to affect both the pre-game menus and in-game (i.e. just doing FrontEndAction does not carry over to in-game just because it was done first).
 
how are you updating the texts, did you use "replace" tag?

I've tried both doing an update on the BaseGameText and an update on the object referring to the text item (so update the description field in Traits)

Changes won't show on the pre-game menus (like on the Create Game screen, or in the Civ Select screen) unless you also create a FrontEndAction for your file(s). InGameAction will only affect the game after "Start" has been pressed, and both are necessary if you wish to affect both the pre-game menus and in-game (i.e. just doing FrontEndAction does not carry over to in-game just because it was done first).

Hmm, this sounds like it may be the key. Unfortunately my first attempts trying it were unsuccessful, how is the .modinfo supposed to be structured to accomplish this? I was using this structure earlier:

Spoiler structure :
<Mod>
<Files>
....
</Files>
<Settings>
<Custom>
<Items>
<Component>componentname</Component>
</Items>
</Custom>
</Settings>
<Components>
<UpdateDatabase id="componentname">
<Items>
...
</Items>
</UpdateDatabase>
</Components>
</Mod>
 
Try replace current text instead.

Example:
Code:
<Replace Tag="LOC_CIVILIZATION_LISBON_ADJECTIVE">
      <Text>Macau</Text>
      <Gender>Masculine:an</Gender>
    </Replace>
    <Replace Tag="LOC_LEADER_TRAIT_LISBON_NAME">
      <Text>Macau Suzerain Bonus</Text>
    </Replace>
 
<Settings> fills the role of <FrontEndActions> in that .modinfo structure. However, if you're updating text, it should look something like this:
Code:
<Mod>
    <Files>
        <File>textchanges.xml</File>
        <File>databasechanges.xml</File>
    </Files>
    <!-- Front End (menus and such) -->
    <Settings>
        <LocalizedText id="frontchanges">
            <Items>
                <File>textchanges.xml</File>
            </Items>
        </LocalizedText>
    </Settings>
    <!-- In-Game -->
    <Components>
        <UpdateDatabase id="ingamedbchanges">
            <Items>
                <File>databasechanges.xml</File>
            </Items>
        </UpdateDatabase>
        <LocalizedText id="ingametextchanges">
            <Items>
                <File>textchanges.xml</File>
            </Items>
        </LocalizedText>
    </Components>
</Mod>
note: I'm not entirely sure that the second <LocalizedText> entry in the <Components> field is necessary, but in my experience not including it can cause problems where your text changes show on the pre-game menus, but not in-game.

You're clearly not using ModBuddy (which is your prerogative, I didn't for a time either), but I'd recommend it even if only to ease the creation of .modinfo files, since it will do it for you automatically after you've selected what actions to do with what files and stuff, and you can be reasonably certain that ModBuddy will do it correctly, exactly as the game expects it.

Also, if you're going to use <Replace> tags with localization (which isau is right to recommend, my text changes were very finicky with working properly until I just used <Replace> statements), remember to also replace the Language column. Using isau's example:
Code:
<GameData>
    <LocalizedText>
        <Replace Tag="LOC_CIVILIZATION_LISBON_ADJECTIVE" Language="en_US">
              <Text>Macau</Text>
              <Gender>Masculine:an</Gender>
        </Replace>
        <Replace Tag="LOC_LEADER_TRAIT_LISBON_NAME" Language="en_US">
              <Text>Macau Suzerain Bonus</Text>
        </Replace>
    </LocalizedText>
</GameData>
Failing to replace the Language column has also caused text to not show up properly in my experience, because the game expects one for any given localization (it won't default to English).

Note that I use the LocalizedText table to update game localization; perhaps including the language isn't necessary if you use BaseGameText.
 
Last edited:
You need to include the text twice in the .modinfo file, once in Settings and once in Components. The difference between the two is this:

  • Settings refers to everything that happens prior to starting a new game, e.g. while player is selecting a leader and map type
  • When player starts a new game the database is wiped clean and rebuilt from the ground up. Game will use anything in your Components section of Modinfo.

So, in other words, you need to include the file in both sections.
 
Thanks for the clarification, isau. I was always slightly confused why including it twice was necessary; I knew pre-game settings used the Config database and in-game settings used the Gameplay database, but never understood why updating the Localization database twice (since it's separate from the aforementioned two) was required. The fact that the database is wiped clean and rebuilt when a game is started makes much more sense.
 
Top Bottom