Can't add star system as mod, crash to desktop

I'm having a lot of trouble with creating a custom race, specifically when trying to give them their own unique star system. All of the mod examples I have seen on these forums involve editing an existing system; this is far from ideal and causes issues with certain races. For example if I use the SolSystem as my starting system, and edit in a planet accordingly (as was done in the Zathras mod), then if I have Terrans in my game will they also have a Sol system of their own, complete with my added planet. To avoid this I wanted to make a new system, and just use existing art assets for now.

The problem is, when I create new entries for StarSystemDefs and PlanetDefs, the game crashes on map generation. The debug files are very unhelpful to me in pinpointing the exact cause. Below are the entries I have added into a copy of the needed files in my games/galciv3/mods/mymod/game:

in StarSystemDefs.xml:

<StarSystem>
<InternalName>KerbolSystem</InternalName>
<DisplayName>Kerbol System</DisplayName>
<Description>A very hospitable system.</Description>
<OrbitLane>
<LaneType>Star</LaneType>
<Body>
<BodyType>UnaryStar</BodyType>
<BodyDef>YellowStar</BodyDef>
</Body>
</OrbitLane>
<OrbitLane>
<LaneType>DeadZone</LaneType>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetMoho</BodyDef>
</Body>
</OrbitLane>
<OrbitLane>
<LaneType>HabitableZone</LaneType>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetKerbin</BodyDef>
<IsHomeworld>true</IsHomeworld>
<Position>5</Position>
</Body>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetDuna</BodyDef>
<IsHomeworld>false</IsHomeworld>
</Body>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetLaythe</BodyDef>
<IsHomeworld>false</IsHomeworld>
</Body>
</OrbitLane>
<OrbitLane>
<LaneType>NoRandom</LaneType>
<Body>
<BodyType>Asteroid</BodyType>
<BodyDef>NormalAsteroid</BodyDef>
<Position>0</Position>
</Body>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetJool</BodyDef>
</Body>
</OrbitLane>
</StarSystem>

End of quote

 

in PlanetDefs.xml

<Planet>
<InternalName>PlanetMoho</InternalName>
<DisplayName>Moho</DisplayName>
<PlanetType>Dead</PlanetType>
<PlanetClass>0</PlanetClass>
<ArtDefine>MercuryArt</ArtDefine>
</Planet>

<Planet>
<InternalName>PlanetKerbin</InternalName>
<DisplayName>Kerbin</DisplayName>
<PlanetType>Habitable</PlanetType>
<PlanetClass>18</PlanetClass>
<ArtDefine>EarthArt</ArtDefine>
</Planet>

<Planet>
<InternalName>PlanetDuna</InternalName>
<DisplayName>Duna</DisplayName>
<PlanetType>Habitable</PlanetType>
<PlanetClass>4</PlanetClass>
<DisableColonizationEvent>true</DisableColonizationEvent>
<ArtDefine>MarsArt</ArtDefine>
</Planet>

<Planet>
<InternalName>PlanetLaythe</InternalName>
<DisplayName>Laythe</DisplayName>
<PlanetType>Habitable</PlanetType>
<PlanetClass>10</PlanetClass>
<ArtDefine>KrysethArt</ArtDefine>
</Planet>

<Planet>
<InternalName>PlanetJool</InternalName>
<DisplayName>Jool</DisplayName>
<PlanetType>GasGiant</PlanetType>
<PlanetClass>0</PlanetClass>
<ArtDefine>SaturnArt</ArtDefine>
</Planet>

End of quote

 

in FactionDefs_custom1.xml

<RaceTraits>KnowledgeableAbility</RaceTraits>
<RequiresHomeworld>true</RequiresHomeworld>
<HomeStarSystem>KerbolSystem</HomeStarSystem>
<StartingShips>ColonyStaticBlueprint</StartingShips>

 

End of quote

 

All of these lines either replace or are inserted into a non-root node, for example in planetdefs those entries are just pasted in between Mercury and Earth. I don't see any glaring typos, why is the game crashing? I also notice that on the New game setup window, my custom race homeworld entry is blank.

6,654 views 6 replies
Reply #1 Top

I was having trouble with StarsSystemDefs also but learnt from Dumhed's mod. If you add <StarSystemGroup> with the KerbolStart internal name might help you like it did me.

Can't say for sure that's it, but could be worth a try.

<StarSystemGroup>
<InternalName>KerbolStart</InternalName>

<StarSystem>
<InternalName>KerbolSystem</InternalName>
<DisplayName>Kerbol System</DisplayName>
<Description>A very hospitable system.</Description>
<OrbitLane>
<LaneType>Star</LaneType>
<Body>
<BodyType>UnaryStar</BodyType>
<BodyDef>YellowStar</BodyDef>
</Body>
</OrbitLane>
<OrbitLane>
<LaneType>DeadZone</LaneType>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetMoho</BodyDef>
</Body>
</OrbitLane>
<OrbitLane>
<LaneType>HabitableZone</LaneType>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetKerbin</BodyDef>
<IsHomeworld>true</IsHomeworld>
<Position>5</Position>
</Body>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetDuna</BodyDef>
<IsHomeworld>false</IsHomeworld>
</Body>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetLaythe</BodyDef>
<IsHomeworld>false</IsHomeworld>
</Body>
</OrbitLane>
<OrbitLane>
<LaneType>NoRandom</LaneType>
<Body>
<BodyType>Asteroid</BodyType>
<BodyDef>NormalAsteroid</BodyDef>
<Position>0</Position>
</Body>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetJool</BodyDef>
</Body>
</OrbitLane>
</StarSystem>

