Skip to content

Handling configuration updates by the player

Doink Oink edited this page Sep 11, 2025 · 4 revisions
func UpdateConfigProperties(_config: ConfigFile):
	print(_config.get_value("String", "testString"))

Whenever a player updates the configuration file from MCM the associated callback function passed to RegisterConfigruation will be called with the ConfigFile passed as a parameter. With the exception of Keycode type values you as the author must handle updating the properties your mod uses in conjunction with the config file. I would highly suggest looking to see how Road to Vostok uses the Gamedata.gd and Gamedata.tres, or even this mod with the MCM_Helper.gd and MCM_Helper.tres, scripts to store and access global variables across your other scripts.

I've included a small example on how to retrieve a value from a ConfigFile in the UpdateConfigProperties function. Again I highly recommend you looking at the documentation page for ConfigFile to get a better understanding on how to access the data stored in them.

Clone this wiki locally