Custom Races Modding: StarSystemDef errors

Edit:

Because this thread started meandering I'm going to spit it and keep this thread to be mostly about the StarSystemDef error that is discussed about part way down.  I'll start a different thread that is more generic about getting a mod to show up, period.  

 

Original:

I decided to try creating a custom race.  And for the fun of it, I wanted to go make specific planets and all that.  But I'm stuck... the file created for the Faction is not an XML file.  So I don't know how to edit things like descriptions or the name I chose, etc, without recreating a character.  Also, I am not certain what the "internal name" for the race would be.

 

Any tips on how to proceed?

25,010 views 33 replies
Reply #1 Top

You will need to create XML files, the internal name for the race needs  to be unique and have no spaces in it as far as I can tell look at the factiondefs.xml to see  how the current factions are described. In face copying and editing FactionDefs having first removed all but one entry is probably the best way to go. There is a journal post giving some detail on how to edit a faction and create mods.

 

Have you ever worked with XML before if no there are places on the web you can go to get a brief tutorial on what XML is and how it's structured.

 

 

Reply #2 Top

For now you can select the race and then click on copy to edit your custom race.

Reply #3 Top

I have experience with xml and all that.  Read the journal post before.  Perhaps I didn't quite phrase my question well.  

I created several files for my new race including FactionDefs_New.xml. However, there is probably a mismatch between the Internal Name that I chose in the xml and the Internal Name that the game created for the race that I created through the game.

Either way, the edits I make to the xml file have no effect on the game.  So I must be missing something else. 

Reply #4 Top

Sorry understand you now Dumhed, I don’t think the modding way of creating a new race and the in game way are entirely compatible at least at the moment you would have to create them entirely as a mod.

Although from memory you can create a custom system as a mod and then chose it in the custom faction creator in game provided you have it modded in first. Haven’t tested that but it’s implied since you can mod in home systems and since the custom faction creator lets you choose a home system.

Reply #5 Top

Quoting Dumhed, reply 3

I have experience with xml and all that.  Read the journal post before.  Perhaps I didn't quite phrase my question well.  

I created several files for my new race including FactionDefs_New.xml. However, there is probably a mismatch between the Internal Name that I chose in the xml and the Internal Name that the game created for the race that I created through the game.

Either way, the edits I make to the xml file have no effect on the game.  So I must be missing something else. 
End of Dumhed's quote

 

There are several xml files with those "Names" you can't type your name inside factiondefs.xml but only a reference for it. For example "Terran Alliance" is referenced as "TERRAN_FACTION_Name" and the name can be found in : Galactic Civilizations III\data\English\Text\FactionText.xml  or other language instead English.

InternalName: Is your faction and you set one only in FactionDefs.xml or a mod for example  <InternalName>FACTION_HUMAN</InternalName>

And the name you want you set it in <DisplayName>FACTION_MYRACE_Name</DisplayName>

then you go to FactionText.xml mentioned above and type   

<StringTable>
    <Label>FACTION_MYRACE_Name</Label>
    <String>My Great Empire</String>
  </StringTable>

 

the same rule applies for all other references in factiondefs or any xml file it asks for a name or a text
using notepad++ is very useful searching where is the codes refs you are looking for.

 

creating a custom race is best to copy terrans or any other race then make your changes

Reply #6 Top

K, i'll build it all in xml and then see. :) 

 

I already have the info in both Defs and Text files.  However, in the modding example they provided, they just entered the text in rather than using a variable. 

 

Thanks for the input. :)

Reply #7 Top

Well, ran into a few problems.

First, followed everything to the letter... but the mod faction did not appear on the faction list when starting a new game.  So, I decided to "force" it by temporarily moving things into the game folders and see what errors show up.

Among my xmls, I made a new set of planets and star.  I made a new StarSystemDefs_Kuja.xml.  It follows the structure in the original xml (See below).  But when starting the game, I get the error: 

C:\Program Files (x86)\Steam\steamapps\common\Galactic Civilizations III/Data/Game\StarSystemDefs_Kuja.xml(60,21): error:
element 'StarSystem' is not allowed for content model '(InternalName,StarSystem+)'

 

Can anyone help me figure out what I did wrong or why it won't allow this?

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>

