OpenShot
Core API for Lucky Shot modding: diegetic MODS menu, fluent ModMenu API, MainMenu cards, GameEvents, Audio/Input/Save APIs.
About this mod Author’s original text
OpenShot Library
OpenShot is a core library and API for modding Lucky Shot. It provides shared tools and events so mods stay cleaner and conflict-free.
Features for Players
- MODS main-menu card: Shoot the in-world MODS card on the main menu to configure installed mods (same diegetic style as COLLECTIONS / TRIALS).
- Developer Console (~): Built-in command console (e.g. help).
Features for Developers
- MainMenu API: Add or adapt shootable main-menu cards (MainMenu.AddButton, SetLabel, Hide, OnShot, WhenReady).
- ModMenu hub: Fluent tabs with toggles, bools, sliders, ints, enums, buttons, and info lines (auto-grows / scrolls).
- GameEvents: Subscribe to OnTargetSpawned, OnShotFired, OnShopTryBuy, OnAmmoDisplayUpdated, and more without writing your own Harmony patches.
- AudioAPI: Play.wav.ogg from disk via AudioAPI.PlaySound().
- InputAPI: Register keybinds without cluttering Update().
- Bullet & Asset Registry: Register custom bullets/prefabs with unique string IDs.
- SaveAPI: Persist custom JSON across sessions.
Installation
- Install BepInEx.
- Extract OpenShot.dll into BepInEx/plugins.
- Start the game.
Developer Setup
Add OpenShot.dll as a project reference and declare the dependency:
using BepInEx;
using OpenShot; // OpenShotApi.Guid
[BepInDependency(OpenShotApi.Guid, BepInDependency.DependencyFlags.HardDependency)]
[BepInPlugin("com.you.mymod", "My Mod", "1.0.0")]
public class MyModPlugin: BaseUnityPlugin { }
Soft dependency: use SoftDependency and wrap UI registration in OpenShotApi.Try(...) or check OpenShotApi.IsLoaded.
Main-menu buttons (diegetic)
using OpenShot.UI;
MainMenu.AddButton("MY MOD", () => { / shot / });
MainMenu.SetLabel("COLLECTIONS", "SAMMLUNG");
MainMenu.Hide("TRIALS");
MainMenu.OnShot("STATS", hit => false); // false = also run original
MainMenu.WhenReady(() => {
// menu cards are in the world now
});
Mod settings (MODS hub)
Fluent API. The panel grows with options and scrolls when a tab is tall.
Float / Int without min/max read AcceptableValueRange from the config bind.
using BepInEx.Configuration;
using OpenShot.UI;
ModMenu.Tab("MyMod").Toggle(enabledConfig) // master Enabled row.Info("— Shop —").Bool("Weaker Shop", weakerShop) // labeled ON/OFF.Slider("Cost Mult", shopMult, 0.05f) // range from ConfigDescription.Int("Extra Targets", extraTargets) // range from ConfigDescription.Enum("Mode", modeConfig).Button("Reset", () => ResetDefaults());
Legacy RegisterTab / RegisterToggle / RegisterFloatSetting still work.
[OpenShotMenuTab("MyMod")] on a static method still registers a hub tab name.
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
- For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
- Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.
Install locations vary a lot between mods — the bundled readme is the most reliable guide.
Install these first, or the mod will not work: