BudgetAirpods / InsanityRemastered

A mod for Lethal Company that adds more features to the insanity mechanic.
4 stars 3 forks source link

SkinwalkersExperimental Compatibility #15

Open Noranecore opened 8 months ago

Noranecore commented 8 months ago

Just wanted to give you a heads up that Skinwalkers will soon change the way it stores audio clips in case that would break your Skinwalkers integration.

BudgetAirpods commented 8 months ago

Hello. Thank you for the heads up.idk if it was intentional or not but they seem to have already released it on the main version.

I have already made a fix for it. however it may not be very performance friendly. I won't know until I fully release this current update.

I might make a toggle between old and new integration depending if it affects performance heavily. This will obviously mean you would have to use an older version of skin walker.

BudgetAirpods commented 8 months ago

I have released an alpha build of the upcoming update. This should fix the integration. Please let me know if you experience any performance issues with it.

RugbugRedfern commented 7 months ago

Hey I'm the Skinwalkers dev. Just letting you know the current main build (4.0.1) is the exact same as 2.0.7 and was the result of a revert due to stability issues with the 3.0.0 release. InsanityRemastered should work fine with normal Skinwalkers because it's the same as the old version, but the SkinwalkersExperimental version uses the 3.0.0 release and will require a different hook if you want to access the audio. It will be a while before that version moves to main, if ever.

BudgetAirpods commented 7 months ago

Hey I'm the Skinwalkers dev. Just letting you know the current main build (4.0.1) is the exact same as 2.0.7 and was the result of a revert due to stability issues with the 3.0.0 release. InsanityRemastered should work fine with normal Skinwalkers because it's the same as the old version, but the SkinwalkersExperimental version uses the 3.0.0 release and will require a different hook if you want to access the audio. It will be a while before that version moves to main, if ever.

Thank you for letting me know! I'll keep the new and old versions of integration just in case it ever does get released.

Noranecore commented 7 months ago

I'm getting this error with SkinwalkersExperimental. Was integration with SkinwalkersExperimental fixed with the 1.1.1 release or am I mistaken?

