Creating a Project
Creating a mod for YAPYAP is simple using the official BepInEx template. This guide covers installing the template, generating a project, and configuring it for development.
Installing
Section titled “Installing”.NET templates must be installed before they can be used. This means that when you install the template, it doesn’t create a new project for you, but you will get the ability to do that.
Once you have the template installed, you don’t need to install it again, through it’s a good idea to update it if there are updates.
See the BepInEx Template repository
From NuGet (Recommended)
Section titled “From NuGet (Recommended)”Install the template by running:
dotnet new install YAPYAP.BepInExTemplateManual Install
Section titled “Manual Install”If you’re contributing to the template or prefer manual installation:
- Clone or download this repository
- Open a terminal in the root of the project
- Run:
dotnet new install .To update:
dotnet new install . --forceTo uninstall:
dotnet new uninstall .Once installed, the template will be available as YAPYAP BepInEx Plugin with an alias yapyapmod.
Creating a New Mod
Section titled “Creating a New Mod”Run the following command in your YAPYAP modding directory:
dotnet new yapyapmod --name ModName --guid com.github.YourAccount.ModName --ts-team YourThunderstoreTeamThis will create a new folder called ModName with your mod’s project.
Project Structure
Section titled “Project Structure”This example demonstrates the structure of the project after using the template:
~/Workspace/YAPYAP$ dotnet new yapyapmod --name YAPYAPMod --guid com.github.YAPYAPModding --ts-team YAPYAPModdingThe template "YAPYAP BepInEx Plugin" was created successfully.
~/Workspace/YAPYAP$ cd YAPYAPMod/The file structure in YAPYAP/ should look like this:
- CHANGELOG.md
- Config.Build.user.props.template
- Directory.Build.props
- Directory.Build.targets
- icon.png
- LICENSE
- YAPYAPMod.sln
- README.md
Directorysrc
DirectoryYAPYAPMod
- YAPYAPMod.csproj
- Plugin.cs
- thunderstore.toml
Key points:
- Your mod code is in
./src/<project-name>/ Directory.Build.*files define shared build configuration<project-name>.slnis your project solution
The project is configured so that it’s easy to add new projects into your project solution. Even if you don’t need that, it’s good to follow this standard project structure.
Setting Up The Config File
Section titled “Setting Up The Config File”At the root of your new project you should see a file named Config.Build.user.props.template. This is a special file that is the template for the project’s user-specific config. Make a copy of this file and rename it Config.Build.user.props without the template part.
This file will copy your assembly files to a plugins directory and it can be used to configure your paths to the game files and BepInEx plugins directory if the defaults don’t work for you.
Thunderstore Packaging
Section titled “Thunderstore Packaging”This template comes with Thunderstore packaging built-in, using Thunderstore CLI, aka TCLI. You should configure the src/<project-name>/thunderstore.toml file for your mod, such as setting the description for your mod.
You can build Thunderstore packages by running:
dotnet build -c Release -target:PackTS -v dThe built package will be found at artifacts/thunderstore/.
You can also directly publish to Thunderstore by including -property:PublishTS=true in the command.
GitHub Actions Publishing
Section titled “GitHub Actions Publishing”Coming soon.