- Clone the repository (https or ssh clone in Github)
- Open the project in your preferred IDE (Visual Studio, Visual Studio Code, etc)
- Rename all occurences of
MEGABONK_SIMPLE_MODwith your mods name. (including file names) - Edit the project description in the
.slnfile (MEGABONK_SIMPLE_MOD.slninitially) - Download the preferred BepInEx version from https://builds.bepinex.dev/projects/bepinex_be (Version #733, BepInEx Unity (IL2CPP) for Windows (x64) games)
- From within the ZIP file copy the following files to the projects
Libsfolder (these are a example set, you might need additional ones depending on your mod and development):
\BepInEx\core\0Harmony.dll\BepInEx\core\BepInEx.Core.dll\BepInEx\core\BepInEx.Unity.IL2CPP.dll\BepInEx\core\Il2CppInterop.Runtime.dll
- Open
Plugin.csand replaceAUHTOR_NAMEwith your preferred user/team name
At this point you should have a project that you can build to a BepInEx mod plugin. How you build the project differs a bit based on your preferred IDE and/or build tools.
With Visual Studio Code you can use the .NET Install Tool to build the project: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscode-dotnet-runtime. Please ensure you've installed .NET 6 SDK before trying to build https://dotnet.microsoft.com/en-us/download/dotnet/6.0
When you've installed both you should be able to build the project by pressing CTRL+SHIFT+P and selecting the .NET: Build command. After a while you should have a MEGABONK_SIMPLE_MOD.dll (file name depends on your renamed project) in obj\Debug\net6.0\.
For other IDEs and build tools you can Google how to build your project.
Next you'll want to either setup Thunderstore Mod Manager, R2modman or manual setup of BepInEx
Go through "Packaging for Thunderstore" before continuing with this.
Welcome back! Now that you've got your Thunderstore package; you can locally install it by:
- Open up Thunderstore Mod Manager or R2modman
- Select the game and a profile
- Go to Settings -> Profile -> Import local mod -> Select file
- Select the mod package you've made
- Check that the information is correct and click
Import local mod - Start the game through the mod manager
If you want update your mod while developing, you can replace the .dll in your profile after rebuilding your project. You can find the .dll at Settings -> Locations -> Browse profile folder -> BepInEx -> Plugins -> YOUR_PACKAGE
- Open the above mentione BepInEx ZIP again and copy the contents of that ZIP into the games root directory (Steam default installation is
C:\Program Files (x86)\Steam\steamapps\common\Megabonk) - Run the game once and then close it, so that BepInEx can properly set it self up.
- Take your built mod plugin at
obj\Debug\net6.0\MEGABONK_SIMPLE_MOD.dlland copy it to theC:\Program Files (x86)\Steam\steamapps\common\Megabonk\BepInEx\pluginsfolder. - Start the game
C:\Program Files (x86)\Steam\steamapps\common\Megabonk\Megabonk.exeor through Steam. Be aware that starting the game through Steam keeps the leaderboard enabled, sometimes you might not want this.
When you develop your mod and want to "refresh" to currently used code; you can rebuild the project and replace .dll in C:\Program Files (x86)\Steam\steamapps\common\Megabonk\BepInEx\plugins folder.
Packaging for Thunderstore is simple, but there few steps that you have to carefully go through.
Here's a list of resources for help:
- https://thunderstore.io/c/megabonk/create/docs/
- https://thunderstore.io/tools/markdown-preview/
- https://thunderstore.io/tools/manifest-v1-validator/
To package do the following;
- Copy your mod
.dllatobj\Debug\net6.0\MEGABONK_SIMPLE_MOD.dll(file name depends on the project renaming) into to thethunderstore_packagingfolder. - Open the
manifest.jsonand correct the information accordingly. (name,version_number,website_url,descriptionanddependencies)
website_urlis not mandatory, but very much preferred so that people can go check your codedependenciesshould usually always haveBepInEx-BepInExPack_IL2CPP-6.0.733in it. Add more dependencies if your package depends on another package.
- Replace the
thunderstore_packaging\icon.pngimage with your preferred package image. The dimensions should be 256x256 pixels,.pngformat and preferrably under 20KB in size. - Edit the
thunderstore_packaging\README.mdfile to your liking, this will be shown as the package details in Thunderstore. - Take the contents of the
thunderstore_packagingfolderMEGABONK_SIMPLE_MOD.dll,icon.png,manifest.jsonandREADME.md; and put them into a ZIP file. (on windows select the files, right click one and choose Compress to... -> ZIP file) - Rename the ZIP file in to the following format;
THUNDERSTORE_TEAM_NAME-PACKAGE_NAME-VERSION_NUMBERe.g.Oksamies-MEGABONK_SIMPLE_MOD-0.1.0
Now you have a Thunderstore mod package
Simple stuff;
- Log into Thunderstore (website)
- Go create a team that is named just like your ZIP files begining (the
THUNDERSTORE_TEAM_NAMEyou replaced), at https://thunderstore.io/settings/teams/ - Go to https://thunderstore.io/package/create/
- Drag and drop the ZIP file into the the field that says "Choose or drag file here"
- Select the team you want to upload the package under (same as in the ZIP files name)
- Select the community (Megabonk)
- Select categories accordingly
- If the package contains NSFW stuff, check the checkbox
- Submit and wait for the package to be submitted
Essentially this is the same as Packaging for Thunderstore and Uploading to Thunderstore, but you need to increment the versions everywhere. The locations to update the versions should be Plugin.cs(if you have defined it there. Remember to rebuild the dll after), thunderstore_packaging\manifest.jsonand the .csproj of your project.
Then just upload the package as you would upload a new package and the new version will be uploaded.