-
Notifications
You must be signed in to change notification settings - Fork 44
Upcoming Features
This page cover features that are currently only on the develop branch.
When features here are merged into main and published in a release, their content will be moved to the proper location.
via PR #145
You can change various ModLoader options through Godot's own GUI. In mod_loader/options there's a file called options_current.tres. It has one exported variable, current_options. You can add a custom optionsresource to this file (by dragging and dropping the resource file into the box labelled "Current Options").

The directory called options_examples has various examples you can use, for different use cases. You can either use one of these examples, or create your own.

Note: ATOW, only 1 option is supported (enable_mods). This will change as the Options feature is developed further.
via: #142
Pass the entire object retrieved via get_mod_config to check if it's valid, ie. to check that no errors occurred when reading the data.
Requires the full config object, not just the data dictionary from get_mod_config().data.
is_mod_config_data_valid(config_obj)
func is_mod_config_data_valid(
# The full config object
config_obj: Dictionary
# True if valid, false otherwise
) -> boolExample:
var config_obj = ModLoader.get_mod_config("AuthorName-ModName")
var is_valid = ModLoader.is_mod_config_data_valid(config_obj)Saves a full dictionary object to a custom mod config file, overwriting any existing file and file contents. Creates the file if it doesn't already exist.
save_mod_config_dictionary(mod_id, key, value, update_config)
func save_mod_config_dictionary(
# Mod ID
mod_id: String,
# The full config dictionary
data: Dictionary,
# Value to assign to the key
value,
# If true, the config data held in memory will be updated too
update_config: bool = true
# True if saving succeeded, false on error
) -> boolExample:
var mod_id = "AuthorName-ModName"
var my_dictionary = {
"foo": "bar",
"number": 9
}
ModLoader.save_mod_config_dictionary(mod_id, my_dictionary )Saves a single setting to a custom mod config file, overwriting any existing file and file contents. Creates the file if it doesn't already exist.
save_mod_config_setting(mod_id, key, value, update_config)
func save_mod_config_setting(
# Mod ID
mod_id: String,
# Key to update
key:String,
# Value to assign to the key
value,
# If true, the config data held in memory will be updated too
update_config: bool = true
# True if saving succeeded, false on error
) -> boolExample:
var mod_id = "AuthorName-ModName"
var my_key = "foo"
var my_val = "bar"
ModLoader.save_mod_config_setting(mod_id, my_key, my_val)via: #143
There are 2 methods you can use to save data to a file:
save_string_to_file(save_string, filepath)
func save_string_to_file(
save_string: String,
filepath: String
) -> boolExample:
var my_string = "hello world"
ModLoader.save_string_to_file(my_string, "user://custom_1.txt")save_dictionary_to_file(data, filepath)
func save_dictionary_to_file(
data: Dictionary,
filepath: String
) -> boolExample:
var my_dictionary = {
"foo": "bar"
}
ModLoader.save_dictionary_to_file(my_dictionary, "user://custom_2.json")These features have been merged into main and released, but there's no documentation for them yet.
Warning
This documentation has moved!
You can find it here: https://wiki.godotmodding.com/
- Home
- Getting Started
- ModLoader API
- Reference
- Guides
- Versions & Releases