MattMcMullan / Timberborn-Mods

One central location for my timberborn modding efforts.
BSD 2-Clause "Simplified" License
0 stars 3 forks source link

ZoomOutCamera breaks camera #1

Open blechinger opened 2 years ago

blechinger commented 2 years ago

👋 Starting / loading a save with this mod enabled breaks the camera on world load. I narrowed down the issue to this mod (though suspected it due to the error) and tested with it as the only mod installed (fresh install in steam / verified files as well).

Output:

[Message:   BepInEx] BepInEx 5.4.19.0 - Timberborn (9/14/2022 1:15:04 PM)
[Info   :   BepInEx] Running under Unity v2022.1.6.14981713
[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.19.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
[Info   :   BepInEx] Loading [MoreMapDirectories 1.0.0]
[Error  : Unity Log] AmbiguousMatchException: Ambiguous match found.
Stack trace:
System.RuntimeType.GetMethodImplCommon (System.String name, System.Int32 genericParameterCount, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConv, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at <890d6fe26e8c408ea64b353e791fafce>:0)
System.RuntimeType.GetMethodImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConv, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at <890d6fe26e8c408ea64b353e791fafce>:0)
System.Type.GetMethod (System.String name, System.Reflection.BindingFlags bindingAttr) (at <890d6fe26e8c408ea64b353e791fafce>:0)
HarmonyLib.AccessTools.DeclaredMethod (System.Type type, System.String name, System.Type[] parameters, System.Type[] generics) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.PatchTools.GetOriginalMethod (HarmonyLib.HarmonyMethod attr) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
Rethrow as HarmonyException: Ambiguous match for HarmonyMethod[(class=Timberborn.MapSystem.MapRepository, methodname=CustomMapNameToFileName, type=Normal, args=undefined)]
HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.PatchClassProcessor.Patch () (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Harmony.<PatchAll>b__11_0 (System.Type type) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.CollectionExtensions.Do[T] (System.Collections.Generic.IEnumerable`1[T] sequence, System.Action`1[T] action) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Harmony.PatchAll (System.Reflection.Assembly assembly) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Harmony.CreateAndPatchAll (System.Reflection.Assembly assembly, System.String harmonyInstanceId) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
TBMoreMapsDirectories.MoreMapsDirectoriesPlugin.Awake () (at <a4802ee27f00483e9eaaae70a3e104c3>:0)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.InputSystem.InputSystem:.cctor()

[Info   :   BepInEx] Loading [Zoom Out The Camera 1.0.0.0]
[Info   : Unity Log] Loaded ZoomOutMore.
[Message:   BepInEx] Chainloader startup complete
[Info   : Unity Log] Starting game version 0.2.8.1-0748a0c-sw
[Info   : Unity Log] System info:
System: Windows 11  (10.0.22622) 64bit
CPU: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
GPU: NVIDIA GeForce GTX 1080 Ti
GPU memory: 11128MB
RAM: 32687MB
Drives:
  C:\ 583.45GB free from 952.63GB
  D:\ 551.78GB free from 953.85GB
  G:\ 223.31GB free from 1863.00GB
  V:\ 235.06GB free from 1863.00GB

[Info   : Unity Log] Modded: true, BepInEx
Setting breakpad minidump AppID = 1062090
SteamInternal_SetMinidumpSteamID:  Caching Steam ID:  76561198038712571 [API loaded no]
[Info   : Unity Log] Successfully connected to the Steam client.
[Info   : Unity Log] Reading WorldSave from compressed stream
[Info   : Unity Log] Deserialized save with version: 0.2.8.1-0748a0c-sw
[Error  : Unity Log] MissingFieldException: Field not found: Timberborn.Common.FloatLimits Timberborn.CameraSystem.CameraComponent.DefaultZoomLimits Due to: Could not find field in class
Stack trace:
(wrapper dynamic-method) Timberborn.CameraSystem.CameraComponent.DMD<Timberborn.CameraSystem.CameraComponent::Awake>(Timberborn.CameraSystem.CameraComponent)
UnityEngine.Transform:SetParent(Transform, Transform, Boolean)
Bindito.Unity.SceneConfigurator:Awake()

[Info   : Unity Log] Load time: 26914 ms
Ofiotauro commented 1 year ago

Same problem here! I get the same output when this mod is enabled.

HaiMeister commented 1 year ago

Bumping. Same issue here. Tried each version of the BepInExPack as well same output.

LogOutput.log

Ecconia commented 1 year ago

Fixed it in PR #2 it has yet to be merged and published though.

Ofiotauro commented 1 year ago

Fixed it in PR #2 it has yet to be merged and published though.

Nice one! Thanks! The problem is that I suck with this stuff and I have no idea how to use Harmony XD I'll probably wait for the merging.

Ecconia commented 1 year ago

As for everyone that needs this mod, and cannot build my fix themself. Just message me on Discord and I can send you the fixed DLL.

But there is also the new mod Camera Tweaker that provides a better functionality and is up to date - but it currently only works if you do not unlock your camera in the settings. -> I made an issue for that. And if that issue goes through, everyone can switch to that mod (it even has a UI slider for setting the zoom limit).