@patterkit/dialect
v0.2.11
Published
The Patter dialect for @wildwinter/expr (scopes shared/scene/flow, built-in functions), an ExpressionSchema builder from property declarations, and the inline {@ref} interpolation helpers (spec §16).
Readme
@patterkit/dialect
Patter's configuration of the @wildwinter/expr
expression language: the scopes and built-in functions that conditions and effects use, plus the helpers for
{@name} placeholders in dialogue text. The compiler uses it to check expressions and the runtime uses it
to evaluate them, so both agree by construction.
Most people won't need to install this directly. To play Patter dialogue in a game or web page, use
@patterkit/runtime; to work with Patter projects from
a terminal or a build script, use @patterkit/cli.
What's in it
- The dialect (
patterDialect): the@patterscope (the default, so a bare@namemeans@patter.name) and the@scenescope, and the built-in functionsrandom,check_flags,set_flags,visits,seen,patter_visits, andpatter_seen. - Scopes from the game:
dialectWithForeignScopesandhostScopesToSpecadd the scopes a game declares itself, such as@world, alongside Patter's own. - An expression schema (
buildSchema) built from a project's property declarations, for checking expressions before anything runs. - Placeholders:
extractSlots,interpolate, andrenderSlotValuefind and fill{@name}placeholders, andstripCaptionsremoves caption cues for closed captions.
The expressions themselves are described in Choices and logic.
npm install @patterkit/dialectPart of Patter
Patter is a branching dialogue format with its own editor (Patterpad), command line
tool (patter), and runtimes for JavaScript, Unity, Unreal, and Godot. This package is one layer of the
JavaScript tooling, and the other @patterkit packages build on it. How it fits
together shows where each piece sits, and the source is in the
patter repository.
Licence
MIT
