mwg API
    Preparing search index...

    Function importTwee

    • Reads a .twee file into a StoryScript.

      The actual parsing (passages, [[links]], StoryData/StoryTitle) lives once in core.parseTwee - rpg.importTwee is the same wrapper around the same engine, targeting EventStoryScript instead, declared separately for the same reason EventChoice already duplicates two-d/ui's Choice: a text-only RPG should not have to depend on two-d just to import a branching Twee story, and a Pixi-based visual novel that never touches map events should not have to depend on rpg either. core.parseTwee's own doc comment covers the notation itself (passages, links, what a macro-carrying link does).

      Parameters

      • source: string

      Returns TwineStory

      import { importTwee, StageScript } from '@datamoc/mwg/two-d';

      declare const tweeSource: string;
      declare const script: StageScript;

      const story = importTwee(tweeSource);
      await script.runStory(story.story, story.start);