This solution and projects are based on the Valheim mod stub project from Jötunn Please see Jötunn Docs detailed documentation and setup.
- SleepWell
- OsxModManager (Not a C# project, it just lives here as well. Needs manual packaging)
- MetadataCreator (Supporting project)
- OmnivoreCommon (Supporting project)
- Cheezus
- LlamaVillagers
Included in this repo is a PowerShell script publish.ps1.
The script is referenced in the project file as a post-build event.
Depending on the chosen configuration in Visual Studio the script executes the following actions.
The compiled dll and a dll.mdb debug file are copied to <ValheimDir>\BepInEx\plugins (or the path set in MOD_DEPLOYPATH).
A compressed file with the binaries is created in <JotunnModStub>\Packagesready for upload to ThunderStore.
New Assets can be created with Unity and imported into Valheim using the mod.
See the Wiki page Debugging Plugins via IDE for more information
When Valheim updates it is likely that parts of the assembly files change. If this is the case, the references to the assembly files must be renewed in Visual Studio and Unity.
- There is a file called DoPrebuild.props included in the solution. When you set the ExecutePrebuild value to true, Jötunn will automatically generate publicized assemblies for you. Otherwise you have to do this step manually.
- Copy all
assembly_*.dllfrom<ValheimDir>\valheim_Data\Managedinto<JotunnModStub>\JotunnModUnity\Assets\Assemblies.
Do this directly in the filesystem - don't import the dlls in Unity. - Go to Unity Editor and press
Ctrl+R. This reloads all files from the filesystem and "re-imports" the copied dlls into the project.
To deploy output to local valheim for testing and debugging, add an Environment.props file into the root of the project with the following content:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MOD_DEPLOYPATH>C:\PATH\TO\BepInEx\plugins</MOD_DEPLOYPATH>
</PropertyGroup>
</Project>