Idea: Modding API: watch event flows run, and read the state their checks use #2783

Open
opened 2026-11-29 04:12:19 +00:00 by glinesbdev · 1 comment

The idea

I'm building Ocarina Forge, a tool that reads a player's own dump and makes a Godot project. It converts event flows to C# scripts. The step order, branches and parameters come from the files, but what each action or query does is in the game's code. To rebuild that behaviour, and to let mods work with events, these are the gaps I found.

1. Watch event flows (most useful, read-only)

A mod could listen for:

  • an event starting and ending;
  • each step: flow name, event name, actor, action or query, its parameters, and for a query, the case taken.

game.state().mode says movie when a cutscene has control, but I found nothing that says which event or step is running.

Why: this would answer most of my open questions by observation, such as which case of a query means yes, what units a fade length uses, or how camera parameters are interpreted.

2. Read the state that checks use

  • Combined conditions (BoolExp): game.flags reads plain flags, but I found nothing that evaluates an expression. Please add a read that evaluates one by name. My flows have 692 query steps using 143 expressions.
  • Quest progress: EventExecuteProgressChallengeStep (280 steps) names a challenge and a step. The Step_ flags are enums, but I found no way to map a step's name to the flag's value, or back.
  • Player state: EventQueryCheckPlayerState (226 steps) takes a number. Documentation of the numbers, or a matching read, would help.

3. Do what event steps do (for mods that add or recreate events)

Area Available today Missing
Screen fades (580 steps) A mod's own UI The game's fade in and out
Dialogue hideGameHud() hides all 2D Closing the message box
Camera (2,029 camera move steps) camera.override The event camera's own moves and messages to the player camera
Player setPosition in the same map Facing, look target, turning, animation, waiting, equipment
Navi and other actors actors.setPosition Moving with a speed and animation
World Reading the time of day Setting time and weather, stopping music (group volume is preview)
Map change (79 steps) world.travel Arrival position and the event to start there

4. Acting during events

Flag, player and actor writes are refused outside play, so a mod can't act in the middle of an event. A flow patch can add only actions its flow already has, plus flag branches. Two options that would help:

  • let a flow patch add any of the game's actions, with its actor;
  • let a flow step notify the mod's script, with a safe point for the script to act.

Anything else

  • Checked against mod-api at 5c1cd9f5b: the reference, the modding guides and parts of the source. Not tested in game, so please correct me if something here already exists.
  • Step counts come from flowcharts in my own dump. This isn't a full list: I checked 39 calls reported by one play session, while the flows use 764 action names and 198 query names.
  • No game files are attached.
  • Related: #2571 (read-only scene lighting).
### The idea I'm building Ocarina Forge, a tool that reads a player's own dump and makes a Godot project. It converts event flows to C# scripts. The step order, branches and parameters come from the files, but what each action or query does is in the game's code. To rebuild that behaviour, and to let mods work with events, these are the gaps I found. ### 1. Watch event flows (most useful, read-only) A mod could listen for: - an event starting and ending; - each step: flow name, event name, actor, action or query, its parameters, and for a query, the case taken. `game.state().mode` says `movie` when a cutscene has control, but I found nothing that says which event or step is running. Why: this would answer most of my open questions by observation, such as which case of a query means yes, what units a fade length uses, or how camera parameters are interpreted. ### 2. Read the state that checks use - **Combined conditions (BoolExp):** `game.flags` reads plain flags, but I found nothing that evaluates an expression. Please add a read that evaluates one by name. My flows have 692 query steps using 143 expressions. - **Quest progress:** `EventExecuteProgressChallengeStep` (280 steps) names a challenge and a step. The `Step_` flags are enums, but I found no way to map a step's name to the flag's value, or back. - **Player state:** `EventQueryCheckPlayerState` (226 steps) takes a number. Documentation of the numbers, or a matching read, would help. ### 3. Do what event steps do (for mods that add or recreate events) | Area | Available today | Missing | |---|---|---| | Screen fades (580 steps) | A mod's own UI | The game's fade in and out | | Dialogue | `hideGameHud()` hides all 2D | Closing the message box | | Camera (2,029 camera move steps) | `camera.override` | The event camera's own moves and messages to the player camera | | Player | `setPosition` in the same map | Facing, look target, turning, animation, waiting, equipment | | Navi and other actors | `actors.setPosition` | Moving with a speed and animation | | World | Reading the time of day | Setting time and weather, stopping music (group volume is preview) | | Map change (79 steps) | `world.travel` | Arrival position and the event to start there | ### 4. Acting during events Flag, player and actor writes are refused outside play, so a mod can't act in the middle of an event. A `flow` patch can add only actions its flow already has, plus flag branches. Two options that would help: - let a flow patch add any of the game's actions, with its actor; - let a flow step notify the mod's script, with a safe point for the script to act. ### Anything else - Checked against `mod-api` at `5c1cd9f5b`: the reference, the modding guides and parts of the source. Not tested in game, so please correct me if something here already exists. - Step counts come from flowcharts in my own dump. This isn't a full list: I checked 39 calls reported by one play session, while the flows use 764 action names and 198 query names. - No game files are attached. - Related: #2571 (read-only scene lighting).
Member

Possibly related, for context:

  • issue #2571 Idea: Modding API: read-only access to scene lighting (sun, ambient, fog, exposure, env palette) — Related read-only mod API state access, but scene lighting rather than event execution
  • PR #2656 feat(mods): flow patches, new events in an event flow — Merged flow-patch support; permits adding limited actions/branches in existing flows
Possibly related, for context: - issue #2571 Idea: Modding API: read-only access to scene lighting (sun, ambient, fog, exposure, env palette) — Related read-only mod API state access, but scene lighting rather than event execution - PR #2656 feat(mods): flow patches, new events in an event flow — Merged flow-patch support; permits adding limited actions/branches in existing flows
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot#2783
No description provided.