Setting up a mod project
Create the project
WARNING
Please make sure you did all the required steps in Prerequisites.
Use the repository template
Open the Mycopunk mod template, select Use this template, and create a repository for your mod. Clone the new repository and open its solution in Rider or Visual Studio.
You can also download the template without creating a GitHub repository, but using the template button gives your mod its own Git history and repository.
Configure the project
Open the .csproj file and change these values:
- Set
AssemblyNameto the name of your mod. - Set
RootNamespaceto the namespace you want to use, then update the namespace inPlugin.csto match. - Check
GameVersionand update it when targeting a different game version.
The template targets netstandard2.1. Keep that target unless the template or the modding community documents a required change.
The local build also needs a reference to the game's Assembly-CSharp.dll. Find the commented Reference block near the bottom of the .csproj file, uncomment it, and set HintPath:
<Reference Include="Assembly-CSharp" Publicize="true">
<HintPath>C:\path\to\Mycopunk\Mycopunk_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>Replace the example with the actual path inside your Mycopunk installation. If Steam is installed in its default location, the file is usually under steamapps/common/Mycopunk/Mycopunk_Data/Managed/.
WARNING
Do not copy game assemblies into your repository or include them in a release. Reference the files from your own game installation.
The project is now ready to build. Continue to Your First Working Plugin to compile the template, install the DLL, and confirm that BepInEx loads it.