Example Valheim mod built with Jötunn. Most of our Tutorials refer to this examples.
How to setup the development enviroment for this project.
- Install Visual Studio 2022 and add the C# workload.
- Download this package: BepInEx pack for Valheim
- Unpack and copy the contents of
BepInExPack_Valheim
into your Valheim root folder. You should now see a new folder called<ValheimDir>\unstripped_corlib
and more additional stuff. - Clone this repository using git.
- Open the Solution file
<JotunnModExample>\JotunnModExample.sln
and build the project
A new environment file Environment.props
can be created in the projects base path <JotunnModExample>
.
Make sure you are not in any subfolder.
Paste this snippet and change the paths accordingly.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Valheim install folder. This is normally found automatically, uncomment to overwrite it. Needs to be your path to the base Valheim folder. -->
<!-- <VALHEIM_INSTALL>X:\PathToYourSteamLibary\steamapps\common\Valheim</VALHEIM_INSTALL>-->
<!-- This is the folder where your build gets copied to when using the post-build automations -->
<MOD_DEPLOYPATH>$(VALHEIM_INSTALL)\BepInEx\plugins</MOD_DEPLOYPATH>
</PropertyGroup>
</Project>
To open the embedded Unity project you first have to copy all game dlls starting with assembly_
found at <Valheim>\valheim_Data\Managed
to <JotunnModExample>\JotunnUnityExample\Assets\Assemblies
. Copy these before you open the project and only copy them using the explorer.