Corpse.CalculateMarketValue Exceptoion (SOLVED)

Started by ilikegoodfood, September 29, 2018, 01:43:40 PM

Previous topic - Next topic

ilikegoodfood

I've spent the day systematically fixing bugs and updating my Monster Mash mod from b18 to b19 and have found a yellow error that I have no clue how to tackle.

Caught exception while loading play data but there are active mods other than Core. Resetting mods config and trying again.
The exception was: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.ThingDefGenerator_Corpses.CalculateMarketValue (Verse.ThingDef raceDef) [0x00000] in <filename unknown>:0
  at RimWorld.ThingDefGenerator_Corpses+<ImpliedCorpseDefs>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
  at System.Linq.Enumerable+<CreateConcatIterator>c__Iterator1`1[Verse.ThingDef].MoveNext () [0x00000] in <filename unknown>:0
  at RimWorld.DefGenerator.GenerateImpliedDefs_PreResolve () [0x00000] in <filename unknown>:0
  at Verse.PlayDataLoader.DoPlayLoad () [0x00000] in <filename unknown>:0
  at Verse.PlayDataLoader.LoadAllPlayData (Boolean recovering) [0x00000] in <filename unknown>:0
Verse.Log:Warning(String, Boolean)
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.Root:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()


All of the body plans have been correctly updated and the dessicated graphics implemented. All in all, I have no clue what's causing it or how to go about fixing it.

As far as I can tell, this should be the last bug, assuming compatibility updates go smoothly, so fixing it will take me a major step closer to release. Any help would be very much appreciated.
Thanks in advance.


mipen

There has to be something missing from one of your race defs. Make sure to cross check them against vanilla racedefs. If you can't find anything, use ilspy and look at the method throwing the error (ThingDefGenerator_Corpses.CalculateMarketValue) and see if there is anything in that being used that you don't have in your def

ilikegoodfood

#2
Thanks for the tip. I went through and systematically compared all of my body part Defs, body Defs and race Defs and I found that I was using an incorrect useLeatherFrom from before the update on one creature.

Now that that's fixed, I'm still getting a null object reference error in the same function, so I'm working on tracking that down. It's probably as simple as some capitalization change or something.

EDIT 1: And the component Def has been renamed to ComponentIndustrial.

EDIT 2: That seems to have solved the terminal corpse issue, but now I'm getting a whole host of cannot cross reference errors relating to left-right lungs, which I switched out to match the new system... There aren't any anymore. :(

EDIT 3: I hadn't updated the Venom types. They were the ones calling on the Left/Right Lungs.

EDIT 4: All base bugs fixed! Just working out the new compatibility features now. Marking thread as solved. Thanks.