News

Modding PlanetTraitDefs.xml is crashing the game... would appreciate any insight

Posted on Monday, December 4, 2017

I'm pretty new to modding GalCiv3 (only just recently found it that this was a possibility), and I seem to be running into an issue.

I wanted to created my own Civilization, complete with starting system and planets. I had successfully set everything up and had played a complete game with the mod. I tried to start another game, though, and this caused my game to crash. I was confused because I thought I had already verified that my mod worked.... It turns out I must have gotten lucky, because eventually (after crashing and re-opening the game many times) I  was able to start another game without it crashing. 

After quite a bit of time removing, modifying, and simplifying files to try to nail down what was causing the issue, and I'm very confident that the issue is coming from PlanetTraitDefs.xml. 

For whatever reason, when I add a new <PlanetTrait>, this *usually* causes my game to crash once I try to start a match (one in every 5 to 10 tries will work). Just to make sure I wasn't putting in some invalid values, I tried completely copying a pre-existing PlanetTrait and just modified the name - and I got the same crashing results.

Here is what I added to PlanetTraitDefs.xml at the beginning of the PlanetTraitList (direct copy of TidallyLockedWorld, except for the names):

  <PlanetTrait>

    <InternalName>Ascendant_World</InternalName>

    <DisplayName>AscendantWorld_Name</DisplayName>

    <Description>AscendantWorld_Dec</Description>

    <RelativeWeight>10</RelativeWeight>

    <PlanetClassSelect>

      <MinPlanetClass>8</MinPlanetClass>

      <MaxPlanetClass>14</MaxPlanetClass>

      <Weight>100</Weight>

    </PlanetClassSelect>

    <EffectModifier>

      <EffectType>Manufacturing</EffectType>

      <Target>

        <TargetType>Colony</TargetType>

      </Target>

      <BonusType>Multiplier</BonusType>

      <Value>0.25</Value>

    </EffectModifier>

    <EffectModifier>

      <EffectType>TradeRouteValueRaw</EffectType>

      <Target>

        <TargetType>TradeRoute</TargetType>

      </Target>

      <BonusType>Multiplier</BonusType>

      <Value>0.25</Value>

    </EffectModifier>

  </PlanetTrait> 

 

Anyone have insight into why this would be causing my game to crash upon starting a new match?

Edit: Forgot to note - I'm using the base version of the game with no other mods.