ILSpy Preview 3: https://github.com/icsharpcode/ILSpy/releases/latest
Unity Hub: https://unity3d.com/get-unity/download
Unity 2019.4.24f1: https://unity3d.com/unity/whats-new/2019.4.24
BepInExPack Valheim: https://valheim.thunderstore.io/package/denikson/BepInExPack_Valheim/
Steamworks API: https://github.com/rlabrecque/Steamworks.NET/releases
Download uTinyRipper_x64.zip and ILSpy_binaries_(version).zip. Extract both of these to their own folders.
Click the "Download Unity Hub" to get UnityHubSetup.exe.
Click on "Manual Download" to get denikson-BepInExPack_Valheim-(version).zip
You should have the following files and folders:
Install Unity Hub first, then go to the Unity 2019.4.24f1 page and click the "Install this version with Unity Hub." link.
Open uTinyRipper.exe and drag the Valheim Folder from Steam into it and export to your desired folder. uTinyRipper will create a new folder called "valheim" in the folder you chose, containing a new Unity project.
Open ILSpy.exe and set it to "C# 7.3 / VS 2017.7".
Select all Assemblies in the list if any, right click, and click Remove. Go to Valheim's Managed folder, and drag all the dlls starting with assembly_ into ILSpy's Assemblies list.
Go to "denikson-BepInExPack_Valheim\BepInExPack_Valheim\unstripped_corlib" and drag "mscorlib.dll" to the Assemblies list.
Select all assemblies starting with "assembly_", right click and click "Save Code". Save the "Solution.sln" to your "valheim\Assets\Scripts" folder. ILSpy will complain the target folder is not empty and that files will be overwritten, this is exactly what we want, so click Yes.
Now in Windows Explorer, go to the "valheim\Assets\Scripts" folder, and delete the "Solution.sln" file. Type ".1.cs" into the search bar and delete each result. For each assembly_ folder, go in and delete the "Properties" folder.
Open Unity Hub, click "Add", and select the "valheim" folder. Set the project's Unity Version to "2019.4.24f1", and open the project.
It will ask if you want to upgrade the Project, click "Confirm". Unity will take a while as it processes all the assets. If Unity says an API Update is Required, click "I Made a Backup. Go Ahead!"
After all this you should have a working Unity Project for valheim.
There will be several errors about Shaders and render passes, this is normal, and will be addressed under "Additional steps"
uTinyRipper does not handle shaders properly and will lead to several shader related errors, and invisible/pink objects.
There are some additional steps we should take to make the Unity project more usable.
Go to Edit -> Project Settings -> Graphics, find "Built-in Shader Settings" and set Deferred to "Built-in shader".
Go to Assets\Materials, select every material, and set the shader to "Standard" in the Inspector. This will make it so everything will be visible and textured.
In your Scripts folder, search for Heightmap.cs, open that and remove the [ExecuteInEditMode] annotation from the class. This prevents an infinite loop from occurring and permanently freezing the editor when you open a scene that has the behaviour enabled.
The Utils class throws an error upon loading Unity. To fix it, search for Utils.cs in your Scripts folder, open the file and go to the line with the ambiguous reference (Unitys Console shows the exact line of error). Change
System.IO.Compression.CompressionLevel.Fastest and save the file.
With your unity project open, double click on the Steamworks.NET .unitypackage file and wait for it to load but don't import yet otherwise you will get duplicate code.