Skip to content

Mod Manager API

Note

This page is intended for programmers with knowledge in C#.

As of ff16.utility.modloader 1.1.3, a modding interface/API is now exposed.

This API can be leveraged to create file mods through your own C# code.

Setting Up

  1. Setup a development environment for Reloaded-II mods.
  2. Create a New Project using the Reloaded II Mod template.
  3. Add the ff16.utility.modloader.Interfaces NuGet package to your project.
  4. Add ff16.utility.modloader to ModDependencies in ModConfig.json.

Usage

Refer to the Dependencies Consumption documentation to understand the concept behind shared libraries.

In your mod's constructor, grab a reference to IFF16ModPackManager:

// Fetch IFF16ModPackManager to add files
_modLoader.GetController<IFF16ModPackManager>()?.TryGetTarget(out IFF16ModPackManager modPackManager!);

// Adding a new modded file
modPackManager.AddModdedFile(_modConfig.ModId, "path to mod's data directory", "path to file");

// Removing a modded file
if (modPackManager.RemoveModdedFile("path to file"))
{
    // File was removed
}

Changes will be applied to pack files once the mod loader has loaded all other mods, including yours.