A terse, line-based text format for straight (non-branching) dialogue - the
counterpart to twee.ts's passage graphs, for the common case of a scene
that is just a sequence of lines. rpg has its own wrapper around the same
parsing engine (core.parseDialogueLines) for a text-only RPG's map events
(rpg.parseDialogueText, targeting EventCommand) - declared separately
here for the same reason EventChoice is declared separately from this
module's own Choice: a text-only RPG built on core and rpg alone
should not have to depend on two-d (and its Pixi peer dependency) just to
parse dialogue text, and a Pixi-based visual novel that never touches map
events should not have to pull in rpg either. The actual @id/-
parsing logic lives once in core.parseDialogueLines, not copied between
the two - only the final command shape (as here, speaker in rpg)
differs. Three kinds of line:
@id text names who is speaking and says text; @id alone (no text)
just registers the speaker, without saying anything yet.
- text continues the two-speaker exchange the first two @id lines
opened, alternating speaker on every line: the first - after the two
openers goes to whichever of them did not speak last, and so on.
any other non-blank line narrates, with no speaker.
@aliceHello. @bobHi! - Howareyou? - Fine, andyou?
The - shorthand is deliberately capped at two speakers: it exists for the
two-character back-and-forth, not as a guess at which of three or more
people talks next. A third distinct @id anywhere in the source is a
parse error rather than a silent guess; a scene with more than two
speakers writes @id on every line instead, same as it does today.
Like twee.ts, lines reach StageCommand.say as plain, untranslated
text - a game's own translation step decides how that text reaches a
player, the same seam MWL's own _("...")-marked strings use (the source
text doubles as the catalog key). extractDialogueCatalog builds that
catalog the same way MWL's extractCatalog does, for a game that wants a
translator-ready file to start from.
A terse, line-based text format for straight (non-branching) dialogue - the counterpart to
twee.ts's passage graphs, for the common case of a scene that is just a sequence of lines.rpghas its own wrapper around the same parsing engine (core.parseDialogueLines) for a text-only RPG's map events (rpg.parseDialogueText, targetingEventCommand) - declared separately here for the same reasonEventChoiceis declared separately from this module's ownChoice: a text-only RPG built oncoreandrpgalone should not have to depend ontwo-d(and its Pixi peer dependency) just to parse dialogue text, and a Pixi-based visual novel that never touches map events should not have to pull inrpgeither. The actual@id/-parsing logic lives once incore.parseDialogueLines, not copied between the two - only the final command shape (ashere,speakerinrpg) differs. Three kinds of line:@id textnames who is speaking and saystext;@idalone (no text) just registers the speaker, without saying anything yet.- textcontinues the two-speaker exchange the first two@idlines opened, alternating speaker on every line: the first-after the two openers goes to whichever of them did not speak last, and so on.The
-shorthand is deliberately capped at two speakers: it exists for the two-character back-and-forth, not as a guess at which of three or more people talks next. A third distinct@idanywhere in the source is a parse error rather than a silent guess; a scene with more than two speakers writes@idon every line instead, same as it does today.Like
twee.ts, lines reachStageCommand.sayas plain, untranslated text - a game's own translation step decides how that text reaches a player, the same seam MWL's own_("...")-marked strings use (the source text doubles as the catalog key).extractDialogueCatalogbuilds that catalog the same way MWL'sextractCatalogdoes, for a game that wants a translator-ready file to start from.