RimWorld

RimWorld

Stonecutting Extended
Frostiken Nov 10, 2023 @ 1:32pm
'StonecuttingExtended.StonecuttingModStartUp' threw an exception
I'm getting the following error, this is a dump from Visual Exceptions. Does this make any sense to you? I get a warning on the console upon startup, and when I tried to modify the settings on the mod setting page (from the main menu) it wouldn't let me close the settings window and that's when this fault spit out.

Exception in Verse.Window.InnerWindowOnGUI: System.TypeInitializationException: The type initializer for 'StonecuttingExtended.StonecuttingModStartUp' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object
at StonecuttingExtended.Defs.DefsUpdater.UpdateStonecuttingSpeedStat (StonecuttingExtended.Settings.StonecuttingSettings settings) [0x0002b] in <3905176ae82640abbbdb1b2770d1d4c2>:0
at StonecuttingExtended.Defs.DefsUpdater.UpdateDefs () [0x0000c] in <3905176ae82640abbbdb1b2770d1d4c2>:0
at StonecuttingExtended.StonecuttingModStartUp..cctor () [0x00001] in <3905176ae82640abbbdb1b2770d1d4c2>:0
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.RuntimeMethodHandle.GetFunctionPointer(intptr)
at System.RuntimeMethodHandle.GetFunctionPointer () [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
at MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetFunctionPointer (System.Reflection.MethodBase method, System.RuntimeMethodHandle handle) [0x00000] in <255414689d344b1385ae719f6cce8c55>:0
at MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetNativeStart (System.Reflection.MethodBase method) [0x00035] in <255414689d344b1385ae719f6cce8c55>:0
at MonoMod.RuntimeDetour.DetourHelper.GetNativeStart (System.Reflection.MethodBase method) [0x00005] in <255414689d344b1385ae719f6cce8c55>:0
at HarmonyLib.HarmonySharedState.FindReplacement (System.Diagnostics.StackFrame frame) [0x00042] in <255414689d344b1385ae719f6cce8c55>:0
at HarmonyLib.Harmony.GetMethodFromStackframe (System.Diagnostics.StackFrame frame) [0x0000e] in <255414689d344b1385ae719f6cce8c55>:0
at VisualExceptions.ExceptionInfo.GetAllMethods (System.Exception ex, System.Int32 level) [0x00035] in <07c490e249c249ff929a9cc5067837e4>:0
at VisualExceptions.ExceptionInfo.GetAllMethods (System.Exception ex, System.Int32 level) [0x00010] in <07c490e249c249ff929a9cc5067837e4>:0
at VisualExceptions.ExceptionInfo.GetReport () [0x0003b] in <07c490e249c249ff929a9cc5067837e4>:0
at VisualExceptions.ExceptionInspector.DoWindowContents (UnityEngine.Rect inRect) [0x00132] in <07c490e249c249ff929a9cc5067837e4>:0
at Verse.Window.InnerWindowOnGUI (System.Int32 x) [0x001fd] in <cd7169108ea74757aa50c5b33d275c15>:0
- transpiler net.pardeike.rimworld.lib.harmony: IEnumerable`1 VisualExceptions.ExceptionsAndActivatorHandler:Transpiler(IEnumerable`1 instructions, MethodBase original)
< >
Showing 1-3 of 3 comments
Frostiken Nov 10, 2023 @ 1:50pm 
Also a dump from the first error on the console:

Error in static constructor of StonecuttingExtended.StonecuttingModStartUp: System.TypeInitializationException: The type initializer for 'StonecuttingExtended.StonecuttingModStartUp' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object
at StonecuttingExtended.Defs.DefsUpdater.UpdateStonecuttingSpeedStat (StonecuttingExtended.Settings.StonecuttingSettings settings) [0x0002b] in <3905176ae82640abbbdb1b2770d1d4c2>:0
at StonecuttingExtended.Defs.DefsUpdater.UpdateDefs () [0x0000c] in <3905176ae82640abbbdb1b2770d1d4c2>:0
at StonecuttingExtended.StonecuttingModStartUp..cctor () [0x00001] in <3905176ae82640abbbdb1b2770d1d4c2>: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_Patch3 (string)
(wrapper dynamic-method) Verse.StaticConstructorOnStartupUtility:Verse.StaticConstructorOnStartupUtility.CallAll_Patch4 ()
Verse.PlayDataLoader/<>c:<DoPlayLoad>b__4_5 ()
(wrapper dynamic-method) Verse.LongEventHandler:Verse.LongEventHandler.ExecuteToExecuteWhenFinished_Patch0 ()
Verse.LongEventHandler:UpdateCurrentAsynchronousEvent ()
Verse.LongEventHandler:LongEventsUpdate (bool&)
(wrapper dynamic-method) Verse.Root:Verse.Root.Update_Patch1 (Verse.Root)
(wrapper dynamic-method) Verse.Root_Entry:Verse.Root_Entry.Update_Patch0 (Verse.Root_Entry)
Frostiken Nov 10, 2023 @ 2:30pm 
Okay I just slapped this to the absolute end of my load order (I wish I'd taken note of where it was before...) so I have something incompatible, but I couldn't tell you what, would take hours of reloading the game to find it. But load order fixed it.
Scherub  [developer] Nov 10, 2023 @ 3:20pm 
I've just looked at the code of this method, and it could probably one of 3 reasons:

1. The settings aren't loaded, yet.
2. The DefDatabase isn't available at this time.
3. The 'skillNeedFactors' of the 'StonecuttingSpeed' definition is for whatever reason null.

Do you have a mod installed, which changes how the game loads everything? If so, that could be the reason.

But it's a good thing that you found a way to still run it without giving you problems.

Now, it would be great to figure out the mod that needs to be loaded before this mod, but I'm fully aware of the loading times with a long mod list. So best to forget about it. :)
< >
Showing 1-3 of 3 comments
Per page: 1530 50