-
-
Notifications
You must be signed in to change notification settings - Fork 2
Autoload Scripts
Ryhon edited this page Mar 11, 2026
·
4 revisions
Mod autoloads let you run scripts when the mod is loaded. They can be defined in the [autoload] section in mod.txt.
The value of a field must be a path to a script inhereting Node or a path to a PackedScene. The autoload will be added as a child of /root/ and it's name will be set to the field key.
Example autoload:
mod.txt:
[autoload]
MyModMain="res://MyMod/Main.gd"MyMod/Main.gd:
extends Node
func _ready():
print("Hello, World!")As of 0.5.0, mod defined autoloads may be created before the autoloads included in base game by adding a ! symbol to the start of the path, e.g.
[autoload]
MyModMain="!res://MyMod/Main.gd"To modify the functionality of existing scripts, see Overriding Classes