A Valheim mod project using Jotunn including build tools and a basic Unity project stub.
This repository is configured for GambleMod instead of the default template names.
Please see Jotunn Docs for detailed setup documentation.
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 <GambleMod>\Package ready for upload to Thunderstore.
Do not forget to include your information in the manifest.json and to update the project's README file.
New assets can be created with Unity and imported into Valheim using the mod.
A Unity project is included in this repository under <GambleModUnity>.
- Download Unity Hub directly from Unity or install it with the Visual Studio Installer via
Individual Components->Visual Studio Tools for Unity - You will need a Unity account to register your PC and get a free license. Create the account, log in through Unity Hub, and get your license via
Settings->License Management - Install Unity Editor version
2022.3.17f - Compile the project. This copies all assemblies into
<GambleModUnity>\Assets\Assemblies. Do not open Unity before this step or it will remove assembly references. - These assembly files are copyrighted material. To avoid committing them, keep the
.gitignorefile in the Unity project folder when cloning or copying this repository. - Open Unity Hub and add the
GambleModUnityproject - Open the project in Unity
- Install the
AssetBundle Browserpackage in the Unity Editor viaWindow->Package Managerfor easy bundle creation
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 that happens, the references to the assembly files must be renewed in Visual Studio and Unity.
- There is a file called
DoPrebuild.propsincluded in the solution. When you set its only value totrue, Jotunn will automatically generate publicized assemblies for you. Otherwise you must do this step manually.
- Copy all
assembly_*.dllfiles from<ValheimDir>\valheim_Data\Managedinto<GambleModUnity>\Assets\Assemblies. - Go to Unity Editor and press
Ctrl+R. This reloads all files from the filesystem and re-imports the copied dlls into the project.