</StarSystemGroup>

 


Reply #2 Top

DisplayName and description should be tokens pointing to a separate text definition xml, like the ones in the default game files, instead of putting the actual description in there.

Reply #3 Top

in_stasis,

Tried what you suggested, and it seemed to take a little longer to crash is all  :grin: . Do you have a link to dumhed's mod so I can take a look at it as well? I'm really stumped on this.

 

tmphoenix,

Yes they should be (and will be), but mostly for localization purposes. It will work just fine as a placeholder until the mod/race works, and then it'll get proper locale strings / folders. I'm following the various mod posts I've seen, especially the dev one that made Ghosts of Abbadon and they do the same thing.

Reply #4 Top

You can simply enter in the name/description into the DisplayName and and Description and it will work fine too though.

 

The crazy thing is that I pasted this into my own modded starsystemdef and planetdef files (as well as a corresponding kerbal civ) and it worked just fine. I did change the display name of Kerbol System to Kerbol but that shouldn't be causing the problem. The IsHomeworld false tags are unnecessary, but also not the problem. I guess the only thing to double check is that the Kerbol System data is in the first starsystemgroup (with the other faction starting systems). So it should be before these lines:

 </StarSystemGroup>
 
  <!-- System Group -->
 
  <StarSystemGroup>
    <InternalName>SystemTemplate</InternalName>

 

If it's not that, it might help to take a look at your custom factiondef file.

Reply #5 Top

Quoting Arikah, reply 3

in_stasis,

Tried what you suggested, and it seemed to take a little longer to crash is all  :grin: . Do you have a link to dumhed's mod so I can take a look at it as well? I'm really stumped on this.

 

tmphoenix,

Yes they should be (and will be), but mostly for localization purposes. It will work just fine as a placeholder until the mod/race works, and then it'll get proper locale strings / folders. I'm following the various mod posts I've seen, especially the dev one that made Ghosts of Abbadon and they do the same thing.
End of Arikah's quote

Oh, he posted it on the faction competition thread, 1st page. reply 13.

Also do you have </StarSystemList> at the very bottom line for your StarSystemDefs.xml file? that needs to be there too. 

So the whole thing should have like this only with Kerbol instead of Klhadrev

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<StarSystemList
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/StarSystemDefs.xsd">
<!-- Created with the Gal Civ 3 Editor -->
<!-- StarSystemDefs.xml -->

<!-- System Group -->

<StarSystemGroup>
<InternalName>KlhadrevStart</InternalName>
<StarSystem>
<InternalName>KlhadrevSystem</InternalName>
<DisplayName>KlhadrevSystem_Name</DisplayName>
<Description>StarterKlhadrevSystem_Dec</Description>
<OrbitLane>
<LaneType>Star</LaneType>
<Body>
<BodyType>UnaryStar</BodyType>
<BodyDef>IcosStar</BodyDef>
</Body>
</OrbitLane>
<OrbitLane>
<LaneType>NoRandom</LaneType>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetKlhadreva</BodyDef>
</Body>
</OrbitLane>
<OrbitLane>
<LaneType>HabitableZone</LaneType>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetKlhad</BodyDef>
<IsHomeworld>true</IsHomeworld>
<Position>5</Position>
</Body>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetKlhadron</BodyDef>
</Body>
<Body>
<BodyType>Planet</BodyType>
<BodyDef>PlanetKlhadnic</BodyDef>
</Body>
</OrbitLane>
<OrbitLane>
<LaneType>NoRandom</LaneType>
<Body>
<BodyType>Asteroid</BodyType>
<BodyDef>NormalAsteroid</BodyDef>
<Position>14</Position>
</Body>
<Body>
<BodyType>Asteroid</BodyType>
<BodyDef>NormalAsteroid</BodyDef>
<Position>4</Position>
</Body>
</OrbitLane>
</StarSystem>
</StarSystemGroup>
</StarSystemList>

 

Reply #6 Top

Ugh. After tearing the mod apart it seems that it was a few things that were causing conflicts, crashes and failed checks.

- Adding a constructor to the initial spawn ships is a big no-no if you don't also include the pre-required tech for it in your races' initial techs... as soon as I can figure out how to do that it will work (probably). This was huge, deleting this entry allowed me to almost load into a map (it would start playing the music and then sputter out).

- the game really doesn't like it when you use the default <InternalName>FactionStart</InternalName> in mods, and a file containing this was embedded within another folder in my mods folder. I was under the impression that it would only load one mod at a time, the last loaded/modified file? After deleting all other mods to focus down the issue, this seemed to work as well.

- a random extra > at the end of an entry. Why this would affect it this badly I don't know, but I digress

Thanks for the help in trying to troubleshoot this guys, now I can work on the tech tree and see what errors that'll give me!

 

As a note to any dev that might read this, it would be fantastic if you developed some kind of verification/audit tool that can be run outside of the game to scan your mod and check for problems like these. Having to load up the game every time you change one little line of code to see if it has any effect is a bit time consuming and annoying, but having such an audit tool would also be extremely helpful in the future if you deprecate or change certain entries/things in the future. A dev mode .exe would probably also accomplish this while giving you debugging on the fly.