[Message:   BepInEx] BepInEx 5.4.21.0 - Lethal Company (11/16/2023 6:37:54 PM)
[Info   :   BepInEx] Running under Unity v2022.3.9.15351836
[Info   :   BepInEx] CLR runtime version: 4.0.30319.42000
[Info   :   BepInEx] Supports SRE: True
[Info   :   BepInEx] System platform: Bits64, Windows
[Message:   BepInEx] Preloader started
[Info   :   BepInEx] Loaded 1 patcher method from [BepInEx.Preloader 5.4.21.0]
[Info   :   BepInEx] 1 patcher plugin loaded
[Info   :   BepInEx] Patching [UnityEngine.CoreModule] with [BepInEx.Chainloader]
[Message:   BepInEx] Preloader finished
[Message:   BepInEx] Chainloader ready
[Message:   BepInEx] Chainloader started
[Info   :   BepInEx] 2 plugins to load
[Warning:   BepInEx] Plugin [Insanity Remastered 1.1.1] targets a wrong version of BepInEx (5.4.22.0) and might not work until you update
[Info   :   BepInEx] Loading [Insanity Remastered 1.1.1]
[Error  : Unity Log] Unable to open archive file: Z:/home/naku/.config/r2modmanPlus-local/LethalCompany/profiles/testing/BepInEx/plugins/InsanityRemastered/soundresources_sfx
[Error  : Unity Log] Failed to read data for the AssetBundle 'Z:\home\naku\.config\r2modmanPlus-local\LethalCompany\profiles\testing\BepInEx\plugins\InsanityRemastered\soundresources_sfx'.
[Error  : Unity Log] Unable to open archive file: Z:/home/naku/.config/r2modmanPlus-local/LethalCompany/profiles/testing/BepInEx/plugins/InsanityRemastered/soundresources_stingers
[Error  : Unity Log] Failed to read data for the AssetBundle 'Z:\home\naku\.config\r2modmanPlus-local\LethalCompany\profiles\testing\BepInEx\plugins\InsanityRemastered\soundresources_stingers'.
[Error  : Unity Log] Unable to open archive file: Z:/home/naku/.config/r2modmanPlus-local/LethalCompany/profiles/testing/BepInEx/plugins/InsanityRemastered/soundresources_hallucination
[Error  : Unity Log] Failed to read data for the AssetBundle 'Z:\home\naku\.config\r2modmanPlus-local\LethalCompany\profiles\testing\BepInEx\plugins\InsanityRemastered\soundresources_hallucination'.
[Error  : Unity Log] Unable to open archive file: Z:/home/naku/.config/r2modmanPlus-local/LethalCompany/profiles/testing/BepInEx/plugins/InsanityRemastered/soundresources_drones
[Error  : Unity Log] Failed to read data for the AssetBundle 'Z:\home\naku\.config\r2modmanPlus-local\LethalCompany\profiles\testing\BepInEx\plugins\InsanityRemastered\soundresources_drones'.
[Error  : Unity Log] Unable to open archive file: Z:/home/naku/.config/r2modmanPlus-local/LethalCompany/profiles/testing/BepInEx/plugins/InsanityRemastered/soundresources_lc
[Error  : Unity Log] Failed to read data for the AssetBundle 'Z:\home\naku\.config\r2modmanPlus-local\LethalCompany\profiles\testing\BepInEx\plugins\InsanityRemastered\soundresources_lc'.
[Error  :BudgetAirpods.InsanityRemastered] Failed to load audio assets!
[Info   :   BepInEx] Loading [Skinwalker Mod Experimental 3.0.1]
[Message:BudgetAirpods.InsanityRemastered] Skinwalker mod installed, starting integration.
[Warning:  HarmonyX] AccessTools.Field: Could not find field for type SkinwalkerMod.SkinwalkerModPersistent and name cachedAudio
[Error  :  HarmonyX] Failed to patch void SkinwalkerMod.SkinwalkerModPersistent::Update(): System.ArgumentException: No such field defined in class SkinwalkerMod.SkinwalkerModPersistent
Parameter name: cachedAudio
  at HarmonyLib.Public.Patching.HarmonyManipulator.EmitCallParameter (System.Reflection.MethodInfo patch, System.Boolean allowFirsParamPassthrough, Mono.Cecil.Cil.VariableDefinition& tmpObjectVar, System.Collections.Generic.List`1[HarmonyLib.Public.Patching.HarmonyManipulator+ArgumentBoxInfo]& tmpBoxVars) [0x002b6] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WritePrefixes (HarmonyLib.Internal.Util.ILEmitter+Label returnLabel) [0x00179] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () [0x0022c] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
[Error  :   BepInEx] Error loading [Skinwalker Mod Experimental 3.0.1] : IL Compile Error (unknown location)
[Debug  :   BepInEx] HarmonyLib.HarmonyException: IL Compile Error (unknown location) ---> HarmonyLib.HarmonyException: IL Compile Error (unknown location) ---> HarmonyLib.HarmonyException: IL Compile Error (unknown location) ---> System.ArgumentException: No such field defined in class SkinwalkerMod.SkinwalkerModPersistent
Parameter name: cachedAudio
  at HarmonyLib.Public.Patching.HarmonyManipulator.EmitCallParameter (System.Reflection.MethodInfo patch, System.Boolean allowFirsParamPassthrough, Mono.Cecil.Cil.VariableDefinition& tmpObjectVar, System.Collections.Generic.List`1[HarmonyLib.Public.Patching.HarmonyManipulator+ArgumentBoxInfo]& tmpBoxVars) [0x002b6] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WritePrefixes (HarmonyLib.Internal.Util.ILEmitter+Label returnLabel) [0x00179] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () [0x0022c] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
   --- End of inner exception stack trace ---
  at HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () [0x00378] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.Process (MonoMod.Cil.ILContext ilContext, System.Reflection.MethodBase originalMethod) [0x00042] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.Manipulate (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo, MonoMod.Cil.ILContext ctx) [0x00006] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.Manipulate (System.Reflection.MethodBase original, MonoMod.Cil.ILContext ctx) [0x00007] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.ManagedMethodPatcher.Manipulator (MonoMod.Cil.ILContext ctx) [0x00012] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at MonoMod.Cil.ILContext.Invoke (MonoMod.Cil.ILContext+Manipulator manip) [0x00087] in <6733e342b5b549bba815373898724469>:0 
  at MonoMod.RuntimeDetour.ILHook+Context.InvokeManipulator (Mono.Cecil.MethodDefinition def, MonoMod.Cil.ILContext+Manipulator cb) [0x00012] in <4e2760c7517c4ea79c633d67e84b319f>:0 
  at (wrapper dynamic-method) MonoMod.RuntimeDetour.ILHook+Context.DMD<MonoMod.RuntimeDetour.ILHook+Context::Refresh>(MonoMod.RuntimeDetour.ILHook/Context)
  at (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.Trampoline<MonoMod.RuntimeDetour.ILHook+Context::Refresh>?998324120(object)
  at HarmonyLib.Internal.RuntimeFixes.StackTraceFixes.OnILChainRefresh (System.Object self) [0x00000] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at MonoMod.RuntimeDetour.ILHook.Apply () [0x00059] in <4e2760c7517c4ea79c633d67e84b319f>:0 
  at HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) [0x00047] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
   --- End of inner exception stack trace ---
  at HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) [0x0005f] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.PatchFunctions.UpdateWrapper (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo) [0x00033] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
   --- End of inner exception stack trace ---
  at HarmonyLib.PatchFunctions.UpdateWrapper (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo) [0x0005d] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.PatchProcessor.Patch () [0x000fb] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Harmony.Patch (System.Reflection.MethodBase original, HarmonyLib.HarmonyMethod prefix, HarmonyLib.HarmonyMethod postfix, HarmonyLib.HarmonyMethod transpiler, HarmonyLib.HarmonyMethod finalizer, HarmonyLib.HarmonyMethod ilmanipulator) [0x00031] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at InsanityRemastered.ModIntegration.ModIntegrator.BeginIntegrations (System.Reflection.Assembly assembly) [0x00089] in <63be1188265d4cd8bf413f50ed0492e0>:0 
  at InsanityRemastered.InsanityRemasteredBase.CurrentDomain_AssemblyLoad (System.Object sender, System.AssemblyLoadEventArgs args) [0x00007] in <63be1188265d4cd8bf413f50ed0492e0>:0 
  at System.AppDomain.DoAssemblyLoad (System.Reflection.Assembly assembly) [0x00016] in <787acc3c9a4c471ba7d971300105af24>:0 
  at (wrapper managed-to-native) System.Reflection.Assembly.LoadFile_internal(string,System.Threading.StackCrawlMark&)
  at System.Reflection.Assembly.LoadFile (System.String path, System.Security.Policy.Evidence securityEvidence) [0x0002d] in <787acc3c9a4c471ba7d971300105af24>:0 
  at (wrapper dynamic-method) BepInEx.Preloader.RuntimeFixes.HarmonyInteropFix.DMD<BepInEx.Preloader.RuntimeFixes.HarmonyInteropFix::LoadFile>(string)
  at BepInEx.Preloader.RuntimeFixes.HarmonyInteropFix.OnAssemblyLoad (System.Reflection.Assembly& __result, System.String __0) [0x0001d] in <fc9d7fbc6dcb44cf87be11d8d92ae161>:0 
  at (wrapper dynamic-method) System.Reflection.Assembly.DMD<System.Reflection.Assembly::LoadFile>(string)
  at BepInEx.Bootstrap.Chainloader.Start () [0x006c8] in <fe49c90fe8e24102b42489c11910c71c>:0 
[Message:   BepInEx] Chainloader startup complete
[Info   : Unity Log] Saving changed settings
[Info   : Unity Log] subcribing to steam callbacks
[Info   : Unity Log] Returning week num: 6
[Info   : Unity Log] week num: 6
BudgetAirpods commented 7 months ago

The current version uses the non-experimental version as the developer of Skinwalker has stated they have returned to the older method of saving/loading audio files.

My statement about keeping both versions was that I would keep the code for the experimental version on hand in case it ever did get released so I wouldn't have to re-write it all.

Until the experimental version where recordings are saved in memory is officially released, I will use the old version of integration. Although, I could add a setting to allow you to use the experimental version if you would like.