ConfigurableCompany
A robust and powerful API for configuration handling and synchronization in real time. Create file-dependant configurations that can be changed while in game by the players. (The developer MUST implem
Screenshots 2 screenshots
About this mod Author’s original text
Configurable Company
Configurable Company provides an enhanced experience for both players and developers adding an in-game menu where you can change you gameplay settings.
WARNING
This plugin does not add content on it's own, it's an API.
If you want content alongside it install Lethal Company Variables.
| Player information | Developer guide |
| ----------------------------------- | ----------------------------------- |
Player information
How to open
To open the menu you must go into the HOST panel. There you will be able to see a button at the top-left of the screen. Clicking it will open the menu.
Using the in-game menu allows you to set a specific setting for your current file, you can have your first save with x10 enemy spawning and your second one with x0 enemy spawning.
If you need detalied information about how to use the menu you should Check the wiki page
Developer guide
INFO
If you want an easy-to-read guide I recommend you looking Lethal comapny modding wiki for configurable company. However you can also check the wiki or the mod's github page.
This API will allow you as a developer to add configurations to the game easily. These configurations will be displayed in an in-game menu where the user will be able to change them.
Configurations will change automatically so I suggest you listen to changes with events if you need the value automatically updated.
How to create configurations
public static CConfig FloatConfiguration = new CConfigBuilder()
{
Category = MyPluginCategories.Normal,
ID = "my-mod-id_configuration_float-configuration",
Name = "Does something",
Tooltip = "This is my cool description of the configuration",
Value = 69.420f
};
And you can get the value easily too:
int intValue = FloatConfigurationGet();
float floatValue = FloatConfigurationGet();
float floatValueWithDefault = FloatConfigurationGet(10f);
You can even use BepInEx configurations:
CConfig myConfig = ConfigAPI.ConfigFromBepInEx(config);
Listening to events
The API includes a lot of events you can access and listen to. If you want to see the full list, navigate to the wiki section about events.
Here is an example on how you could listen to configuration changes:
First we need to register the listener (you might want to do this when your plugin starts)
CEvents.ConfigEvents.ChangeConfig.AddListener(MyListenerMethod);
Now we need the method to execute
public static void MyListenerMethod(CEventChangeConfig myEvent) {
CConfig changedConfig = myEvent.Config;
ChangeReason reason = myEvent.Reason;
bool succeeded = myEvent.Success;
bool converted = myEvent.Converted;
object oldValue = myEvent.OldValue;
object requestedValue = myEvent.RequestedValue;
object newValue = myEvent.NewValue;
// Here you can do whatever you need with the information
if (myEvent.Success) {
// Configuration changed correctly
}
}
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: