Skip to content

GDScript API

GDPatch registers a GDScript autoload named GDPatch that can be used in your scripts. If you include a scene or script in your mod’s pack file, it will be loaded as a child of the autoload.

These are available under the GDPatch global in GDScript, or at /root/GDPatch in the scene tree. Be careful not to confuse it with the Lua patchers.

  • Arguments:
    • mod_id: string

Returns the node loaded by a specific mod ID, if it exists.

Example
var node = GDPatch.get_mod("example_mod")

Returns an array containing all loaded mod manifests. You can access the mod ID via the id field.

Example
var mods = GDPatch.get_mods()
print("Loaded mods: ", mods)
  • Arguments:
    • mod_id: string
    • section: string
    • option: string

Returns the value saved in the config file, or the default value specified in the manifest if set.

Example
var option = GDPatch.get_config_option("example_mod", "section_id", "option_id")
print(option)
  • Arguments:
    • mod_id: string
    • section: string
    • option: string
    • value: any

Saves the specified value to the config file, or removes it if value is null.

Example
var value = "meow"
GDPatch.set_config_option("example_mod", "section_id", "option_id", value)