DreWulff-ConfigHelper icon

ConfigHelper

Helper library with methods to standardize monster spawn configurations between my projects.

Last updated 2 weeks ago
Total downloads 2145
Total rating 0 
Categories Libraries BepInEx
Dependency string DreWulff-ConfigHelper-1.0.0
Dependants 4 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2304 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2304
Evaisa-LethalLib-1.2.0 icon
Evaisa-LethalLib

Personal modding tools for Lethal Company

Preferred version: 1.2.0

README

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<string, int> defaultWeights,
	out Dictionary<LevelTypes, int> vanillaRarities,
	out Dictionary<string, int> customRarities)

Parameters:

  • ConfigFile cfg:
    • Plugins that extend BepInEx's BaseUnityPlugin have a base definition of Config. This can be passed with base.Config.
  • Dictionary<string, int> defaultWeights:
    • Contains the key/value pair of moons and spawn weights.
    // Example:
    defaultWeights: new Dictionary<string, int>
    {
    	{"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<int> 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