Entity manager/loader for modding Lost Branch of Legend. \
Made using Harmony and BepInEx.
Thunderstore is up!
Use r2modman
or
Download LBoL-Entity-Sideloader.zip and extract it in BepInEx/plugins
folder.
This modding framework attempts to streamline, simplify and standardize common game entity (Card, Enemy etc.) creation and loading.
The general idea is that the Sideloader provides abstract template types which should be extended and implemented concretely in your own plugin. Each abstract template method corresponds to one component of the game entity. For example, CardTemplate
expects LoadCardImages
to load CardImages, MakeConfig
to define CardConfig. Additionally, entity logic type should be written and marked with EntityLogic
attribute. In case of a card, entity logic will be extending a Card
type and defining its behavior in the same manner as a vanilla card would. That is, overriding Actions
adding custom triggers (reactors/handlers) and so on.
Sideloader has many convenience methods and types designed to reduce clutter and speed up development. Examples include ResourceLoader
, CardImages.AutoLoad
, GlobalLocalization
. It also provides thorough error feedback to help define templates correctly and feature to reload mods while the game is running.
- Visual Studio 2022(or any other IDE ofc) with .NET development package.
- Sideloader mod template. Has tons of configuration preset.
- dnSpyEx. For reading game's code and understanding how to code entity behavior.
- scriptengine. For hot reload. My fork has a bug fix for LBoL.
- DebugMode. For quickly building decks and fighting enemies.
tutorial and introduction to Sideloader
Writing entity templates can result in quite a bit of boilerplate. Custom template hierarchy can address this issue. Example project/template by rmrfmaxxc using class hierarchy to solve the issue. Also includes generic card examples.
- In
BepInEx/config/neo.lbol.frameworks.entitySideloader.cfg
changeDevMode = false
toDevMode = true
. - Download and put scriptengine to
plugins
folder. - Create
BepInEx/scripts
folder. This from where scriptengine will load the plugins. Sideloader mods which are being developed should go there. If Sideloader mod template is used it will copy dlls toscripts
folder automatically after building. - In-game, press F3 to reload the mods. If in-run level will need to be restarted for changes to take effects. By default, that will be done automatically. There might some odd issues with Collection.
Sometimes the game freezes and crashes at the moment of reloading plugins. This is probably related to pc resource usage.
Mini wiki detailing game entity and config specifics.
Suggestions, contributions, issues, bug reports/fixes and critique are all very welcome.
*Game Entity loading* |-- Create Cards ☑️ |-- Create custom Effects ☑️ |-- Workflow/templates for working with Effect prefabs in Unity |-- Create custom Guns (attack vfx) ☑️ (technically possible but very inconvenient to design) |-- PieceConfig ☑️ |-- BulletConfig ☑️ |-- LaserConfig ☑️ |-- whatever else.. |-- Create StatusEffects (Abilities) ☑️ |-- Create Exhibits ☑️ |-- Display modded Exhibits in Collection |-- Load custom SFX ☑️ |-- SfxConfig ☑️ |-- BgmConfig ☑️ |-- Create Enemies ☑️ |-- Load custom spine models ☑️ |-- UnitModelConfig ☑️ |-- Spine asset packaging helper in Unity Editor |-- Create Enemy groups (Battles) ☑️ |-- Add modded battles to stage encounter pools ☑️ |-- SpellCards ☑️ |-- Custom starting decks (if possible) ☑️ |-- Custom deck selection UI ☑️ |-- (New) Custom Stages ☑️ |-- Stage pooling ☑️ |-- *Playable characters at this point?* ☑️ |-- Inherent character mechanics ☑️ (it was here all along. Units can register reactors.) |-- Create GapOption |-- Load Yarn Spinner scripts [???](https://github.com/salyu9/YarnSpinner) |-- Create Adventures (Encounters) |-- Modded Adventure pooling system |-- Create JadeBox challenges ☑️ *Sideloader features and maintenance* |-- Better docs/tutorials/wikis.. |-- Support Localization ☑️ |-- Dynamic entity reload for development ☑️ |-- Overwrite or modify vanilla entities ☑️ |-- Overwrite individual entity components selectively ☑️ |-- Merge configs overwritten by different mods (maybe) |-- Make overwriting more convenient by introducing mass overwrite types ☑️ |-- Programmatic template generation ☑️ |-- Error feedback and handling ☑️ |-- Better error feedback and handling.. |-- Support loading from AssetBundles ☑️ |-- main/beta double branch support (maybe) |-- Handle duplicate entity Ids |-- Performance and profiling |-- async loading |-- Addressables |-- size reduction/compression |-- whatever else.. |-- Rewritting and refactoring Sideloader backend..
- Good Examples
- Vanilla Tweaks
- Gun
- Help Me Eirin (doesn't need Sideloader)
- Dayuu-Mod by Intoxicated Kid