RimWorld

RimWorld

Way Better Romance
This topic has been locked
Frisky Bacon Mar 17, 2024 @ 6:15pm
weird bug
Been having some problems with rimworld, and this mode is getting referenced a lot, on startup I get this error
Error in static constructor of BetterRomance.OnStartup: System.TypeInitializationException: The type initializer for 'BetterRomance.OnStartup' threw an exception. ---> System.Exception: Somehow -9998 % 3 does not equal 0, 1, or 2 at BetterRomance.RaceSettings.GrowthMomentArray (System.Int32 childAge, System.Int32 adultAge) [0x00082] in <af7655092bf9429790b7312528154909>:0 at BetterRomance.RaceSettings.SetGrowthMoments () [0x001d2] in <af7655092bf9429790b7312528154909>:0 at BetterRomance.RaceSettings..ctor (Verse.ThingDef race) [0x0005c] in <af7655092bf9429790b7312528154909>:0 at BetterRomance.OnStartup.MakeRaceSettingsList () [0x00052] in <af7655092bf9429790b7312528154909>:0 at BetterRomance.OnStartup..cctor () [0x004d1] in <af7655092bf9429790b7312528154909>:0 --- End of inner exception stack trace --- at (wrapper managed-to-native) System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(intptr) at System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (System.RuntimeTypeHandle type) [0x0002a] in <eae584ce26bc40229c1b1aa476bfa589>:0 at (wrapper dynamic-method) Verse.StaticConstructorOnStartupUtility.Verse.StaticConstructorOnStartupUtility.CallAll_Patch4() UnityEngine.StackTraceUtility:ExtractStackTrace () (wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch6 (string) (wrapper dynamic-method) Verse.StaticConstructorOnStartupUtility:Verse.StaticConstructorOnStartupUtility.CallAll_Patch4 () Verse.PlayDataLoader/<>c:<DoPlayLoad>b__4_5 () Verse.LongEventHandler:ExecuteToExecuteWhenFinished () Verse.LongEventHandler:UpdateCurrentAsynchronousEvent () Verse.LongEventHandler:LongEventsUpdate (bool&) (wrapper dynamic-method) Verse.Root:Verse.Root.Update_Patch1 (Verse.Root) Verse.Root_Entry:Update ()

and when I try and generate non-human race like a ratkin, I get these errors:

Error while generating pawn. Rethrowing. Exception: System.NullReferenceException: Object reference not set to an instance of an object at BetterRomance.SettingsUtilities.ChildAge (Verse.Pawn pawn) [0x00007] in <af7655092bf9429790b7312528154909>:0 at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GenerateTraits_Patch4(Verse.Pawn,Verse.PawnGenerationRequest) at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.TryGenerateNewPawnInternal_Patch4(Verse.PawnGenerationRequest&,string&,bool,bool) at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GenerateNewPawnInternal_Patch3(Verse.PawnGenerationRequest&) at Verse.PawnGenerator.GenerateOrRedressPawnInternal (Verse.PawnGenerationRequest request) [0x00188] in <cd7169108ea74757aa50c5b33d275c15>:0 at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GeneratePawn_Patch8(Verse.PawnGenerationRequest) UnityEngine.StackTraceUtility:ExtractStackTrace () (wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch6 (string) (wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.GeneratePawn_Patch8 (Verse.PawnGenerationRequest) CharacterEditor.PawnxTool:CreateNewPawn (Verse.PawnKindDef,RimWorld.Faction,Verse.ThingDef,bool) CharacterEditor.PresetPawn:GeneratePawn (bool,bool) CharacterEditor.RaceTool:ChangeRace (Verse.Pawn,Verse.PawnKindDef,bool) CharacterEditor.DialogChangeRace:DoAndClose () CharacterEditor.SZWidgets:ButtonText (UnityEngine.Rect,string,System.Action,string) CharacterEditor.WindowTool:SimpleAcceptButton (Verse.Window,System.Action) CharacterEditor.DialogChangeRace:DoWindowContents (UnityEngine.Rect) Verse.Window:InnerWindowOnGUI (int) UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle)

Exception filling window for CharacterEditor.DialogChangeRace: System.NullReferenceException: Object reference not set to an instance of an object at CharacterEditor.PawnxTool.CreateNewPawn (Verse.PawnKindDef pkd, RimWorld.Faction f, Verse.ThingDef raceDef, System.Boolean forceFaction) [0x001fe] in <31aeedd25e67475286a4c61702d6ebc1>:0 at CharacterEditor.PresetPawn.GeneratePawn (System.Boolean _setBodyParts, System.Boolean setApparel) [0x00043] in <31aeedd25e67475286a4c61702d6ebc1>:0 at CharacterEditor.RaceTool.ChangeRace (Verse.Pawn pawn, Verse.PawnKindDef pkd, System.Boolean keepRaceSpecificClothes) [0x0003a] in <31aeedd25e67475286a4c61702d6ebc1>:0 at CharacterEditor.DialogChangeRace.DoAndClose () [0x00029] in <31aeedd25e67475286a4c61702d6ebc1>:0 at CharacterEditor.SZWidgets.ButtonText (UnityEngine.Rect rect, System.String label, System.Action action, System.String toolTip) [0x00021] in <31aeedd25e67475286a4c61702d6ebc1>:0 at CharacterEditor.WindowTool.SimpleAcceptButton (Verse.Window w, System.Action action) [0x00015] in <31aeedd25e67475286a4c61702d6ebc1>:0 at CharacterEditor.DialogChangeRace.DoWindowContents (UnityEngine.Rect inRect) [0x000b1] in <31aeedd25e67475286a4c61702d6ebc1>:0 at Verse.Window.InnerWindowOnGUI (System.Int32 x) [0x001d3] in <cd7169108ea74757aa50c5b33d275c15>:0 UnityEngine.StackTraceUtility:ExtractStackTrace () (wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch6 (string) Verse.Window:InnerWindowOnGUI (int) UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle)

anyone have any idea what happened? this is a pretty recent problem, as I've been using this mod for ages alongside other race mods, and this has never happened before. (I also checked just putting ratkin and this mod, on the list and the mod was not present so it must be some other mod that is interfering.)
< >
Showing 1-3 of 3 comments
divineDerivative  [developer] Mar 17, 2024 @ 7:00pm 
If you check the author comments and the changelog, you'll see that there was a massive back end rework, so that's what happened.

If that first error was for Paniel, I've already fixed it, but I'm doing some other stuff before I upload it. They have a custom adult lifestage that starts at age 0, but for some reason they also have all the human lifestages with absurdly high ages. So you can understand how my code might get confused when trying to figure out growth moments for a race that becomes a child at age 999996 and an adult at age 0.

Races that have their ages set up incorrectly will cause errors until I know what they're doing and can account for it. Luckily for Paniel, they're just robots and I already have ways to exclude robots from this stuff. If you come across any other races doing stupid things with ages, you should encourage the authors to come to the HAR discord. There's plenty of people who can help them get things set up correctly.

The other errors are probably being caused by that first one. For reference, if you get red errors on start up and decide to keep playing, you should not be surprised when you keep getting errors.

If you have any other issues like this after I upload the Paniel fix, please tell me exactly which races are causing it. If you're not sure, provide a HugsLib log or Player.log file.
Frisky Bacon Mar 17, 2024 @ 9:03pm 
probably should have specified, those errors I get when I try and create a Ratkin or Moyo (the two racemods I currently have running) prevent the pawns from even creating, I cannot even start a game because the errors prevent me from opening that menu. nor can spawn them in games, nor change pawns into being Ratkin.

I've also been doing some testing since I posted this, and after stripping the game down to just this mod and the moyo and Ratkin mods (along with submods and dependencies), and it starts fine, with none of the errors or problems. so it must be some third mod breaking things for both this mod and those mods, so now I'm just doing further troubleshooting.

any idea what that third mod might be, would be helpful.
divineDerivative  [developer] Mar 18, 2024 @ 8:12am 
Originally posted by divineDerivative:
The other errors are probably being caused by that first one. For reference, if you get red errors on start up and decide to keep playing, you should not be surprised when you keep getting errors.
Make sure you have the most recent update and try again.
Originally posted by divineDerivative:
If you have any other issues like this after I upload the Paniel fix, please tell me exactly which races are causing it. If you're not sure, provide a HugsLib log or Player.log file.
< >
Showing 1-3 of 3 comments
Per page: 1530 50