TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pompom454/tea/llms.txt
Use this file to discover all available pages before exploring further.
Story object is a static store that holds all of the story’s identity information and every Passage instance loaded from the compiled HTML. It exposes getters for the story’s name, ID, and IFID, along with methods for querying and mutating the passage store at runtime.
Methods that modify the passage store (
Story.add(), Story.delete()) cannot operate on code passages or passages with code tags (init, widget). See the individual method notes for details.Getters
Story.id
The DOM-compatible ID of the story, derived by slugifying the story name.
<html> element’s id attribute.
Story.ifId
The IFID (Interactive Fiction IDentifier) of the story, or an empty string if none exists.
Story.name
The human-readable name of the story.
Methods
Story.add(descriptor)
true if the passage was added successfully; false otherwise.name, tags, and text.
Cannot add code passages (e.g.,
StoryInit, StoryMenu) or passages tagged with code tags (init, widget).A passage descriptor object. All three properties are required.
The passage’s name.
A whitespace-separated list of tags, or an empty string for no tags.
The raw TwineScript/wikifier text of the passage.
Story.delete(name)
true if the passage was found and deleted; false otherwise.Passage instance with the given name from the passage store.
Cannot delete the starting passage, code passages, or passages with code tags.
The name of the passage to delete.
Story.filter(predicate [, thisArg])
A new
Array<Passage> of all Passage instances that passed the predicate, or an empty array if none did.Passage instance in turn; returning true includes it in the results.
Cannot retrieve passages tagged with code tags.
A function
(passage: Passage) => boolean that tests each passage.Optional value to use as
this when calling the predicate.Story.find(predicate [, thisArg])
The first
Passage instance that passed the predicate, or undefined if none did.Cannot retrieve passages tagged with code tags.
A function
(passage: Passage) => boolean that tests each passage.Optional value to use as
this when calling the predicate.Story.get(name)
The
Passage instance with the given name, or a new empty Passage instance if no such passage exists.Passage instance by name. If the passage does not exist, returns an empty (error-rendering) Passage rather than null — so existence should be checked with Story.has() first if needed.
Cannot retrieve passages tagged with code tags.
The name of the passage to retrieve.
Story.has(name)
true if a Passage instance with the given name exists; false otherwise.Does not check passages tagged with code tags.
The name of the passage to check.