[HELP] How do I update ingame text through XML mod?

kaspergm

Deity
Joined
Aug 19, 2012
Messages
5,829
I hope someone can help me with this - I think - rather small issue. I've made an XML mod, and the mod itself works fine, but I can't get the in-game texts to update. There is some confusion with the names of the text tables - I tried to search for it, but couldn't understand the implications.

Can someone tell me what I need to do to update text files? Currently, I've made an XML with below content and set it to update database as an in-game action (as the rest of the mod) but that's not working.

Spoiler :
Code:
<GameData>
   <BaseGameText>
   <!--BUILDINGS MOD-->
       <Row Tag="LOC_BUILDING_ARENA_DESCRIPTION">
           <Text>Bonus is extended to all cities within 6 tiles.</Text>
       </Row>
       <Row Tag="LOC_BUILDING_TLACHTLI_DESCRIPTION">
           <Text>Bonus is extended to all cities within 6 tiles.</Text>
       </Row>
       <Row Tag="LOC_BUILDING_WORKSHOP_DESCRIPTION">
           <Text>Bonus is extended to all cities within 6 tiles.</Text>
       </Row>
   <!--PROMOTIONS MOD-->
       <Update>
           <Where Tag="LOC_POLICY_SERFDOM_DESCRIPTION"/>
           <Set Text="+30% [ICON_Production] Production toward Builders, and newly trained Builders gain 1 extra build actions."/>
       </Update>
   <!--RELIGIONS MOD-->
       <Update>
           <Where Tag="LOC_BELIEF_CATHEDRAL_DESCRIPTION"/>
           <Set Text="Allows construction of Cathedrals (+3 [ICON_Faith] Faith, +2 [ICON_Culture] Culture, 1 slot for religious art)."/>
       </Update>
.........
 
  • Text in civ6 is not an "UpdateDatabase" type of action.
  • It is an <UpdateText> action, as like this:
    Code:
        <UpdateText id="InGameText">
          <File>XML/BuildingInGame_Text.xml</File>
        </UpdateText>
  • Civ6 uses "Frontend" actions and "InGameActions" in modinfo files
    • manually created mods often are using the original <Settings> and <Components> designations.
    So, like the text file "loading" in this modinfo file for stuff that will show ingame:
    Code:
      <InGameActions>
        <UpdateText id="InGameText">
          <File>XML/BuildingInGame_Text.xml</File>
        </UpdateText>
      </InGameActions>
    Or, if I were adding the text to the game for the civ set-up screens and the like that occur "pregame":
    Code:
      <FrontEndActions>
        <UpdateText id="FrontEndText">
          <File>XML/FrontEnd_Text.xml</File>
        </UpdateText>
      </FrontEndActions>
  • Table <BaseGameText> is okay to use, but generally table <LocalizedText> is used because it is what actually implements correct language locale, but you have to designate the language for which each row in the table is being used:
    Code:
    <!-- Tomatekh -->
    <GameData>
    	<LocalizedText>
    		<Row Tag="LOC_RELIGION_TEST" Language="en_US">
    			<Text></Text>
    		</Row>
                  ................etc
  • It is actually easier to just use <Replace> structure within table <LocalizedText> when updating existing text-fields:
    Code:
           <Replace Tag="LOC_POLICY_SERFDOM_DESCRIPTION" Language="en_US">
               <Text>+30% [ICON_Production] Production toward Builders, and newly trained Builders gain 1 extra build actions.</Text>
           </Replace>
 
Last edited:
Hi LeeS,

A very belated thank you for your very comprehensive reply. That looks very combersome, but I'll try to get a hang of it.
 
Back
Top Bottom