
You are viewing a potentially older version of this package. View Latest Version
SkongGamemodes
Library that allows you to make a new gamemode in a few lines of code.SkongGamemodes
A lightweight framework for creating custom gamemodes in HK: Silksong
Features
- Initialize multiple gamemodes with custom names, colors, and descriptions.
- Easily Initialized in just a few lines
Installation
- Download
SkongGamemodes.dll. - Add
SkongGamemodes.dllto your BepInExpluginsfolder alongside your main plugin DLL. - Reference it in your main mod project (Don't forget to add
using SkongGamemodes;). - When you publish your mod to Thunderstore, don't forget to add it as a dependency in
manifest.json, the custom modes won't load without it being inpluginsfolder
Usage
1. Initialize a game mode
using UnityEngine;
using SkongGamemodes;
public class MyPlugin : BaseUnityPlugin
{
private GameModeManager.GameModeData myMode;
private void Awake()
{
// Makes GameModeManager instance exists
if (GameModeManager.Instance == null)
{
new GameObject("GameModeManager").AddComponent<GameModeManager>();
}
myMode = GameModeManager.Instance.Init(
this,
"Bound Soul", // Mode Name
"Enable The Binder by Pressing H", // Description
new Color(0.941f, 0.780f, 0.255f, 0.8f) // UI Color
);
}
}
2. Accessing mode state
[HarmonyPatch(typeof(PlayerData), "TakeHealth")]
public static class Patch_GlassyBoy
{
[HarmonyPrefix]
public static void glAss(PlayerData __instance, ref int amount)
{
if (BoundSilkPlugin.glassBoundMode.Enabled) // if GlassBoundMode is enabled
{
amount = __instance.CurrentMaxHealth; // Die in one hit
}
}
}
3. Creating multiple modes
var steelBoundMode = GameModeManager.Instance.Init(
this,
"SteelBound Soul",
"Bound by Pantheon, Chained by Steel",
new Color(0.843f, 0.788f, 0.608f, 0.8f),
steel: true // if steel is enabled, this will make it based off steel soul mode instead of normal mode, which means steel soul exclusive stuff and permadeath being part of your gamemode
);
Notes
- Make sure your main plugin references this DLL and includes
using SkongGamemodes;. - Do not add multiple instances of
GameModeManager—it’s a singleton. - If you REALLY want your mod to be single-file with no dependencies get ILRepack and run
Path\To\ILRepack.exe /out:YourMod.dll YourMod.dll SkongGamemodes.dll /internalize
License
MIT License – feel free to use, modify, or integrate into other mods.