A Valheim mod stub project using Jötunn including build tools and a basic Unity project stub. There is no actual plugin content included, just a minimum plugin class.
Please see Jötunn Docs detailed documentation and setup.
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>\Packages
ready for upload to ThunderStore.
Dont forget to include your information in the manifest.json and to change 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 <JotunnModStub>\JotunnModUnity
.
Individual Components
-> Visual Studio Tools for Unity
Settings
-> Licence Management
<JotunnModStub>\JotunnModUnity\Assets\Assemblies
. Don't open Unity yet before this step, it will remove assembly references.AssetBundle Browser
package in the Unity Editor via Window
-> Package Manager
for easy bundle creationSee 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.
assembly_*.dll
from <ValheimDir>\valheim_Data\Managed
into <JotunnModStub>\JotunnModUnity\Assets\Assemblies
. Ctrl+R
. This reloads all files from the filesystem and "re-imports" the copied dlls into the project.