-
Notifications
You must be signed in to change notification settings - Fork 0
Script Overrides.md
Script overrides replace a vanilla script path with a mod script path.
Use them when you need to change large parts of a script and hooks are not enough. Overrides are powerful, but they are more conflict-prone than hooks because only one final script can own a path.
[script_overrides]
res://scripts/vanilla_script.gd="res://scripts/my_mod/vanilla_script_override.gd"[script_extend] is also accepted:
[script_extend]
res://scripts/vanilla_script.gd="res://scripts/my_mod/extended_script.gd"Both sections are processed as pending script overrides.
Overrides are sorted by mod priority. Higher priority mods apply later, so they win if multiple mods target the same vanilla path.
Example:
Mod A priority 0 overrides res://scripts/player.gd
Mod B priority 50 overrides res://scripts/player.gd
Mod B wins.
Your replacement script should be compatible with everything that expects the original script.
Preserve:
- base class or expected inheritance behavior
- exported properties used by scenes
- public methods called by other scripts
- signal names and connection assumptions
- important lifecycle methods
If a vanilla scene expects fields that your override removed, the scene may load but fail later.
Start by copying only what you must change.
extends "res://scripts/player.gd"
func some_method() -> void:
# Custom behavior.
super.some_method()This pattern depends on the game's script structure and may not work for every target, but it is often safer than replacing everything.
OrcKit detects scripts that call take_over_path(...) or similar dynamic override behavior and prints timing warnings in Developer Mode.
Prefer declared overrides:
[script_overrides]
res://scripts/player.gd="res://scripts/my_mod/player_override.gd"Declared overrides are visible to the loader, participate in priority sorting, and show up in conflict reports.
When applying override scripts, OrcKit attempts some compatibility repairs:
- bodyless legacy syntax
-
toolto@tool -
onreadyto@onready -
exportto@export - old
base()calls tosuper
These are compatibility helpers. Do not rely on them as your normal authoring workflow.
In Developer Mode, OrcKit reports conflicting resource paths:
user://modloader_conflicts.txt
If two mods override the same path, the later-loaded mod wins.
Use hooks when:
- you only need to run before or after one method
- you only need to alter a return value
- you want better compatibility with other mods
- you do not need to replace exported fields or script-level structure
Use script overrides when:
- the vanilla method is too large to patch cleanly with hooks
- you need to change script-level state
- you need to replace several related methods together
- you are intentionally making a compatibility patch for another override
- Test with only your mod installed.
- Test with Developer Mode enabled and inspect conflicts.
- Test with common mods that target nearby systems.
- Confirm load priority behaves as intended.
- Confirm no required vanilla methods or fields were accidentally removed.
- Confirm scenes that use the script still instantiate correctly.
OrcKit developer wiki for Sir, We Have an Orc Problem Playtest mods. These pages document OrcKit 1.0.0.