You are viewing a potentially older version of this package. View all versions.
Kirshoo-RunConfigAPI-1.0.0 icon

RunConfigAPI

Interface to set seeds and biome information of various parts of the game

By Kirshoo
Date uploaded 2 weeks ago
Version 1.0.0
Download link Kirshoo-RunConfigAPI-1.0.0.zip
Downloads 203
Dependency string Kirshoo-RunConfigAPI-1.0.0

This mod requires the following mods to function

BepInEx-BepInExPack_PEAK-5.4.2403 icon
BepInEx-BepInExPack_PEAK

BepInEx pack for PEAK. Preconfigured and ready to use.

Preferred version: 5.4.2403

README

RunConfigAPI

RunConfigAPI is build to simplify programmatic setting of various settings that influence the run. Currently supporting loot seed as well as terrain seed and biomes.

This is a library so will not do anything on its own.

Usage

Adding RunConfigAPI as a reference/dependency in Visual Studio

To add RunConfigAPI as a reference to the project to have Intellisense and interface definitions, you have to install the mod and copy the .dll file into a folder where your plan to develop your mod in. It should look something like $YourModDevFolder/dependencies/dev.kirsho.RunConfigAPI.dll. Then add this .dll as project reference (you might need to browse to find the .dll file).

To make sure everything works correctly, your .csproj file will have the following lines:

<ItemGroup>
	<Reference Include="dev.kirsho.RunConfigAPI">
		<HintPath>..\..\dependencies\dev.kirsho.RunConfigAPI.dll</HintPath>
	</Reference>
</ItemGroup>

Setting RunConfig from server

If a remote server wants to set config settings for the users, they only need to add RunConfigAPI as a dependency!

Example implementation for such mod:

using RunConfigAPI;

namespace ExampleMod.Patches
{

[HarmonyPatch(typeof(BoardingPass), nameof(BoardingPass.StartGame))]
internal class SetRunConfigOnRunStart
{
	private static void Prefix()
	{
		var serverSideConfig = FetchDataFromServer();
		// Convert any server side structure to a common RunConfig class
		// which API uses to communicate with implementations
		RunConfig config = ConvertToRunConfig(serverSideConfig);

		RunCapabilityApplier.Apply(config);
		// If capability mods are installed, they will be called with the specified
		// config and set the appropriate values
	}
}

}

Exposing Capabilities

Any mods that want to expose their configuration capabilities to RunConfigAPI must implement interfaces that provided with this library and register themselves in the CapabilityRegistry.

Note: if Plugin class implements interfaces, they could be automatically discovered by the API and dont need to register.

Example implementation for one of the interfaces:

// You need to add RunConfigAPI dll as a dependency to the project
// if you want to get Intellisense and Interface definitions
using RunConfigAPI.Capabilities;

namespace ExampleMod
{

internal class RunConfigLogger : IApplyLifecycle
{
	// Will be called after all configurations are applied
	// and will the seed for the run
	public void AfterApply(RunConfig config)
	{
		Plugin.Log.LogInfo($"Final run seed: {config.Seed}");
	}
}

}

// Then, in Plugin.cs

using RunConfigAPI;

namespace ExampleMod
{

[BepInDependency("dev.kirsho.RunConfigAPI", BepInDependency.DependencyFlags.HardDependency)]
[BepInAutoPlugin]
public partial class Plugin : BaseUnityPlugin
{
	// ...
	internal static RunConfigLogger configLogger;
	// ...

	private void Awake()
	{
		// some other stuff here...

		configLogger = new RunConfigLogger();
		// First parameter is unique string to avoid collisions
		// as otherwise capabilities will be overwritten
		CapabilityRegistry.Register(Plugin.Info.Metadata.GUID, configLogger);

		// the rest there...
	}
}

}

Example implementation inside Plugin class:

using RunConfigAPI;

[BepInDependency("dev.kirsho.RunConfigAPI", BepInDependency.DependencyFlags.HardDependency)]
[BepInAutoPlugin]
public partial class Plugin : BaseUnityPlugin, IApplyLifecycle
{
	// ...
	// no extra fields needed

	private void Awake()
	{
		// no need to register it yourself as API will register it on its own
		// since the Plugin class implements the interface
	}

	public void BeforeApply(RunConfig config)
	{
		// Override seed before it gets set
		config.Seed = 512;
	}
}

Support and Suggestions

If you have any questions or suggestions, feel free to ping me (@kirsho) in modding community discord server!

CHANGELOG

Changelog

[1.0.0] 10/04/2026 Thunderstore Release

Added

  • README with Usage section for mod developers
  • RunCapabilityApplier helper
  • IApplyLifecycle capability with coordination functions that are called Before or After the application of config

Changed

  • 'Capability' namespace is renamed to 'Capabilities'