<StarSystemList>
<StarSystemGroup>
<StarSystem>
<InternalName>KonokujaSystem</InternalName>
<DisplayName>KonokujaSystem_Name</DisplayName>
<Description>KonokujaSystem_Dec</Description>
<OrbitLane>
<LaneType>Star</LaneType>
<Body>
<BodyType>UnaryStar</BodyType>
<BodyDef>KonokujaStar</BodyDef>
</Body>
</OrbitLane>
<OrbitLane>
<LaneType>DeadZone</LaneType>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetIkot</BodyDef>
<Position>2</Position>
</Body>
</OrbitLane>
<OrbitLane>
<LaneType>HabitableZone</LaneType>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetKujakayo</BodyDef>
<IsHomeworld>true</IsHomeworld>
<Position>5</Position>
</Body>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetNamasu</BodyDef>
</Body>
</OrbitLane>
<OrbitLane>
<LaneType>NoRandom</LaneType>
<Body>
<BodyType>Asteroid</BodyType>
<BodyDef>NormalAsteroid</BodyDef>
<Position>15</Position>
</Body>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetTami</BodyDef>
</Body>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetLa</BodyDef>
</Body>
</OrbitLane>
</StarSystem>

</StarSystemGroup>

</StarSystemList>

 

Reply #8 Top

Have a look in the Schema folder for the StarSystem schema that might help, can't see the issue straight away may be it has certain expectations of the format of Internal Name. 

did you add a custom text .xml as well?

I suspect it doesn't load from the mod folder because it's in the wrong subfolder or because this and maybe some of your other XMLs have errors we haven't yet worked out.

I have the schema's on my phone so I'll take a look see if I can come up with an idea of the problem.

 

 

 

Reply #9 Top

What other files have you edited? 

Reply #10 Top

Have you created a mod StarDefs.xml with "KonokujaStar" in it I think the <BodyDef> tag you added under the star might be a reference to a StarDef entry.



Reply #11 Top

Hehe... thanks for looking at it.

 

I'll take a look at the Schema folder later today.

 

To answer your other questions, everything is in the folder which corresponds to where the matching file is in the install folder (Program Files, etc).  In the case where I moved the files, I moved them to the same directories where the matching files are located. 

The files I have edited are: StarDefs_Kuja.xml, StarSystemDefs_Kuja.xml, FactionDefs_Kuja.xml, PlanetDefs_Kuja, (In the Game Folder), and FactionText_Kuja.xm (In the Text Folder).  

The BodyDef:KonokujaStar... this points to StarDefs_Kuja.xml where the InternalName for a star is KonokujaStar.  (This matches the way the other star references work).

 

 

 

Reply #12 Top

Here are the relevant lines from the StarSystemDefs.xsd, schema file

 

<xs:complexType name="StarSystemDef">
<xs:sequence>
<xs:element name="InternalName" type="xs:string"/>
<xs:element name="DisplayName" type="xs:string" minOccurs="0"/>
<xs:element name="Description" type="xs:string" minOccurs="0"/>
<xs:element name="OrbitLane" type="OrbitLaneDef" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="StarSystemGroupDef">
<xs:sequence>
<xs:element name="InternalName" type="xs:string"/>
<xs:element name="StarSystem" type="StarSystemDef" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

 

What is confusing to me is that my formatting/structure matches the original StarSystemDefs.xml file exactly, with only the string being different.  And my string does refer to a string entry in my text file which is currently in the "English" folder along with the game's FactionText file, since I've temporarily moved my mod files into the program files since it forces it to try to load and gives me error messages as to why it can't.  

I tested it also so that I copied the StarSystem entry (between the StarSystem tags) and just pasted in right into the original StarSystemDefs.xml file.  And then, tada, it works, no errors.  It just doesn't seem to like having another StarSystemList.

Reply #13 Top

I think you need to add the tag that identifies the xml schema location to your mod file it's directly below the tag at the top that identifies the xml version. With out that it may not know what schema to parse your file against.

 

Unfortunately my phone wont seem to let me paste it here but look at the origional file.

Reply #14 Top

I've tried that.  When I add the schema attribute, that's when it tells me that element 'StarSystem' is not allowed for content model '(InternalName,StarSystem+)'.  

When I remove the Schema attribute, it give the error, "no declaration for element 'StarSystemList'" and "no declaration for element 'StarSystemGroup', and so on.  It basically says that there is no declaration for every element in the xml.  

Reply #15 Top

what about the line in starsystem defs immediately following starsystem group

<StarSystemGroup>
<InternalName>FactionStart</InternalName>

it looks like you dont have anything there and reading the error you post its expecting something there and starsystem is not allowed to be that something

Reply #16 Top

Adding the FactionStart declaration creates an error.  It is only allowed once.  Since it is already given in the official file, adding it to the _Kuja.xml file yields the error:

"Duplicate InternalName found in type StarSystemGroupDef: FactionStart"

Commenting out the <InternalName>FactionStart </InternalName> in the _Kuja.xml file then goes back to the error 

