Setting up the Mod Template
Last updated
Last updated
To make life a little bit easier, there is a Semi mod template that will help you start your modding adventure. This is a Visual Studio solution that includes the libraries and required boilerplate (setup). Don't let the name of the format confuse you if you are on Linux or MacOS - MonoDevelop uses Visual Studio solutions too.
Start off by entering the mod template page linked above.
Click the "Clone or download" dropdown, and then "Download ZIP"
(Note: If you want to use Git instead of GitHub's crappy zip download, you will most likely know what to do here - git clone https://github.com/modthegungeon/SemiModTemplate
should get you started; if you are just starting, ignore this.)
Unpack the .zip file to a safe place, then open SemiModTemplate.sln
in Visual Studio (on Windows) or MonoDevelop (on Linux and Mac).
[TODO: VS screenshots]
Note: If you're just starting out and are a beginner, you don't have to rename the solution name SemiModTemplate to anything custom - it doesn't actually matter ingame. However, if you do wish to rename it, check out this video to find out how to do it correctly.
The code is one thing, but explained in File Hierarchy and Metadata in the "Writing Mods" section, there is also a mod.yml
file that specifies miscellaneous details about your mod. In the Semi mod template, this file resides in the mod
folder. Enter the folder, then open mod.yml
in a text editor (do not use Notepad - use something like Notepad++ or Sublime Text). You will see something that looks like this:
Feel free to change the id
(it must be lowercase and can't have any spaces), name
, version
, author
and description
. Leave dll
as-is unless you know what you are doing. Definitely leave api_version
as-is.
Once you've done this, you can check if the mod is working by building the template in Visual Studio. There is an automatic action set up that will copy your final mod to the mod
folder (as mod.dll
), so all you need to do now is just copy the mod
folder to the SemiMods
directory in your Gungeon folder and rename it to be more descriptive of your mod. Create an empty SemiMods
folder if one doesn't already exist.
There is one last thing to keep in mind - Semi does not allow you to run mods that have not been approved by a trusted modder, and therefore it will most likely reject your newly-added mod. To prevent this, you have to tell Semi that you made that mod (and therefore trust it). You do that by adding your mod's ID to a file called MySemiMods.txt
located in the same folder as SemiMods
. If the file doesn't exist, create it. You can put one mod ID per line, and it will completely skip the verification stage for each specified mod. Do not put mods that you haven't made in there unless you have enough knowledge to verify them yourself - due to the nature of the mod loader mods can do anything from adding an item to deleting all of your personal files on your computer. The approval process exists for a reason, and nobody will feel bad for you if you work around it and end up falling into a trap.
You can try starting up Gungeon now. Once you see the main menu, check out the output log. You should see [ExampleMod] Hello world!
somewhere in there. Congratulations! You've just built and ran your first mod.