Setting up your environment

  1. Get an IDE for c# (e.g. Visual Studio Community edition that comes installed with the unity editor)
  2. install BepInEx 5.x (x64) in your DFD game folder
  3. install the c# project templates for BepInEx from their wiki and setup a new BepInEx 5 project using that template in your IDE
  4. change the project's target framework to “netstandard2.1” (if you don’t have “netstandard2.1” capabilities, download this .net sdk version: LINK)
  5. reference DFD assemblies from the “Dungeon Full Dive\Dungeon Full Dive_Data\Managed\” folder (as well as any additional unity stuff you think you’ll need)

Integrating with DFD

Some of DFDs core features use type discovery to set up a couple things like engine entry points and network messages. To enable this for your project, put

[assembly:DFDAssembly]

at the top of any of your .cs files in your project. You only need this once.

Getting Started (the right way)

Unless you want to mod the main menu, you should not use the default MonoBehaviour Awake/Start/OnEnable methods to access anything that happens on a DFD map. BepInEx will spawn your plugin instance MonoBehaviour in the menu (or one of our setup scenes). You can instead get a static entry point for your mod using the

[Initialize(InitializationPhase)]

attribute by adding it to a static method that takes an IEngine parameter like this:

[Initialize(InitializationPhase.OnPostMapLoad), Priority(100)]
private static void OnMapLoaded(IEngine e)
{
    //do things here
}

Caution: When using this attribute in a class and another inherits from it, you should use the second optional [Initialize] attribute parameter and set it to false, unless you want this method to be called once for every inheriting type from that class.

Useful things

If you’re feeling adventurous (and don’t want to wait until we can take time to document this some more), write this in your IDE and see what your code completion brings up