-
Notifications
You must be signed in to change notification settings - Fork 0
Loader Lifecycle.md
This page explains what OrcKit does during startup. Understanding the lifecycle helps when debugging hooks, autoload timing, script overrides, and restart behavior.
- Godot loads
override.cfg. -
OrcLoader.gdis added as an autoload namedOrcKit. - OrcKit waits one process frame.
- OrcKit compiles its regex helpers.
- OrcKit discovers game scripts and class names.
- OrcKit loads Developer Mode and UI settings.
- OrcKit scans the
modsfolder. - The Mods UI appears.
- Enabled mods are mounted and processed.
- Hooks, overrides, and autoloads are prepared.
- OrcKit may restart the game for a second pass.
- The runtime API is registered as
Engine.get_meta("OrcmodLib"). -
frameworks_readyis emitted. - The current scene may be reloaded so mounted resources take effect.
Godot resource packs sometimes need to be mounted early to affect all resources consistently. OrcKit handles this with a restart pass.
Pass 1:
- scans mods
- shows the Mods UI
- writes selected archive state
- writes early autoloads into
override.cfg - generates a hook pack
- requests a restart with
--modloader-restart
Pass 2:
- mounts previously selected archives at file scope
- restores pending script overrides
- rescans mods
- applies overrides
- generates and mounts hook wrappers
- instantiates autoloads
- emits
frameworks_ready
OrcKit computes a state hash from:
- enabled archive paths
- archive modified times
- mod versions
- early autoload declarations
- script overrides
- loader version
- loader file modified time
If the hash has not changed, OrcKit can skip an unnecessary restart.
OrcKit registers:
Engine.set_meta("OrcmodLib", self)Mods access:
var modlib = Engine.get_meta("OrcmodLib")frameworks_ready means OrcKit has registered core hooks and the runtime facade is ready.
Register hooks after this signal:
if modlib._is_ready:
_install(modlib)
else:
modlib.frameworks_ready.connect(func(): _install(modlib))After mounting packs and instantiating autoloads, OrcKit may reload the current scene. This helps mounted resources and script rewrites take effect.
If your autoload stores state during startup, be aware that the current scene may reload after mods are applied.
OrcKit writes heartbeat and pass-state files while launching. If a crash happens during startup, crash recovery can reset to a cleaner state.
Advanced sentinel files beside the game executable:
modloader_safe_mode
modloader_disabled
Use these only for recovery or debugging.
OrcKit developer wiki for Sir, We Have an Orc Problem Playtest mods. These pages document OrcKit 1.0.0.