RimWorld

RimWorld

LightsOut
This topic has been locked
MarkH 22 Oct, 2022 @ 12:30pm
Compatibility issue with Dubs Bad Hygiene
There's an exception immediately following the line "patching "DubsBadHygiene - ProperGlowerComp" to count as a glower":


[HugsLib][ERR] LightsOut caused an exception during OnDefsLoaded: System.ArgumentException: You can only patch implemented methods/constructors. Patch the declared method virtual System.Boolean Verse.CompGlower::get_ShouldBeLitNow() instead.
at HarmonyLib.PatchProcessor.Patch () [0x00051] in <255414689d344b1385ae719f6cce8c55>:0
at HarmonyLib.Harmony.Patch (System.Reflection.MethodBase original, HarmonyLib.HarmonyMethod prefix, HarmonyLib.HarmonyMethod postfix, HarmonyLib.HarmonyMethod transpiler, HarmonyLib.HarmonyMethod finalizer) [0x00028] in <255414689d344b1385ae719f6cce8c55>:0
at LightsOut.Patches.ModCompatibility.ModCompatibilityManager.ApplyPatchComponent (LightsOut.Patches.ModCompatibility.ICompatibilityPatchComponent comp) [0x00196] in <63b9db36796c453c93f7bdf2d14405f2>:0
at LightsOut.Patches.ModCompatibility.ModCompatibilityManager.ApplyPatch (LightsOut.Patches.ModCompatibility.ICompatibilityPatch patch) [0x000a4] in <63b9db36796c453c93f7bdf2d14405f2>:0
at LightsOut.Patches.ModCompatibility.ModCompatibilityManager.LoadCompatibilityPatches () [0x00015] in <63b9db36796c453c93f7bdf2d14405f2>:0
at LightsOut.Boilerplate.ModSettings.DefsLoaded () [0x00053] in <63b9db36796c453c93f7bdf2d14405f2>:0
at HugsLib.HugsLibController.OnDefsLoaded () [0x0001a] in <4a46802aeab646ab99159f7eecb6b57e>:0
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch2 (string)
HugsLib.Utils.ModLogger:ReportException (System.Exception,string,bool,string)
HugsLib.HugsLibController:OnDefsLoaded ()
HugsLib.HugsLibController:LoadReloadInitialize ()
Verse.LongEventHandler:RunEventFromAnotherThread (System.Action)
Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__27_0 ()
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()


Removing Bad Hygiene fixes the problem. I also tried loading the game with just LightsOut and Dubs and it still happens as well.
< >
Showing 1-9 of 9 comments
juanlopez2008  [developer] 22 Oct, 2022 @ 1:19pm 
Fixed in latest update. Dubs made a (dumb, imo) decision when porting this mod to 1.4. That being said, I saw Wall Light do something similar, so maybe it's a workaround for something that I'm unaware of.

I don't regard Wall Light as a well-written mod, so I wouldn't be surprised if they were both just doing something silly. that was rude, knock it off juan.
Last edited by juanlopez2008; 23 Oct, 2022 @ 11:58am
MarkH 22 Oct, 2022 @ 1:49pm 
Originally posted by juanlopez2008:
Fixed in latest update. Dubs made a (dumb, imo) decision when porting this mod to 1.4. That being said, I saw Wall Light do something similar, so maybe it's a workaround for something that I'm unaware of.

I don't regard Wall Light as a well-written mod, so I wouldn't be surprised if they were both just doing something silly.

Thank you for the update! Much appreciated.

Unfortunately, I'm the bearer of additional bad news. It seems the updated RimFridge is running into the same issue:

"patching "RimFridge - CompToggleGlower" to count as a glower"

