Skip to main content

Module player

Module player 

Source
Expand description

Playing a dialogue Scene one text box at a time. DialoguePlayer is the state machine only (who stands where, what is said, which reply choice is open, which music the script asked for, and what the game’s own lines have set: its DialogueHooks); a dialogue screen draws its View and asks for the music.

Structs§

DialoguePlayer
Plays a scene: each advance moves to the next text box (speech or narration), applying the portrait and caption steps in between. At a reply choice it waits for choose, plays that reply’s reaction, then rejoins the scene after the choice. The @music lines passed on the way are kept for take_music. It plays the scene as it is for those present when it starts: the lines of an @if block whose character isn’t there are no part of it, read or skipped. The game’s own lines play on its stage as the scene reaches them (DialogueHooks::direct). Pure: no drawing, no clock, no sound. Cheap to clone (the scene is shared), so a copy can be kept as the scene was at a line (a dialogue log).
Named
The hooks of a game whose only tokens are the names table’s: no lines of its own, and {n:<id>} and {N:<id>} are filled in with Names::substitute. It goes with the check’s NoTokens.
Plain
The hooks of a game that adds nothing: no lines of its own, no tokens, not even names: a {n:<id>} shows as written. A game with name tokens plays with Named.
Portrait
A portrait on screen: who, with which expression.
View
What the screen shows for the current text box, with the game’s tokens filled in.

Traits§

DialogueHooks
What a game adds to playing a scene: its own lines (Directives, such as a place behind the talk) and what they have set so far (its Stage), and the tokens it fills into the text (the hero’s name, say).