Basics - Namely Training Legions and Modding Starbases

Hi, everyone. I'm starting to try some basic modding, but still having some trouble. I did finally figure out the absolute basics. For example, I modified all the starbase mods having to do with missiles to use anti-matter instead of elerium. There are two others that I'd like to do, well actually 3.

1) I want to change the legion training to be less Durantium. I can't find anything in any file dealing with that. Does anyone know what file it is in and what it is labeled as?

2) I'd like to change the starting starbase hit points to 100. I see that opposing forces always have 100. I saw them listed as 50, so trying to figure out how to interpret that. I changed it to 100 in StarbaseDefs.xml that I copied to the mods folder. They are still 50. This was changed under the first heading, BasicStarbase. I am using a custom race I created, but I wouldn't think that would matter.

3) I wanted to expand the starbase techs and allow for even more hit points. The tech tree in my custom race is Terran I think. I have "terran style" ships at least. Looking in ImprovementDefs.xml, I can't find any of the techs related to them at all such as  Reinforcement Optimization (or its two subs). I looked in the Terran xml's too. Where are these?

 

TIA

13,803 views 7 replies
Reply #1 Top

1)  If you can train a legion, you must have at least the Crusade expansion and may have the Retribution expansion.  If you have Retribution, it takes precedence over Crusade.  You need to use the ImprovementDefs.xml in the appropriate expansion directory.  Search for trainlegion in that file.

2) StarbaseDefs.xml is in the directory for the base game.  Since you have at least the Crusade expansion,  I'm not sure it should be used.  The problem is that there are a lot of "StarbaseDefs" files.

The one to use will depend on exactly what you have.  It may also depend on your custom race.  I haven't done anything about modding starbases, so I can't give any more help.

3)  Starting with Crusade, the game uses a MasterTechDefs.xml file for all techs.  There are also some MasterTechSpecializationDefs.xml files.  Crusade and Retribution each have their own versions.  The Improvements files are for things that can be built on planets or projects that can be built at planets.

Using search parameters in the main game directory can help you find file names and contents of files.  That's what I did.

Reply #2 Top

Yes, sorry, I should have been specific about that. Crusade, yes. Retribution, no. Searching for "train" "legion" or "trainlegion" generates no hits  in the ImprovementsDef.xml. Isn't that odd? Another odd one. Military Academy is spelled Acadamy, but it is correct in the game. How is that possible? There is no such file such as MasterTechDefs or master anything. There is only TechDefs and TechSpecializationDefs. Another interesting one, which is why I wonder what the "order" of xml loading is.... When I put the ImprovementDefs.xml file in the mod folder (unedited), my faction starts with Factory option and no Starport. Usually Factories requires the Colonial_Settlements tech. Starport I don't seem to get at all, and it should be a default option. Opening TechDefs, the Colonial_Settlements tech is nowhere to be found either. I know I have to be missing something, but I don't know what. I find a lot of "generic" tech names in the files. An example in TechDefs.xml would be "GenericColonizationTech_Name". Thats listed with the <DisplayName> tag, so I would think that's what you would see, but you don't. As I mentioned with ImprovementsDef.xml file in the mod folder, I get buildings BasicLab_Name and PlanetaryComputerCore_Name. Looking in that file, under <DisplayName> you get that exact text. That makes sense, so where does it get the "normal" names when that file is not in the mod folder? And why no Starport? Why do I get Factory and BasicLab without researching Colonial_Settlements and Xeno_Research? Also, to check I loaded the Terrans and Thalans. They have the exact same starting buildings.

Reply #3 Top

There is a lot you don't know about the structure of the game's files.  Each expansion adds new files with the same name as in the original game.  These files are used instead of the files in the base game.  The files in the base game are ignored.  You are using the files in the base game, which is why you can't find "train" or "legion" or "trainlegion".  They were added in Crusade and don't appear in any of the base game files.

You are looking in the Galactic Civilizations III directory, which is the correct place to start.  After that, you need to look in the correct folder in that directory.  The data for the base game is in the data folder.  In there are folders like Core, English and Game. All the data for the base game will be in those folders and other folders.

The Crusade expansion adds new data to the existing data or completely replaces the existing data.  To do this, new files are used.  All new files are in the DLC folder in the Galactic Civilizations III directory.  In your case, you will have the folder EXP2_Crusade in the DLC folder.  The EXP2_Crusade folder will contain Core, English, Game and other folders that contain the new data for Crusade.  You must use the new data for the Crusade expansion.  You will be able to find "trainlegion" in the ImprovementDefs.xml file in the Game directory in the EXP2_Crusade directory.  Look through the various directories/folders to see what is there.  Always look first in the directory for the latest expansion that you have in order to find the file you want.  If it's not there, look in the next-oldest expansion, then in the even older one until you get to the first one.  If you still haven't found it, use the one for the base game.  Sometimes something new will be added in a DLC, so what you need will be in appropriate DLCxx folder in the main DLC folder.

I have all the expansions, and there are multiple versions of some of the files.  Using the wrong one will cause problems.  I know this from using the wrong one too many times and trying to figure out why things weren't working right.


