Skip to content

Handling configuration updates by the player

github-actions[bot] edited this page May 29, 2026 · 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.

Up next: Wrapping Up >

Clone this wiki locally