-
Notifications
You must be signed in to change notification settings - Fork 5
Creating library mods
Custom libraries is an extremely powerful tool that can facilitate nearly any modification to Phantom Brigade. The game is powered by Unity/C# and reads IL (interpreted language) at runtime. The IL code is modifiable at runtime, which means that it's possible to patch game logic and execute new code from mods. This tutorial will cover the full process of creating a library mod, from setting up the project to building and exporting your mod.
The tutorial will additionally cover setting up a Git repository for your code. Any code project can benefit from version control, but a public repository also a mandatory requirement for any downloadable code mod under the Modding Guidelines.
We strongly recommend reading through the following articles before you begin:
- Mod projects
- Basics and Patching articles from the Harmony documentation
- If you're new to C# or haven't interacted with the Reflection feature before, check out Introduction to Reflection
You'll need an IDE software capable of creating and compiling solutions that are .NET 4.7.2 Class Libraries. We strongly recommend using JetBrains Rider (even if you're familiar with other IDEs). It's free for non-commercial use and features a built-in decompiler letting you explore C#/IL code in the Unity and Phantom Brigade assemblies, which is essential when developing mods.
This wiki is a work in progress. Please make sure to check the built-in tutorials within the SDK or the modding articles on the game wiki to supplement this page. If you get stuck or experience a bug, please don't hesitate to ask questions in the #phantom-modding channel of the official Discord server. We can't wait to see what you create!