Developing Your Mod - Monster-Train-2-Modding-Group/Trainworks-Reloaded GitHub Wiki
Congrats you have just developed your first mod. Let's talk about the structure of mods for Monster Train 2.
Mods contain:
-
Code β
.cs(CSharp) files which are built into a.dll -
Game Data β
.jsonfiles which get loaded by the framework. The.jsonmay reference things defined in your Code. -
Assets β images and textures referenced by the
.jsonfiles.
-
If you edit any
.csfile β recompile the mod with:dotnet build -c Release --output ./distor simply Building if you are using Visual Studio. -
If you add/remove
.jsonfiles β update theAddMergedJsonFilefunction call inPlugin.cs, then rebuild. -
If you edit
.jsonor images only β rebuild not required just copy the modified files to theBepinEx/pluginsfolder for testing.
In Codespaces:
-
Press
Ctrl+Shift+Gto open Source Control. -
Commit and push your changes.
-
Make sure your mod builds successfully before committing.
When building locally with Visual Studio:
-
Use a Git client, like TortoiseGit or Git Bash
-
Make sure your mod builds successfully before pushing your code to GitHub.
In Codespaces, zip and download your build:
zip dist.zip -r dist
Download dist.zip from your codespace.
Extract dist.zip into your local BepInEx/plugins folder.
π« Donβt commit the zip file to GitHub.
Continue onto Modding Tools