[HugsLib][ERR] LightsOut caused an exception during OnDefsLoaded: System.ArgumentException: You can only patch implemented methods/constructors. Patch the declared method virtual System.Boolean Verse.CompGlower::get_ShouldBeLitNow() instead.
at HarmonyLib.PatchProcessor.Patch () [0x00051] in <255414689d344b1385ae719f6cce8c55>:0
at HarmonyLib.Harmony.Patch (System.Reflection.MethodBase original, HarmonyLib.HarmonyMethod prefix, HarmonyLib.HarmonyMethod postfix, HarmonyLib.HarmonyMethod transpiler, HarmonyLib.HarmonyMethod finalizer) [0x00028] in <255414689d344b1385ae719f6cce8c55>:0
at LightsOut.Patches.ModCompatibility.ModCompatibilityManager.ApplyPatchComponent (LightsOut.Patches.ModCompatibility.ICompatibilityPatchComponent comp) [0x00196] in <9e5bf7f15ce64976bfd50e7672f4ba70>:0
at LightsOut.Patches.ModCompatibility.ModCompatibilityManager.ApplyPatch (LightsOut.Patches.ModCompatibility.ICompatibilityPatch patch) [0x000a4] in <9e5bf7f15ce64976bfd50e7672f4ba70>:0
at LightsOut.Patches.ModCompatibility.ModCompatibilityManager.LoadCompatibilityPatches () [0x00015] in <9e5bf7f15ce64976bfd50e7672f4ba70>:0
at LightsOut.Boilerplate.ModSettings.DefsLoaded () [0x00053] in <9e5bf7f15ce64976bfd50e7672f4ba70>:0
at HugsLib.HugsLibController.OnDefsLoaded () [0x0001a] in <4a46802aeab646ab99159f7eecb6b57e>:0
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch2 (string)
HugsLib.Utils.ModLogger:ReportException (System.Exception,string,bool,string)
HugsLib.HugsLibController:OnDefsLoaded ()
HugsLib.HugsLibController:LoadReloadInitialize ()
Verse.LongEventHandler:RunEventFromAnotherThread (System.Action)
Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__27_0 ()
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()
juanlopez2008  [developer] 22 Oct, 2022 @ 2:38pm 
YIKES, well I added some additional checks that detects this problem so it shouldn't happen again.
Nuker1110 22 Oct, 2022 @ 5:15pm 
Error thrown in the newest hotfix as of posting
[HugsLib][ERR] LightsOut caused an exception during OnDefsLoaded: System.ArgumentException: You can only patch implemented methods/constructors. Patch the declared method virtual System.Boolean Verse.CompGlower::get_ShouldBeLitNow() instead.
at HarmonyLib.PatchProcessor.Patch () [0x00051] in <255414689d344b1385ae719f6cce8c55>:0
at HarmonyLib.Harmony.Patch (System.Reflection.MethodBase original, HarmonyLib.HarmonyMethod prefix, HarmonyLib.HarmonyMethod postfix, HarmonyLib.HarmonyMethod transpiler, HarmonyLib.HarmonyMethod finalizer) [0x00028] in <255414689d344b1385ae719f6cce8c55>:0
at LightsOut.Patches.ModCompatibility.ModCompatibilityManager.ApplyPatchComponent (LightsOut.Patches.ModCompatibility.ICompatibilityPatchComponent comp) [0x00196] in <3c09a7f8315e4ecdad83fd7a39b6b891>:0
at LightsOut.Patches.ModCompatibility.ModCompatibilityManager.ApplyPatch (LightsOut.Patches.ModCompatibility.ICompatibilityPatch patch) [0x000a4] in <3c09a7f8315e4ecdad83fd7a39b6b891>:0
at LightsOut.Patches.ModCompatibility.ModCompatibilityManager.LoadCompatibilityPatches () [0x00015] in <3c09a7f8315e4ecdad83fd7a39b6b891>:0
at LightsOut.Boilerplate.ModSettings.DefsLoaded () [0x00053] in <3c09a7f8315e4ecdad83fd7a39b6b891>:0
at HugsLib.HugsLibController.OnDefsLoaded () [0x0001a] in <6685087a0fc048d49e61a2c7c1ed1aee>:0
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch1 (string)
HugsLib.Utils.ModLogger:ReportException (System.Exception,string,bool,string)
HugsLib.HugsLibController:OnDefsLoaded ()
HugsLib.HugsLibController:LoadReloadInitialize ()
Verse.LongEventHandler:RunEventFromAnotherThread (System.Action)
Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__27_0 ()
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()
juanlopez2008  [developer] 22 Oct, 2022 @ 5:26pm 
Are you sure you’re on the latest version?

What version does it say in the log when my mod loads? Should be something like 2022.10.22.X.
juanlopez2008  [developer] 22 Oct, 2022 @ 5:27pm 
Only asking because I specifically disallow patching such methods in the latest version, using the same check that Harmony uses to generate that error.
Last edited by juanlopez2008; 22 Oct, 2022 @ 5:32pm
MarkH 23 Oct, 2022 @ 9:02am 
Originally posted by juanlopez2008:
YIKES, well I added some additional checks that detects this problem so it shouldn't happen again.

Thank you! I definitely appreciate it!
juanlopez2008  [developer] 23 Oct, 2022 @ 9:39am 
No, thank you for the heads up that it was happening! I'm surprised we never ran into it on 1.3; it definitely would have been an issue there as well... easy enough fix, though.
juanlopez2008  [developer] 23 Oct, 2022 @ 9:42am 
@Nuker1110, this issue should have already been fixed by the time you posted; have you had a chance to see if you're on the correct version?
< >
Showing 1-9 of 9 comments
Per page: 1530 50