Open a Twine game
open_gameStart playing or testing a Twine/interactive-fiction game by loading a local HTML file, folder, or URL and receiving the first passage and choices.
Instructions
Open a Twine / interactive-fiction HTML game and return the first observation (passage text, numbered choices, inputs, dialog). Accepts a local .html file, a game folder (index.html or a single html is picked), or an http(s) URL. Local games are served over 127.0.0.1 so saves work. Returns a formatted text observation (string); pass format:"json" for a JSON string. Inputs are listed in windows of 40 (see inputs_offset/inputs_limit on observe) and find_ui(text) locates any control by label.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Seed SugarCube PRNG (State.prng) for reproducible runs; game must use SugarCube randomness to be deterministic. | |
| format | No | Output format: "text" (default, human-readable) or "json" (JSON string for programmatic use). | |
| source | Yes | Path to an .html file or folder, or an http(s) URL. | |
| headless | No | Run browser headless (default true). Set false ONLY when the user explicitly asks to watch a real browser window — and then do not also open a live_view for the same game. | |
| block_trackers | No | Block analytics/tracker requests for a quiet session (default true). | |
| wait_timeout_ms | No | How long to wait for the game to settle after load (default 20000). | |
| include_variables | No | Embed the (truncated) story variables in the observation (default false; prefer get_variables for specific keys). |