Skip to content

Autoload Scripts

Ryhon edited this page Dec 31, 2024 · 3 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!")

To modify the functionality of existing scripts, see Overriding Classes