C:\Program Files (x86)\Steam\steamapps\common\Galactic Civilizations III/Data/Game\StarSystemDefs_Kuja.xml(60,21): error: 
element 'StarSystem' is not allowed for content model '(InternalName,StarSystem+)'

As stated earlier, it if I just place the <StarSystem>....</StarSystem> from my _Kuja.xml filne into the original StarSystemDefs.xml file, and then remove the _Kuja.xml version, then the game loads with no error.  

I'm probably missing something.  But I suppose it is also a possibility that something in the system is wonky as it deals with mods, since this is newly added to the Beta.

Reply #17 Top

does the internal name need to be FactionStart? can it be DumhedsFaction or something else

from reading those errors im pretty sure the internalname tag is the culprit 

Reply #18 Top

When I change add the tag <InternalName>KujaStart</InternalName>, the game loads with no error.  I don't have time now, but will check later to see if the star systems load properly.  Without errors in loading, I tried moving it all to the mod folder (out of the Program Folder) but alas, the race does not appear.  

 

Reply #19 Top

I'm not a modder,  but you may be making logic errors. You,  and the terrans share the sol system. Every race contains a specific system except these two. You'll probably copy that file,  and set your values to random,  and rename the system and its planets. You may have an issue of putting nine races into eight slots. You may have to up numbers. Are you putting your modded race at the end.of the majors list. Do you have your picts in all the files that need.picts. you may be having an issue of telling the computer to use, and rename the same system at exactly thre same time. 

As far as alian Ideas cyber alians why are there never.any alian cyborgs. Et nice. Alien. Undine from startrek. T 1000 in its liquid metal state. Alien dinosaurs. Wraith fron stargate. Entities like in the original startrek series. The bad guys frim pandorum. Vorlon from babylon five. Hammerhead from starwars. Vesari from sins. 

Reply #20 Top

I have pics for everything.  As for sharing systems, for my Kuja race that I'm trying to build, they have their own starsystem, with stars and planets named differently and unique, following the structure of the corresponding file (StarDefs, PlanetDefs, StarSystemDefs, etc).  

The interesting thing is, if I place all my modded xml files in the program folders (with the exception of StarSystemDefs_Kuja) and I copy the <StarSystem>My entries for my race</StarSystem> into the program file StarSystemDefs.xml, then the game loads, the race shows up.  However, if I try to place these into the mod folder, each file in the folder corresponding to the main files locations, then the mod does not show up.

This thread has couple distinct issues going - 1) mod not appearing, 2) StarSystemDefs error.  I'm going to start a separate thread to deal with the mod not appearing and use a different case to illustrate.  Then this one can focus on the StarSystemDefs error.  

(in the end, I'm going for an aquatic race... but this will take time particularly as it pertains to the use of planet tiles and all that...)

Reply #21 Top

I want to have a go at doing this myself to see if I can spot the mistake. Unfortunately might not happen this weekend as I have a deadline for a part time machine learning course and various familly commitments. 

 

Think the internal nmae likley is part of the issue though. You havent disabled mods have you?

Reply #22 Top

I know with galactic civilizations two twilight a lot of mods didn't work when I installed them,  even if I moved them into the right mod folder under a name. This sounds like a similar problem on some mods I downloaded in my case some essentisl files weren't there where I either copied from other mods,  or from the game itself. With the racedef file,  and other ones I think I solved this problem by having two copies of the same file. Onr in the initisl dirrectory of the mod name,  and the other where it belongs. The yhing about computers as long as its in a seperate directory you can have as many copies of exactly same  file as you like.

Reply #23 Top

I think this might actually be a limitation of the method having just taken another look at the original systemdefs file.

Try making a copy of StarSystemDefs.xml to the Game folder of your mod directory, then add the definition to the StarsystemGroup with the internal name FactionStart but don't remove any of the others.

I think the group named FactionStart has to be used for any starting star systems to show up for players, but because it has to be unique you can't make two of them, if you copy the original file to your mod folder it will override the vanilla one without editing the main game files directly but make sure you don't change the name of the file or it won't.

Reply #24 Top

I can't get even a uber basic race mod to show up in game.  So... yeah.... 

 

But I think you are right.  This may be one of those things like in GC2:TW.  I just hope not.  If every race mod needs to use the full file, then they will not be compatible with each other.

Reply #25 Top

Yes I agree it's not good if you can't add a new faction start star system without doing a total replace of the StarSystemDefs.xml, it will make it an issue to have multiple race expansion mods unless modders just reuse the base start system defs all the time which is not good at all.