The Twee-notation parsing engine behind both two-d/stage.importTwee and
rpg.importTwee - the passage/link parsing lives here once, in core (already the home
of parseCSV, another generic text-format parser other modules build their own typed
result around), so a bug fix or a format extension lands in one place instead of two
silently-drifting copies. TweeCommand/TweeChoice are structurally compatible with both
two-d/stage's StoryScript/StageChoice and rpg's EventStoryScript/EventChoice -
each module's own importTwee wrapper only names its own return type, with no per-field
conversion needed.
Only structure is imported: each passage's text lines become say commands and its
[[links]] become one closing ask whose choices jump ([[text]], [[text->target]]
and [[target<-text]]) - the last text line doubles as the question, since a choice box
needs a prompt and repeating it works. No story-format macro language (Harlowe, SugarCube,
Chapbook) is interpreted - body text reaches the game untouched, and a link carrying a
setter throws instead of silently dropping the behaviour the setter described.
:: Start
You stand at a crossroads.
[[Take the left path->Left]]
[[Take the right path->Right]]
:: Left
The path ends at a wall.
[[Go back->Start]]
The Twee-notation parsing engine behind both
two-d/stage.importTweeandrpg.importTwee- the passage/link parsing lives here once, incore(already the home ofparseCSV, another generic text-format parser other modules build their own typed result around), so a bug fix or a format extension lands in one place instead of two silently-drifting copies.TweeCommand/TweeChoiceare structurally compatible with bothtwo-d/stage'sStoryScript/StageChoiceandrpg'sEventStoryScript/EventChoice- each module's ownimportTweewrapper only names its own return type, with no per-field conversion needed.Only structure is imported: each passage's text lines become
saycommands and its[[links]]become one closingaskwhose choices jump ([[text]],[[text->target]]and[[target<-text]]) - the last text line doubles as the question, since a choice box needs a prompt and repeating it works. No story-format macro language (Harlowe, SugarCube, Chapbook) is interpreted - body text reaches the game untouched, and a link carrying a setter throws instead of silently dropping the behaviour the setter described.Example