[A16] CommsConsole error when Faction added

Started by denspb, December 22, 2016, 04:13:52 AM

Previous topic - Next topic

denspb

I've stumbled upon this error while trying to use GlitterTech mod, but it seems that other modders have same problem, so I believe it deserves place in this forum, as it might be some bug in game itself.

Reproduction sequence with GlitterTech mod:

1) Only Core  + Glitter Tech
2) Create world, crashlanding, pick location
3) Research Microelectronics (e.g. via dev menu).
4) Build solar panel, Comm Console
5) Try to use Comm Console.

Following exception appears in the log (and no menu appears on screen, making Console unusable):

NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.Building_CommsConsole.GetFloatMenuOptions (Verse.Pawn myPawn) [0x002d8] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\Thing\Building\Various\Building_CommsConsole.cs:126
  at RimWorld.FloatMenuMakerMap.AddHumanlikeOrders (Vector3 clickPos, Verse.Pawn pawn, System.Collections.Generic.List`1 opts) [0x018f0] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\UI\FloatMenuMakerMap.cs:751
  at RimWorld.FloatMenuMakerMap.ChoicesAtFor (Vector3 clickPos, Verse.Pawn pawn) [0x0006c] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\UI\FloatMenuMakerMap.cs:74
  at RimWorld.FloatMenuMakerMap.TryMakeFloatMenu (Verse.Pawn pawn) [0x0004e] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\UI\FloatMenuMakerMap.cs:34
  at RimWorld.Selector.HandleMapClicks () [0x000b2] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\UI\MainTabs\Inspect\Selector.cs:155
  at RimWorld.Selector.SelectorOnGUI () [0x00000] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\UI\MainTabs\Inspect\Selector.cs:111
  at RimWorld.MapInterface.HandleLowPriorityInput () [0x00021] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\UI\MapInterface.cs:154
  at RimWorld.UIRoot_Play.UIRootOnGUI () [0x001a9] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\UI\UIRoot_Play.cs:119
  at Verse.Root.OnGUI () [0x0003f] in C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\Root.cs:148


I've played around with defs and this seems to be Faction-related, not Trader related: removing FactionDefs/PawnKindDefs results in no error.
However my attempts to find what exactly in defs lead to the error did not give any clue in a reasonable time.

Could someone with access to code/decompiler look up what exactly happens in Building_CommsConsole.cs:126 ?

Sam_

For anyone else with this issue make sure you have a factionLeader for every pawn group in the faction def.

<li>
<kindDef>Normal</kindDef>
<commonality>100</commonality>
<options>
<OCSoldier>60</OCSoldier>
<OCPeaceKeeper>20</OCPeaceKeeper>
<OCHeavy>15</OCHeavy>
<OCTank>5</OCTank>
<OCDirector>20</OCDirector>
</options>
</li>
<li>
<kindDef>FactionBase</kindDef>
<options>
<OCSoldier>60</OCSoldier>
<OCPeaceKeeper>20</OCPeaceKeeper>
<OCHeavy>15</OCHeavy>
<OCTank>5</OCTank>
<OCDirector>20</OCDirector>
</options>
</li>

Where OCDirector is the factionLeader. The confusion for me came from the desire to only have the factionLeader at a base, therefore leaving the normal pawnGroupMaker without a factionLeader.


evilsquirrel2012

so where woul i make sure that this is correct?


Quote from: Sam_ on December 22, 2016, 07:43:47 AM
For anyone else with this issue make sure you have a factionLeader for every pawn group in the faction def.

<li>
<kindDef>Normal</kindDef>
<commonality>100</commonality>
<options>
<OCSoldier>60</OCSoldier>
<OCPeaceKeeper>20</OCPeaceKeeper>
<OCHeavy>15</OCHeavy>
<OCTank>5</OCTank>
<OCDirector>20</OCDirector>
</options>
</li>
<li>
<kindDef>FactionBase</kindDef>
<options>
<OCSoldier>60</OCSoldier>
<OCPeaceKeeper>20</OCPeaceKeeper>
<OCHeavy>15</OCHeavy>
<OCTank>5</OCTank>
<OCDirector>20</OCDirector>
</options>
</li>

Where OCDirector is the factionLeader. The confusion for me came from the desire to only have the factionLeader at a base, therefore leaving the normal pawnGroupMaker without a factionLeader.

xenobam

hello, where can i find this code new to the game thxs

Lord_Orion

#4
Quote from: Sam_ on December 22, 2016, 07:43:47 AM
For anyone else with this issue make sure you have a factionLeader for every pawn group in the faction def.

<li>
<kindDef>Normal</kindDef>
<commonality>100</commonality>
<options>
<OCSoldier>60</OCSoldier>
<OCPeaceKeeper>20</OCPeaceKeeper>
<OCHeavy>15</OCHeavy>
<OCTank>5</OCTank>
<OCDirector>20</OCDirector>
</options>
</li>
<li>
<kindDef>FactionBase</kindDef>
<options>
<OCSoldier>60</OCSoldier>
<OCPeaceKeeper>20</OCPeaceKeeper>
<OCHeavy>15</OCHeavy>
<OCTank>5</OCTank>
<OCDirector>20</OCDirector>
</options>
</li>

Where OCDirector is the factionLeader. The confusion for me came from the desire to only have the factionLeader at a base, therefore leaving the normal pawnGroupMaker without a factionLeader.

Near as i can see those settings are not in my save file. Were do i make these corrections?

lordgrunt

For me it was Feral faction that needed a fix, from Rimsenal mod.
Find (rimworldfolder)\Mods\Rimsenal_Feral\Defs\FactionDefs\Factions_Feral.xml
Then replace entire pawnGroupMakers section in it with the following:

    <pawnGroupMakers>
      <li>
        <kindDef>Normal</kindDef>
        <commonality>100</commonality>
        <options>
          <FeralHusker>200</FeralHusker>
          <FeralMangler>200</FeralMangler>
          <FeralGrinder>50</FeralGrinder>
          <FeralScorcher>30</FeralScorcher>
          <FeralBoomer>20</FeralBoomer>
          <FeralThumper>30</FeralThumper>
          <FeralLeader>10</FeralLeader>
          <FeralTwisted>100</FeralTwisted>
          <FeralOgrenaut>30</FeralOgrenaut>
          <FeralHellmaker>10</FeralHellmaker>
          <FeralGutcher>30</FeralGutcher>
          <FeralSkullBuster>50</FeralSkullBuster>
        </options>
      </li>
      <li>
        <kindDef>Normal</kindDef>
        <commonality>25</commonality>
        <options>
          <FeralSkulker>40</FeralSkulker>
          <FeralHellmaker>10</FeralHellmaker>
          <FeralRazortooth>200</FeralRazortooth>
          <FeralSkullBuster>50</FeralSkullBuster>
          <FeralBoomer>20</FeralBoomer>
        </options>
      </li>
      <li>
        <kindDef>Normal</kindDef>
        <commonality>25</commonality>
        <options>
          <FeralGrinder>100</FeralGrinder>
          <FeralRazortooth>50</FeralRazortooth>
          <FeralTwisted>50</FeralTwisted>
          <FeralGutcher>50</FeralGutcher>
          <FeralSkullBuster>50</FeralSkullBuster>
          <FeralBoomer>20</FeralBoomer>
        </options>
      </li>
      <li>
        <kindDef>FactionBase</kindDef>
        <options>
          <FeralHusker>200</FeralHusker>
          <FeralMangler>200</FeralMangler>
          <FeralGrinder>50</FeralGrinder>
          <FeralScorcher>30</FeralScorcher>
          <FeralBoomer>20</FeralBoomer>
          <FeralThumper>30</FeralThumper>
          <FeralLeader>10</FeralLeader>
          <FeralOgrenaut>20</FeralOgrenaut>
          <FeralHellmaker>10</FeralHellmaker>
          <FeralGutcher>30</FeralGutcher>
          <FeralSkulker>30</FeralSkulker>
          <FeralRazortooth>80</FeralRazortooth>
          <FeralTwisted>100</FeralTwisted>
          <FeralSkullBuster>50</FeralSkullBuster>
        </options>
      </li>
    </pawnGroupMakers>

This didn't fix console problem for me, prob nothing can except making new colony with fixed faction. I didn't try that yet.
However if fixed lack of raids for me, I only had infestations and mechanoids so far.