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¶
- Setup a development environment for Reloaded-II mods.
- Create a New Project using the Reloaded II Mod template.
- Add the
ff16.utility.modloader.Interfaces
NuGet package to your project. - Add
ff16.utility.modloader
toModDependencies
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.