RimWorld

RimWorld

Children, school and learning
sdwvit 18 Dec, 2023 @ 8:52am
Error while generating pawn. Fix inside
Exeption log

Error while generating pawn. Rethrowing. Exception: System.NullReferenceException: Object reference not set to an instance of an object at Verse.DefMap`2[D,V].get_Item (D def) [0x00000] in <d006c28bc811417ea565feda544f6d2b>:0 at RimWorld.HistoryEventsManager.RecordEvent (RimWorld.HistoryEvent historyEvent, System.Boolean canApplySelfTookThoughts) [0x00056] in <d006c28bc811417ea565feda544f6d2b>:0 at RimWorld.Pawn_IdeoTracker.SetIdeo (RimWorld.Ideo ideo) [0x00043] in <d006c28bc811417ea565feda544f6d2b>:0 at Verse.PawnGenerator.TryGenerateNewPawnInternal (Verse.PawnGenerationRequest& request, System.String& error, System.Boolean ignoreScenarioRequirements, System.Boolean ignoreValidator) [0x00632] in <d006c28bc811417ea565feda544f6d2b>:0 at Verse.PawnGenerator.GenerateNewPawnInternal (Verse.PawnGenerationRequest& request) [0x00094] in <d006c28bc811417ea565feda544f6d2b>:0 at Verse.PawnGenerator.GenerateOrRedressPawnInternal (Verse.PawnGenerationRequest request) [0x00188] in <d006c28bc811417ea565feda544f6d2b>:0 at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GeneratePawn_Patch1(Verse.PawnGenerationRequest) UnityEngine.StackTraceUtility:ExtractStackTrace () (wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch3 (string) (wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.GeneratePawn_Patch1 (Verse.PawnGenerationRequest) Children.ChildrenHarmony/Hediff_Pregnant_Patch2:BirthByPawnGenerationRequests (Verse.Pawn,Verse.Pawn,Verse.Pawn,System.Collections.Generic.List`1<Verse.PawnGenerationRequest>) Children.ChildrenHarmony/Hediff_Pregnant_Patch2:Pawn_DoBirthSpawn_Pre (Verse.Pawn,Verse.Pawn) (wrapper dynamic-method) Verse.Hediff_Pregnant:Verse.Hediff_Pregnant.DoBirthSpawn_Patch1 (Verse.Pawn,Verse.Pawn) Children.ChildrenHarmony/Hediff_Pregnant_PatchMCPrevent:Hediff_Pregnant_TickPre (Verse.Hediff_Pregnant) (wrapper dynamic-method) Verse.Hediff_Pregnant:Verse.Hediff_Pregnant.Tick_Patch2 (Verse.Hediff_Pregnant) (wrapper dynamic-method) ...
rethrown:
BirthByPawnGenerationRequests: error: Object reference not set to an instance of an object UnityEngine.StackTraceUtility:ExtractStackTrace () (wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch3 (string) ChdLogger.ChdLogging:LogError (string) Children.ChildrenHarmony/Hediff_Pregnant_Patch2:BirthByPawnGenerationRequests (Verse.Pawn,Verse.Pawn,Verse.Pawn,System.Collections.Generic.List`1<Verse.PawnGenerationRequest>) Children.ChildrenHarmony/Hediff_Pregnant_Patch2:Pawn_DoBirthSpawn_Pre (Verse.Pawn,Verse.Pawn) (wrapper dynamic-method) Verse.Hediff_Pregnant:Verse.Hediff_Pregnant.DoBirthSpawn_Patch1 (Verse.Pawn,Verse.Pawn) Children.ChildrenHarmony/Hediff_Pregnant_PatchMCPrevent:Hediff_Pregnant_TickPre (Verse.Hediff_Pregnant) ...

I don't have ideology installed and stack trace seem to indicate the code is trying to set child ideology and drops with a Null pointer.
at RimWorld.Pawn_IdeoTracker.SetIdeo (RimWorld.Ideo ideo) [0x00043] in <d006c28bc811417ea565feda544f6d2b>:0

The fix is to turn off "Inherit ideology from parent". Mod author can maybe add a check for ideology dlc before running code above.

Logs after the fix suggest the same:
Tattoos is an Ideology-specific game system. If you want to use this code please check ModLister.IdeologyInstalled before calling it. UnityEngine.StackTraceUtility:ExtractStackTrace () (wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch3 (string) Verse.Log:ErrorOnce (string,int) Verse.ModLister:CheckDLC (bool,string,string,string) Verse.ModLister:CheckIdeology (string) RimWorld.Pawn_StyleTracker:set_FaceTattoo (RimWorld.TattooDef) Children.ChildrenHarmony/PawnUtility_Patch:TrySpawnHatchedOrBornPawnExtended (bool&,Verse.Pawn,Verse.Thing) (wrapper dynamic-method) RimWorld.PawnUtility:RimWorld.PawnUtility.TrySpawnHatchedOrBornPawn_Patch2 (Verse.Pawn,Verse.Thing,System.Nullable`1<Verse.IntVec3>) Children.ChildrenHarmony/Hediff_Pregnant_Patch2:BirthByPawnGenerationRequests (Verse.Pawn,Verse.Pawn,Verse.Pawn,System.Collections.Generic.List`1<Verse.PawnGenerationRequest>) Children.ChildrenHarmony/Hediff_Pregnant_Patch2:Pawn_DoBirthSpawn_Pre (Verse.Pawn,Verse.Pawn) (wrapper dynamic-method) Verse.Hediff_Pregnant:Verse.Hediff_Pregnant.DoBirthSpawn_Patch1 (Verse.Pawn,Verse.Pawn) Children.ChildrenHarmony/Hediff_Pregnant_PatchMCPrevent:Hediff_Pregnant_TickPre (Verse.Hediff_Pregnant) (wrapper dynamic-method) Verse.Hediff_Pregnant:Verse.Hediff_Pregnant.Tick_Patch2 (Verse.Hediff_Pregnant) (wrapper dynamic-method) Verse.Pawn_HealthTracker:Verse.Pawn_HealthTracker.HealthTick_Patch0 (Verse.Pawn_HealthTracker) (wrapper dynamic-method) Verse.Pawn:Verse.Pawn.Tick_Patch1 (Verse.Pawn) Verse.TickList:Tick () (wrapper dynamic-method) Verse.TickManager:Verse.TickManager.DoSingleTick_Patch1 (Verse.TickManager) Verse.TickManager:TickManagerUpdate () (wrapper dynamic-method) Verse.Game:Verse.Game.UpdatePlay_Patch2 (Verse.Game) (wrapper dynamic-method) Verse.Root_Play:Verse.Root_Play.Update_Patch0 (Verse.Root_Play)
< >
Showing 1-1 of 1 comments
Dylan  [developer] 20 May, 2024 @ 3:43pm 
thanks for the infos, yeah it was not checking if ideology is active before doing it, should be fixed in the next version (as far as I can tell it should not have caused any other problems though)
< >
Showing 1-1 of 1 comments
Per page: 1530 50