Config variables allow mod users to configure certain variables of your mod outside of the game without any modding knowledge.
Note
Config variables are under-rated in modding, hopefully it gets more popular over time.
Enabling it is straightforward but can be easily missed as it's under the Advanced section of the variable settings.
All config variables can be set or overwritten by adding the mod's path as a header/section followed by the actual variables and their values.
Tip
Config variables will be overwritten at runtime with the one set in the config file, so make sure you implement additional logic to ensure the value doesn't go outside of the expected range.
Hover over the Config Variable checkbox for more info:
- Navigate to the game's
engine.ini
file which is located in:%localappdata%/<GameName>/saved/Config
- Open the file named
engine.ini
with a text editor and scroll to the bottom of it. - Add the specific pattern as is shown when hovering over the config variable checkbox.
Important
It's important to mention it for the mod users, so they know about it.
One of the most useful cases for it, which I constantly use is configurable hotkeys.
Allowing mod users to freely change and customize the keys to suit their keyboard layouts.
Other useful uses for config variables, but not limited to:
- Enabling certain features.
- Different decimal values like maxHealth.
- Widget related like togglable data to be displayed.
- Functionality limitation.