Need some basic modding help - Improvement names

I am trying to figure out where GC stores the names of Planetary Improvements, in the Colony window. In addition I am also thinking ahead and ship components as well.

The answer is probably pretty simple, but I cannot seem to find the right solution.

In ImprovementDefs.xml, the format is kind of confusing and trying to change what I (thought), was the right line, didn't end well.

 

 <Improvement>

    <InternalName>BasicFactory</InternalName>

    <DisplayName>BasicFactory_Name</DisplayName>

    <ShortDescription>BasicFactory_ShortDec</ShortDescription>

    <Description>BasicFactory_Dec</Description>

 

I thought it would be either of the top two lines, but, apparently not, or I am doing something wrong.

 

What I trying to do.

Example:

I want to change the current Basic Factory to > Factory - Basic. 

IoW, the name only, not any stats or specs.

 

I can see the names, but there is spacing and the formatting is confusing in a lot of places.

Example

<Improvement>

    <InternalName>PlanetaryComputerCore</InternalName>

    <DisplayName>PlanetaryComputerCore_Name</DisplayName>

The lack of basic spaces in this xml makes me wonder if I am even looking in the right place for what I am hoping to do.

 

The end goal, is to make a mod out of this, so, once I know how to do even one correctly, the rest shouldn't be a problem

 

Thanks

9,035 views 5 replies
Reply #1 Top

ImprovementDefs.xml is in a Game folder. Another folder at the same level is called Text. That folder contains xml files that tie the DisplayNames, short descriptions, and descriptions to the text string that the game will display.

For example, one of my mods (The Administrator training Institute) contains both a Game folder and a Text folder. The Game folder contains an XML file that adds a new improvement to the game. The Text folder contains a file named AdministratorSchoolText.XML that contains this:

Code: xml
  1. <!--?xml version="1.0" encoding="utf-8" standalone="yes" ?--> <!-- Created with the Gal Civ 3 Editor --> <!-- EnhancedTerraformingText.xml --> &lt;?xml version="1.0" encoding="utf-8" standalone="yes" ?&gt;
  2. &lt;StringTableList
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:noNamespaceSchemaLocation="../../Schema/Lib/StringTable.xsd"&gt;
  5.  
  6. &lt;!-- Tech Names and Descriptions --&gt;
  7.   &lt;StringTable&gt;
  8.     &lt;Label&gt;AdministratorSchool_Name&lt;/Label&gt;
  9.     &lt;String&gt;Administrator Training Institute&lt;/String&gt;
  10.   &lt;/StringTable&gt;
  11.  
  12.   &lt;StringTable&gt;
  13.     &lt;Label&gt;AdministratorSchool_ShortDec&lt;/Label&gt;
  14.     &lt;String&gt;Trains a new Administrator.&lt;/String&gt;
  15.   &lt;/StringTable&gt;
  16.  
  17.   &lt;StringTable&gt;
  18.     &lt;Label&gt;AdministratorSchool_Dec&lt;/Label&gt;
  19.     &lt;String&gt;The Administrator Training Institute allows the local government to train an administrator to care for the colony.&lt;/String&gt;
  20.   &lt;/StringTable&gt;
  21.   &lt;/StringTableList&gt;<!-- Tech Names and Descriptions -->

Reply #2 Top

You are working with a file that contains data about the improvement.  What you want to do is work with a file that contains text about the improvement.  These two types of files exist so that the data will be the same for all languages, and the text can be different for each language.

You want to work with the ImprovementText.xml file.  Be careful.  There are 3 versions of the file - one for Retribution, one for Crusade and one for the base game.  Use the correct one.  Using the wrong one won't break the game, but there could easily be missing text.

The file you are trying to use was in a Game directory.  The file you want will be in an English\Text directory.

This is what you want to find and change:

  <StringTable>
    <Label>BasicFactory_Name</Label>
    <String>Factory</String>
  </StringTable>
  <StringTable>
    <Label>BasicFactory_ShortDec</Label>
    <String>Increases production for all construction projects</String>
  </StringTable>

You want to change only the parts between <String> and </String>

Notice that there is no <Description>BasicFactory_Dec</Description> for this improvement, probably because it isn't used anywhere.

If you are changing only the text, that file is all you need in the mod.  The ImprovementText.xml file will go in the Text directory of your mod.  There is no need to use the word English.  The path will look like this:  Mod Name\Text\ImprovementText.xml.

I do it this way for mods I make that correct spelling, grammar and other errors in the text.  I have two mods that only contain text files with corrections.

This way will work for ship components and everything else you want to change.

 

Edit:  And while I was taking a long time to write this, Publius got ahead of me.

Reply #3 Top

Quoting Old-Spider, reply 2

Edit: And while I was taking a long time to write this, Publius got ahead of me.

But you provided a lot of details I didn't. :)  

Reply #4 Top

Thanks all, I knew it would be something dumb like, not using the correct file. Thanks for the pointer, already got all the basic work done, probably be able to put something together in the next week or two, time permitting.

Reply #5 Top

Here's a trick for tracking down where names are used and defined.  Use Notepad++ editor.  It has a Search Files function with name and location filters.  (Other good editors have similar.)

So for your example, search 'BasicFactory_Name' in *.xml files in the /data subdirectory.  I will list occurrences of the string and the definition should be easy to find.

Good luck.