-
Notifications
You must be signed in to change notification settings - Fork 0
Example Mods.md
ESTONlA edited this page May 25, 2026
·
1 revision
These examples are small patterns you can copy into your own mod and adjust.
Layout:
LoggerMod/
mod.txt
scripts/logger_mod/main.gd
mod.txt:
[mod]
id="logger_mod"
name="Logger Mod"
version="1.0.0"
author="You"
priority=0
[autoload]
LoggerMod="res://scripts/logger_mod/main.gd"scripts/logger_mod/main.gd:
extends Node
func _ready() -> void:
print("[LoggerMod] loaded")mod.txt:
[mod]
id="ready_hook_example"
name="Ready Hook Example"
version="1.0.0"
author="You"
priority=0
[autoload]
ReadyHookExample="res://scripts/ready_hook_example/main.gd"
[hooks]
res://scripts/menu.gd="_ready"main.gd:
extends Node
func _ready() -> void:
var modlib = Engine.get_meta("OrcmodLib")
if modlib._is_ready:
_install(modlib)
else:
modlib.frameworks_ready.connect(func(): _install(modlib))
func _install(modlib) -> void:
var id = modlib.hook("menu-_ready-post", Callable(self, "_after_menu_ready"))
if id == -1:
push_warning("Failed to register hook")
func _after_menu_ready() -> void:
print("[ReadyHookExample] menu ready finished")extends Node
func _ready() -> void:
var modlib = Engine.get_meta("OrcmodLib")
if modlib.has_mod("extra_maps", "1.1.0"):
print("Extra Maps compatibility enabled")
else:
print("Extra Maps not loaded or too old")mod.txt:
[mod]
id="replace_hook_example"
name="Replace Hook Example"
version="1.0.0"
author="You"
priority=0
[autoload]
ReplaceHookExample="res://scripts/replace_hook_example/main.gd"
[hooks]
res://scripts/player.gd="_process"main.gd:
extends Node
func _ready() -> void:
var modlib = Engine.get_meta("OrcmodLib")
modlib.frameworks_ready.connect(func():
modlib.hook("player-_process", Callable(self, "_replace_player_process"))
)
func _replace_player_process(delta: float) -> void:
var modlib = Engine.get_meta("OrcmodLib")
modlib.skip_super()
# Custom process behavior here.Use replace hooks carefully. They can break other mods that expect vanilla behavior.
Mod A:
extends Node
func _ready() -> void:
var modlib = Engine.get_meta("OrcmodLib")
modlib.register(modlib.Registry.RESOURCES, "mod_a.api", {
"version": "1.0.0",
"feature_enabled": true,
})Mod B:
extends Node
func _ready() -> void:
var modlib = Engine.get_meta("OrcmodLib")
var api = modlib.get_entry(modlib.Registry.RESOURCES, "mod_a.api")
if api is Dictionary and api.get("feature_enabled", false):
print("Mod A integration active")mod.txt:
[mod]
id="player_override_example"
name="Player Override Example"
version="1.0.0"
author="You"
priority=50
[script_overrides]
res://scripts/player.gd="res://scripts/player_override_example/player.gd"Use this only when a hook cannot express the change.
OrcKit developer wiki for Sir, We Have an Orc Problem Playtest mods. These pages document OrcKit 1.0.0.