timer
Starts a named countdown. When it reaches zero, the story navigates to on_end (a node id, or NEXT / END / START). Use pause/resume/stop to control it. There is no built-in countdown display — signal urgency with dialogue, SFX, or your own UI later.
{ "type": "timer", "id": "bomb", "seconds": 30, "on_end": "explode" }
[timer id=bomb seconds=30 on_end=explode]
… later …
[timer id=bomb stop]
Usually you need
| Field | Type | Effect |
|---|---|---|
id | string | Timer name (restarting the same id replaces it) |
seconds | number > 0 | Duration (start only) |
on_end | string | Where to go when time runs out |
action | pause / resume / stop | Control an existing timer (instead of start) |
Mode A
[timer id=bomb seconds=30 on_end=explode]
[timer id=bomb pause]
[timer id=bomb resume]
[timer id=bomb stop]
Spaced keys also work: [timer id bomb seconds 30 on_end explode].
Rules
- Start shape:
id+seconds+on_end. Control shape:id+action. on_endresolves like choice targets: node id,NEXT,END, orSTART.- Timers freeze while a blocking screen is open (pause menu, etc.) and while the story is not in play. Author
pause/resumeis separate. - Remaining time is saved with the play session. New Game / return to title clears all timers.
- For a menu that times out, use
choices.timeron the choice object — not a separate wait. - To stop a timer only when a flag is set, use command meta
whenon the stop command.
All fields
| Field | Type | Default | Effect |
|---|---|---|---|
id | string | — | Required |
seconds | number | — | Start only; must be > 0 |
on_end | string | — | Start only |
action | string | — | pause, resume, or stop |
when | expression | — | Skip when falsy |
See also
- Choices (story) —
choices.timerfor timed menus - call / jump — other navigation verbs