U-1F31A / BepInEx_Valheim_Full

3 stars 1 forks source link

The game won't start modded #1

Closed Clayrok closed 3 years ago

Clayrok commented 3 years ago

Hi, I installed BepInEx Full through r2modman but when the plugin is active the game won't start modded. It generates a log in the game folder :

System.ArgumentException: An item with the same key has already been added. Key: [2.0.0.0, 0Harmony20] at System.Collections.Generic.TreeSet1[T].AddIfNotPresent (T item) [0x0001a] in <ef151b6abb5d474cb2c1cb8906a8b5a4>:0 at System.Collections.Generic.SortedSet1[T].Add (T item) [0x00000] in :0 at System.Collections.Generic.SortedDictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00020] in :0 at HarmonyXInterop.HarmonyInterop.Initialize (System.String cachePath) [0x0006d] in :0 at BepInEx.Preloader.RuntimeFixes.HarmonyInteropFix.Apply () [0x00005] in <704ac38fc3574f5daa8b2f1eee050c04>:0 at BepInEx.Preloader.Preloader.Run () [0x00005] in <704ac38fc3574f5daa8b2f1eee050c04>:0

I have the other version of BepInEx installed (BepInEx_Pack_Valheim), could it be the problem? Cause if I uninstall BepInEx_Pack_Valheim I won't be able to install other mods as they need this one.

Thanks.

sebastienvercammen commented 3 years ago

Hey @Clayrok

First off, you're correct: r2modman currently doesn't support BepInEx_Valheim_Full, so when a plugin requires it it'll wrongly try to add it to your BepInExPack (the old one) plugins.

For obvious reasons, that doesn't work.

So here's what's going on at the moment:

  1. I'm writing an auto-installer for BepInEx_Valheim_Full for Windows and Linux (both client + server) that solves all these issues, even without r2modman support (and it'll magically be supported in r2modman, you'll see once we publish in a day or two)
  2. Ebkr, the author of r2modman, is working to add support for BepInEx_Valheim_Full

Until you get access to any of these automated methods, you can still make it work by doing the following:

Note: When using r2modman, use your profile folder, not the game folder. It installs things to a different location.

  1. Manually download BepInEx_Valheim_Full and extract the BepInEx files inside it (the ones inside the BepInEx_Valheim_Full folder) into your game folder (for r2modman, extract to your profile folder), overwriting the old BepInExPack in the process
  2. When using r2modman for plugins that require BepInEx_Valheim_Full, remember to delete the wrongly installed BepInEx_Valheim_Full from your BepInEx\plugins\ folder
  3. When r2modman updates itself or a plugin, manually check if it re-added the old BepInExPack or the wrongly placed BepInEx_Valheim_Full (in BepInEx/plugins/), and correct it if necessary

With these steps, you'll:

It's not ideal, but it works for now. And in a couple of days it'll be implemented properly and run automatically. \o/

Does that help?

PS: In case of doubt or major errors, you can always delete winhttp.dll to disable BepInEx and "Verify integrity of game files" in Steam to get a clean game (the unused/disabled BepInEx folder will remain, that's OK), then follow the steps.

Clayrok commented 3 years ago

Thanks a lot, that's perfect! That helps a lot!

sebastienvercammen commented 3 years ago

If there is still an active issue, let me know and I'll re-open.

The auto-installer/-updater has since been released: https://valheim.thunderstore.io/package/1F31A/BepInEx_Valheim_Full_Updater/