Skip to content

How develop mods using CommonAPI

kremnev8 edited this page Nov 20, 2021 · 1 revision

How develop mods using CommonAPI

All features are written as self-contained modules (Inspired by R2API):

  • By default NO modules are loaded.
  • To use a module at the top of your BepInEx plugin class add an attribute CommonAPISubmoduleDependency. That will ensure that specified modules are loaded.
  • Make sure you don't ask to load modules that you are not using.
  • Trying to use an unloaded module will result in a exception.

There also non module utility classes. They can be used freely. Most of them are custom data structures like pool, registry, etc.

How to setup development environment

  1. Download and install CommonAPI and its dependencies
  2. Create development environment. You can find how to do that here
  3. Add LDBTool, DSPModSave and CommonAPI assemblies to your references.
  4. You also likely will need a Unity Project. You can find instructions on setting that up here

Clone this wiki locally