Command channel

TheGates exposes a small command channel to the parent process via the scene tree. Use it to open other gates or external links from within your world.

Concept

Commands are sent through the root tree with send_command:
if get_tree().has_method("send_command"):
    get_tree().send_command(command_name, args_array)

API

open_gate

Open another world by URL.

Signature
get_tree().send_command("open_gate", [url: String])
Parameters
  • url: Absolute URL to a .gate file, e.g. https://example.com/world.gate

Behavior
  • Closes the active world and transitions to the requested gate.

Example
func on_portal_entered(_body: Node) -> void:
    if get_tree().has_method("send_command"):
        get_tree().send_command("open_gate", ["https://example.com/world.gate"])

Notes

  • Guard calls with has_method to keep worlds runnable outside TheGates.

  • Future commands may be added; ask us on Discord if you need something.

See also