Gessa Docs
Creator · Visual Scripting

Guide

Visual Scripting Events

Custom events are typed room-local messages routed by Runtime. They are the right tool when one script needs to notify another script about gameplay that already happened, such as a pickup collected, a hit applied, or a timer phase entered.
engine v1.0.234Copy for LLM

Authoring

  • Create custom events in the Events panel.
  • Add typed payload parameters to document the event data.
  • Use Event Dispatch nodes to emit events.
  • Use Event Receive nodes or an onCustomEvent handler to react to events.

SDK Access

Generated scripts emit custom events through the single room-local event atom:

TypeScript
ctx.events.emit("powerup.spawned", {
  entityId: "pickup_1",
  type: "speed"
});

During custom-event dispatch, the runtime calls onCustomEvent; match on the event key before handling the payload:

TypeScript
export function onCustomEvent(ctx, event) {
  if (event.eventKey !== "powerup.spawned") return;
  ctx.log("info", "Powerup spawned", event.payload);
}

Cross-entity and cross-script emit use the same Runtime event router:

TypeScript
ctx.events.emit("round.started", { round: 2 });
Was this helpful?Report an issueContact support

On this page