Expose per-world smoke readiness to mods
Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
@@ -765,6 +765,28 @@ A piece of smoke or exhaust trail (AirDef fork): a tube from `a` to `b` (equal e
|
||||
| `rise` | `f32` | Blocks per second it floats up (negative sinks). |
|
||||
| `clear` | `f32` | Radius in blocks of the clear tunnel it leaves in fog and cloud, filling back in over `life` (0 none). |
|
||||
|
||||
### enum `smoke-reason`
|
||||
|
||||
| Case | |
|
||||
| --- | --- |
|
||||
| `awaiting-frame` | |
|
||||
| `disabled` | |
|
||||
| `path-unavailable` | |
|
||||
| `ready` | |
|
||||
|
||||
### record `smoke-state`
|
||||
|
||||
State of volumetric smoke, as of the last prepared main-view frame (API level 26). `available` means this host implements the API, not that the backend is ready. `enabled` means HD and smoke are enabled; `backend-ready` means that frame's HD smoke/fog path was scheduled. It does not guarantee GPU submission, a visible pixel, or inclusion of every segment (culling and budgets still apply). `request-accepted` means this mod called set-smoke in this generation and its sanitized submission was stored; it is not a rendering acknowledgement. `generation` changes when the host observes a world/seed transition or restarts the mod runtime. Until a frame is prepared after a transition, keep fallbacks.
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `generation` | `u64` | |
|
||||
| `available` | `bool` | |
|
||||
| `enabled` | `bool` | |
|
||||
| `request-accepted` | `bool` | |
|
||||
| `backend-ready` | `bool` | |
|
||||
| `reason` | `smoke-reason` | |
|
||||
|
||||
### record `spot-light`
|
||||
|
||||
A directional light with a visible beam (AirDef fork): a searchlight, a headlight. The HD lighting lights the surfaces and flying things inside its cone (smoothly from the inner to the outer angle, down to nothing at `range`) and draws the beam as a translucent volume lit from inside: it scatters in the air (more in fog and smoke, a faint artistic one in clear air), the world hides it where it is in front, and the camera may stand inside it. The light does not look for walls: send `range` as far as the beam is free (a cast along the axis) so it stops where the land stops it.
|
||||
@@ -868,6 +890,7 @@ Where a capture is.
|
||||
| `set-lighting` | `func(lighting: lighting)` | Switches the HD lighting on or off for this mod's world, with its exposure and bloom; off, the world is drawn as the game draws it. |
|
||||
| `set-time-override` | `func(day-time: option<u64>)` | Shows the world at this time of day (AirDef fork): the sky, the sun and moon, the sky light and the fog, as `day-time` ticks (24000 a day, as `clock`). Only what the player sees changes: the world's own clock, its saves and its rules do not. None shows the world's own time. |
|
||||
| `set-smoke` | `func(clock: f64, segments: list<smoke-segment>) -> bool` | Replaces the mod's smoke: up to 4096 segments, `clock` being now in ticks (the game shows the age between the last two calls). Returns whether the HD renderer draws them; when it does not (the effects preset, HD smoke off), the mod draws its own smoke. |
|
||||
| `smoke-status` | `func() -> smoke-state` | The calling mod's submission and the last main-view smoke path state. |
|
||||
| `set-spot-lights` | `func(lights: list<spot-light>) -> bool` | Replaces the mod's spot lights: up to 32 (the nearest 16 are drawn), interpolated per id between the last two calls. Returns whether the HD renderer draws them with their beams; when it does not (the effects preset, HD off), the mod draws its own beam if it wants one. |
|
||||
| `capture-start` | `func(options: capture-options) -> result<_, string>` | Records the screen frame by frame (AirDef fork), at a fixed time step whatever the speed of the machine: while it records, the game clock advances exactly `1 / fps` seconds a frame (ticks, interpolation, the mod's `tick`s and the sounds with it), so a slow frame is a longer wait and not a skipped one. The frames are read back from the GPU and encoded to H.264 MP4 by `ffmpeg` (found on the `PATH`, or named by `HORIZON_FFMPEG`) through a bounded queue, never held in memory; with no `ffmpeg` they are written as a PNG sequence. Returns an error for a capture already running, a bad name, or an invalid size. Only the game's own files are written, under its home. |
|
||||
| `capture-stop` | `func(cancel: bool)` | Ends the capture: finishes the file, or (`cancel`) throws it away. |
|
||||
|
||||
Reference in New Issue
Block a user