ConfigHelper
Helper library with methods to standardize monster spawn configurations between my projects.
About this mod Author’s original text
Configuration Helper
Small helper library to standardize the configuration of enemy/entity spawning.
Namespace is currently generic in case I add new configurations for other mods.
Functions
Entities (Enemies)
Spawning
The main function to generate the spawning configuration and retrieve the value for enemy registering is the following:
public static void GetRarities(
ConfigFile cfg,
Dictionary defaultWeights,
out Dictionary vanillaRarities,
out Dictionary customRarities)
Parameters:
- ConfigFile cfg:
- Plugins that extend BepInEx's BaseUnityPlugin have a base definition of Config. This can be passed with base.Config.
- Dictionary defaultWeights:
- Contains the key/value pair of moons and spawn weights.
// Example:
defaultWeights: new Dictionary
{
{"Vow", 20},
{"Halation", 10},
{"Junic", 15},
},
- The out parameters correspond to the required rarity parameters for LethalLib's Enemies.RegisterEnemy() function.
Reminder
LethalLib's configurations use the.Bind() method from the ConfigFile class. \
For configurations not supported by this library (practically all), follow the example:
public ConfigEntry damage;
public PluginConfig(ConfigFile cfg)
{
damage = cfg.Bind(
"Behaviour", // Section
"Barb Damage", // Title
20, // Default value
"Damage dealt" // Description
);
}
For a more in-depth example I recommend checking @Hamunii 's Example Enemy
Credits
- DreWulff (me!): Coding.
- Source code: LC-ConfigHelper on github
- Originally based off of the Configuration code from @Hamunii.
- Thanks to @Evaisa for LethalLib.
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.
Install these first, or the mod will not work: