Environment Setup (Windows)
A guide to setting up a Suzerain mod development environment on Windows.
This guide covers Windows-specific setup only. For the full mod development walkthrough including code examples, see Developing Mods. For Linux setup, see Environment Setup (Linux).
Setup
- Follow the Installing Mods guide to install MelonLoader and Suzerain Modding Kit.
- Install Visual Studio (Visual Studio, not Visual Studio Code).
- In the Visual Studio Installer, ensure you also install the ".NET desktop development" workload.
- Download the MelonLoader VS Wizard and run the
.vsixfile to install it as a Visual Studio extension. - Open Visual Studio and create a new project. Select "MelonLoader Mod" as the project template.
- Fill in the project info and create. Visual Studio will open a file selector, navigate to and select
Suzerain.exe.- The default install location is
C:\Program Files (x86)\Steam\steamapps\common\Suzerain\Suzerain.exe.
- The default install location is
- Open the
.csprojand add<Reference Include="SuzerainModdingKit"><HintPath>$(GamePath)\Mods\SuzerainModdingKit.dll</HintPath></Reference>where the other references are (usually in the firstItemGroup). - In Visual Studio, set the build platform to
x64.- Select Build > Configuration Manager.
- Open the active solution platform dropdown. If
x64is already there, skip the next step. Otherwise, continue. - Select new. Set the new platform to
x64, copy settings fromAny CPU, and enable "Create new project platforms." Select OK. - Set the active solution platform to
x64. - Under project contexts, open the platform dropdown. Select
x64. - Close the configuration manager.
- Use your
Debugconfiguration when building for development andReleasewhen building to publish.
- Recommended: Update
MelonInfo.- When creating the project, the auto generated
MelonInfowill look something like this:[assembly: MelonInfo(typeof(MyMod.Core), "MyMod", "1.0.0", "userprofilename", null)]. - Add spaces to the mod name (second argument) and change your user profile name (fourth argument) to your Nexus Mods account name.
- It should look like this now:
[assembly: MelonInfo(typeof(MyMod.Core), "My Mod", "1.0.0", "My User Name", null)].
- When creating the project, the auto generated
- Recommended: Set the
Coreclass tointernal sealed:internal sealed class Core : MelonMod.