The files in the various data directories are generic when it comes to names because the game is available in several languages.  There has to be way to get the correct name to be used in the languages.  This is done by having a language directory, such at the English one mentioned earlier.  It will contain a folder named Text.  All the conversions from the generic names to the correct name for a language are in the Text folder.  The files in there usually have names similar to those in the data directory, but with Text add at the end.  In your case, the ImprovementDefs.xml in the Data directory for the Crusade expansion will be ImprovementText.xml in the English\Text directory.for the Crusade expansion.

The first improvement in the "Defs" file is the colony capital.  It will contain these lines:
<DisplayName>ColonyCapital_Name</DisplayName><ShortDescription>ColonyCapital_ShortDec</ShortDescription>

The "Text" file will contain these lines:
  <StringTable>
    <Label>ColonyCapital_Name</Label>
    <String>Colony Capital</String>
  </StringTable>
  <StringTable>
    <Label>ColonyCapital_ShortDec</Label>
    <String>Provides the basic needs of a colony. </String>
  </StringTable>

If the language is not English, the words "Colony Capital" and "Provides the basic needs of a colony." will be different.

Study the various directories and files in them along with the contents of the files to learn how everything is set up and how everything works together.  It will probably be difficult and confusing at first, but things will become simpler and more obvious as you learn more and become more experienced.

You should also learn to use search like I did in the screenshot in Reply #1 to look for file names, partial file names and file contents.  It can save a lot of time and trouble.

+1 Loading…
Reply #4 Top

Aha! Thank you! When you click on the Steam "gear" you can then ask to see local files, but it doesn't take you to the DLC. That clears up a LOT. I got so excited that I didn't finish reading the rest of your post yet. :)

Reply #5 Top

That makes a lot of sense with the languages. Thank you. Yes. I turned on advanced file search too in order to scan the files themselves for keywords. Really, it came down to the fact I was just looking in the wrong place. Is it true that instead of copying a file such as ImprovementsDef.xml, you can just create a generic file called MyMods.xml, for example, then add only the mods you want? For example, this file would copy the train legions section only with the Durantium change. Then it overwrites that particular "heading" improvement even though it's a different file?

Reply #6 Top

 

Ok, so here is an example. I believe that this is Starbase Reinforcement as it is "option 1" of Reinforcement Optimization. In the english translation file, I'm guessing I would find that <DisplayName>MasterReinforcementOptimization1_Name</DisplayName> converts to the actual English Starbase Reinforcement. Am I understanding this correctly?

So if I want to create additional starbase techs, I need to create some "generic texts" in here, and then also enter them into the english translation... or maybe since I don't care about them being in different languages I could just use the correct text here?

<Tech>

    <InternalName>MasterReinforcementOptimization1</InternalName>

    <GenericName>ReinforcementOptimization1</GenericName>

    <DisplayName>MasterReinforcementOptimization1_Name</DisplayName>

    <TechTree>Master_Tree</TechTree>

    <ShortDescription>MasterReinforcementOptimization1_ShortDec</ShortDescription>

    <Description>MasterReinforcementOptimization1_Dec</Description>

    <FlavorName>ReinforcementOptimization1_FlavorText_DisplayName</FlavorName>

    <FlavorShortDescription>ReinforcementOptimization1_FlavorText_ShortDescription</FlavorShortDescription>

    <FlavorDescription>ReinforcementOptimization1_FlavorText_Description</FlavorDescription>

    <ResearchCost>100</ResearchCost>

    <TechPoints>1</TechPoints>

    <Specialization>MasterReinforcementOptimization</Specialization>

    <AICategoryWeight>

      <Military>20</Military>

      <Growth>14</Growth>

      <Tech>10</Tech>

      <Diplomacy>6</Diplomacy>

      <Expansion>18</Expansion>

      <Wealth>8</Wealth>

      <Influence>12</Influence>

      <Fortification>16</Fortification>

    </AICategoryWeight>

    <Stats>

      <EffectType>HitPointsCap</EffectType>

      <Scope>Global</Scope>

      <Target>

        <TargetType>Starbase</TargetType>

      </Target>

      <BonusType>Flat</BonusType>

      <Value>50</Value>

    </Stats>

    <Prerequ>

      <Techs>

        <Option>TerritorialReinforcement</Option>

      </Techs>

      <TechAge>

        <Option>AgeOfWar</Option>

      </TechAge>

    </Prerequ>

  </Tech>

Reply #7 Top

Well, adding the techs to the MasterTechs file worked great. I used the standard generic info, and that's all it showed, so I'm sure editing it there would make it display whatever. One odd thing maybe you can help with. So I made staircases starting at 100hp. The standard Starbase reinforcement adds 50hp. In the game, it would go from 50 to 100. It does make the starbase go to 150hp, BUT it still only has 100hp, and it takes several turns for it to regenerate to get to 150. When I made the new tech and put 200 extra hp (just to see), it adds it to make a max of 350, but it is still starting at 100. Do you know what setting would make the max increase AND the actual hp increase?

 

Thanks again for all the help.