aedenthorn / ValheimMods

Other
147 stars 104 forks source link

CraftingFilter: Breaks F5 console (multiple mods actually do this) #110

Open Jester2020 opened 5 months ago

Jester2020 commented 5 months ago

When the mod is active any command in the console errors. All mods you have that touch the console will break it. For example i also had to remove craft from containers and Container Lists. Most people have been blaming Server DevCommands but it works fine.

walterst commented 5 months ago

This is the console error that I get when typing devcommands (looks like the same issue, but I'm using Movable Inventory Windows, Custom Toolbars Hotkeys, and Extended Player Inventory):

[Error : Unity Log] TypeLoadException: Failure has occurred while loading a type. Stack trace: (wrapper dynamic-method) Terminal.DMD(Terminal) Terminal.SendInput () (at :0) UnityEngine.Events.InvokableCall.Invoke () (at :0) UnityEngine.Events.UnityEvent1[T0].Invoke (T0 arg0) (at <ab14d35a27c043688812ae199c64b5aa>:0) GUIFramework.GuiInputField.onInputSubmit (System.String text) (at <1c0bbb94c86e42bb92d9376327e3b555>:0) UnityEngine.Events.InvokableCall1[T1].Invoke (T1 args0) (at :0) UnityEngine.Events.UnityEvent1[T0].Invoke (T0 arg0) (at <ab14d35a27c043688812ae199c64b5aa>:0) TMPro.TMP_InputField.SendOnSubmit () (at <99900a1f9e2a471c8b46c2c560e4eba9>:0) TMPro.TMP_InputField.OnUpdateSelected (UnityEngine.EventSystems.BaseEventData eventData) (at <99900a1f9e2a471c8b46c2c560e4eba9>:0) UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IUpdateSelectedHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at <a01fe238487248d39ba352ec152ec890>:0) UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction1[T1] functor) (at :0) UnityEngine.EventSystems.EventSystem:Update()

[Info : Unity Log] TMP_Input can't handle null eventData in curren package. Can be ignored atm though. Exception: Failure has occurred while loading a type.

langaan27 commented 5 months ago

i am getting same issue with custom audio and custom load screens. both mods seems to work, but they both break the command/console.

has anyone figured out a work around?

jairovsky commented 4 months ago

Guys, I was having the same problem while using DiscardInventoryItems. I managed to fix it by recompiling the mod with up to date dependencies. Didn't change a single line of code: https://github.com/jairovsky/mods-valheim/tree/master/valheim-discard-inventory-item

This solution most likely fixes #109 and #105 too.

x0rsw1tch commented 1 month ago

Guys, I was having the same problem while using DiscardInventoryItems. I managed to fix it by recompiling the mod with up to date dependencies. Didn't change a single line of code: https://github.com/jairovsky/mods-valheim/tree/master/valheim-discard-inventory-item

This solution most likely fixes #109 and #105 too.

Interesting. I cloned this repo, tried compiling RecipeCustomization using the instructions on your repo using dotnet build --configuration Release RecipeCustomization, and getting this error:

MSBuild version 17.7.6+77d58ec69 for .NET
  Determining projects to restore...
C:\Program Files\dotnet\sdk\7.0.410\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(92,5): error NE
TSDK1013: The TargetFramework value '' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/o
r TargetFrameworkVersion properties must be specified explicitly. [D:\Projects\ValheimMods\RecipeCustomization\RecipeCustomizatio
n.csproj]

Build FAILED.

C:\Program Files\dotnet\sdk\7.0.410\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(92,5): error NE
TSDK1013: The TargetFramework value '' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/o
r TargetFrameworkVersion properties must be specified explicitly. [D:\Projects\ValheimMods\RecipeCustomization\RecipeCustomizatio
n.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.29

Would it make sense to clone your repo, copy RecipeCustomization dir into that repo, then run the build. Would that work?

jairovsky commented 1 month ago

Hello!

I haven't touched on this in while, but what I remember is that I couldn't manage to make the build process work on my machine either. I'll give it another try later today.

...

Yep it makes sense. In fact it's exactly what I did with DiscardInventoryItems: copied the C# code into my repo to be able to compile it using my project structure.

x0rsw1tch commented 1 month ago

Nice, I'll give that a go this weekend, see what happens, thanks!

jairovsky commented 1 month ago

Hello again!

I managed to compile DiscardInventoryItem from this repo.

Below is the git diff of what I needed to change. You can save it to a file and do git apply on your machine if you wanna tinker with it.

git diff ```diff diff --git a/DiscardInventoryItem/DiscardInventoryItem.csproj b/DiscardInventoryItem/DiscardInventoryItem.csproj index 250eb8c..b194bf0 100644 --- a/DiscardInventoryItem/DiscardInventoryItem.csproj +++ b/DiscardInventoryItem/DiscardInventoryItem.csproj @@ -2,5 +2,5 @@ 1.0.0 - + \ No newline at end of file diff --git a/valheim.targets b/valheim.targets index be591b3..3e61245 100644 --- a/valheim.targets +++ b/valheim.targets @@ -6,7 +6,7 @@ net480 AnyCPU AnyCPU - + D:\Games\SteamLibrary\steamapps\common\Valheim false @@ -52,7 +52,7 @@ $(GamePath)\BepInEx $(GamePath)\valheim_Data\Managed - $(GamePath)\unstripped_corlib + $(ManagedDataPath) @@ -77,6 +77,14 @@ + + + False + $(ManagedDataPath)\gui_framework.dll + False + + + ```

So what do these changes mean: