# IFLoom > An interactive fiction engine for TypeScript: linear novels, management games and life sims on one core. Each page below is also plain Markdown at https://ifloom.dev/llms.mdx/docs//content.md, such as https://ifloom.dev/llms.mdx/docs/how-to/add-a-location/content.md. The latest docs in one file: https://ifloom.dev/llms-full.txt (about 3 MB). One file a section: - [Tutorial](https://ifloom.dev/llms/tutorial.txt) - [How-to guides](https://ifloom.dev/llms/how-to.txt) - [Explanation](https://ifloom.dev/llms/explanation.txt) - [Reference](https://ifloom.dev/llms/reference.txt) - [Upgrading](https://ifloom.dev/llms/upgrading.txt) - [API](https://ifloom.dev/llms/api.txt) - Tutorial: Write a short story or build a small town, step by step - [Introduction](https://ifloom.dev/docs/tutorial): IFLoom is a TypeScript engine for interactive fiction of any shape, from a linear novel to a life sim, with two tutorials to start from. - Write a short story - [1. Start a story](https://ifloom.dev/docs/tutorial/story/start-a-story): Create a game from a template and write the first three chapters of a short story, with choices that lead from one to the next. - [2. Keep a stat and the player's name](https://ifloom.dev/docs/tutorial/story/a-stat-and-a-name): Keep a stat that kind choices raise, and ask the player's name so the story can greet them by it. - [3. Remember a choice and end the story](https://ifloom.dev/docs/tutorial/story/remember-and-end): Make later chapters change with an earlier choice, and end the story in one of two ways with a button to start again. - [4. Check, playtest and build](https://ifloom.dev/docs/tutorial/story/check-and-build): Check the story for mistakes, read a playtest that plays it to an ending, and build it into a folder that opens from disk. - Build a small town - [1. Create a game](https://ifloom.dev/docs/tutorial/town/create-a-game): Create a game from a template, run it in your browser, and find the files that hold its story. - [2. Write scenes and choices](https://ifloom.dev/docs/tutorial/town/scenes-and-choices): Replace the template's story with a bedroom and a kitchen, and choices that move between them. - [3. Keep stats](https://ifloom.dev/docs/tutorial/town/stats): Give the player energy and coins as stats, and a choice that spends some of that energy once. - [4. Remember what the player did](https://ifloom.dev/docs/tutorial/town/remember-what-happened): Count the player's visits to the kitchen in the kv store, and offer a cup of tea from the second visit on. - [5. Add locations to walk between](https://ifloom.dev/docs/tutorial/town/locations): Add the house, the high street and the café as locations with exits, so the player can walk between them. - [6. Add a person and a clock](https://ifloom.dev/docs/tutorial/town/people-and-time): Give the game a clock with the calendar plugin, and add Ruth, who keeps the café counter on weekday mornings and afternoons. - [7. Buy something](https://ifloom.dev/docs/tutorial/town/buy-something): Sell a coffee at the café for coins, refused with a reason on its button while the café is shut. - [8. Check, playtest and build](https://ifloom.dev/docs/tutorial/town/check-and-build): Check the town for mistakes, watch a playtest run through it, and build it into a folder that opens from disk. - How-to guides: Recipes for one task each - **Set up** - [Create a game](https://ifloom.dev/docs/how-to/create-a-game): Start a new IFLoom game with npm create ifloom, choosing a package manager, a template and a theme. - [Add IFLoom to an existing project](https://ifloom.dev/docs/how-to/add-to-a-project): Put an IFLoom game in a web project that already has its own build, rendered into one of its pages. - [Organise your game's files](https://ifloom.dev/docs/how-to/organise-your-files): Split a growing game's content into files by kind and by area, and let npm run check find a key declared twice. - [Add a plugin](https://ifloom.dev/docs/how-to/add-a-plugin): Install a first-party plugin, list it in the game's plugins in the right order, write its content and show it in the React UI. - [Work with a coding agent](https://ifloom.dev/docs/how-to/use-a-coding-agent): Give a coding agent the IFLoom docs and a brief for your game, and have it check its own work. - [Run the examples from the repository](https://ifloom.dev/docs/how-to/work-in-the-repository): Try unreleased IFLoom code from a clone of the repository by playing the examples or making a game in or beside the checkout. - [Move a story from Twine](https://ifloom.dev/docs/how-to/move-from-twine): Move a SugarCube or Harlowe story to IFLoom, with one passage converted side by side and the differences to plan for. - **Write the story** - [Write a flowing scene](https://ifloom.dev/docs/how-to/write-a-flowing-scene): Write a scene that reads on as the player chooses, with decisions partway through, jumps, a minigame in place and parts that fold away. - [Hand-roll an inventory with variables](https://ifloom.dev/docs/how-to/hand-roll-an-inventory): Keep what the player has in kv keys, as a Twine or SugarCube story does, and read them in conditions and scenes with no plugin. - [Make a choice that needs a thing](https://ifloom.dev/docs/how-to/gate-a-choice-on-a-thing): Offer a choice or an action only while the player has a thing, greyed out with a reason or hidden, and use the thing up. - [Ask the player for a name](https://ifloom.dev/docs/how-to/ask-for-a-name): Ask the player to type a name, hold the story until they do, and print it in the prose and on their spoken lines. - [Offer a random scene from a set](https://ifloom.dev/docs/how-to/offer-a-random-scene): Draw a scene at random from a set of storylets by weight, condition, cooldown and chance, and let other files and mods add to the set. - [Put a choice inside a line of text](https://ifloom.dev/docs/how-to/put-a-choice-in-a-line): Put a choice or an action inside a line of prose as a link, and add a tooltip to a word. - [Show a popup](https://ifloom.dev/docs/how-to/show-a-popup): Open a dialog from a word in the prose, either one that only shows words or one whose buttons change the game. - [Tell the player when something happens](https://ifloom.dev/docs/how-to/show-a-notice): Tell the player when something happens outside the story, with a trigger that raises a notice once or each turn. - [Add a transition or reveal lines](https://ifloom.dev/docs/how-to/add-a-transition): Fade or slide scenes and locations in, and reveal lines one after another, with the React UI's transition and reveal hints. - [Roll dice for a check](https://ifloom.dev/docs/how-to/roll-dice): Roll dice against a target from a link in the prose, with a line for each outcome and a stat added to the roll. - [Add a countdown](https://ifloom.dev/docs/how-to/add-a-countdown): Give the player a choice to make in time, with a timer that runs out into its own effects and a test that sends the ticks. - [Build a minigame](https://ifloom.dev/docs/how-to/build-a-minigame): Build a quick-time minigame from data, with states, inputs and timers, an action that starts it and a test that plays it. - [End the game](https://ifloom.dev/docs/how-to/end-the-game): End the story with one ending or several chosen by the state, count it as finishing the game, and offer a way to start again. - [Translate your game](https://ifloom.dev/docs/how-to/translate-your-game): Translate your game as one pack with a words table, its prose and the strings, and check its keys. - **Build the world** - [Add a location](https://ifloom.dev/docs/how-to/add-a-location): Add a location the player can walk to, with exits, things to do, opening hours and a scene at the door. - [Add a character with a schedule](https://ifloom.dev/docs/how-to/add-a-character): Add a character who keeps a schedule, talks with the player, changes what they say as the story moves and answers calls. - [Set up days and times of day](https://ifloom.dev/docs/how-to/set-up-the-clock): Give a game days and times of day with the calendar plugin, with actions that pass time, a bed and a curfew. - [Give the player things to hold and use](https://ifloom.dev/docs/how-to/give-the-player-things): Give the player things with the inventory plugin, and let them use, drop and give those things away. - [Open a shop, a job board or another panel](https://ifloom.dev/docs/how-to/open-a-panel): Open a vendor's counter, a job board or a panel of your own over the story from a location, a scene, a thing or an app. - [Add a quest](https://ifloom.dev/docs/how-to/add-a-quest): Give the player a goal in stages, each finished by a condition, and gate content on how far the quest has got. - [Build a friendship in stages](https://ifloom.dev/docs/how-to/build-friendships-in-stages): Grow a friendship over days, with a choice that pays once a turn, greetings that change with visits and stages that come in order. - [Run things each day: cooldowns, new-day work and pay](https://ifloom.dev/docs/how-to/schedule-daily-work): Reset a value each day, allow something once a day, rest a scene between visits and pay wages once a week. - [Let the player get dressed](https://ifloom.dev/docs/how-to/dress-the-player): Give the player clothes with the wardrobe plugin, start them dressed, give them somewhere to change and make the story notice what they wear. - [Build a phone](https://ifloom.dev/docs/how-to/build-a-phone): Put a phone in a game from the devices, messages and feed plugins, with texts, posts, unread badges and apps of your own. - [Add pictures and backgrounds](https://ifloom.dev/docs/how-to/add-pictures-and-backgrounds): Put pictures and short clips in a game, in a scene's words, behind a scene, picked from a pool by tags or layered with hotspots. - [Add music and sound](https://ifloom.dev/docs/how-to/add-music-and-sound): Give a game music, ambience, one-shot sounds and voiced lines, and play them with the audio player in plain JS, React or Vue. - **Screens around the game** - [Add a title screen](https://ifloom.dev/docs/how-to/add-a-title-screen): Open the game on a title screen with New game and Continue, the React UI's own or one you render yourself. - [Add a settings page](https://ifloom.dev/docs/how-to/add-a-settings-page): Let the player change settings such as hints or the text size, on the React UI's settings page or one of your own. - [Add a content notice and pages of your own](https://ifloom.dev/docs/how-to/add-pages-around-the-game): Show a content notice the player confirms once before the title screen, and add pages of your own such as a list of endings. - [Credit your team and supporters](https://ifloom.dev/docs/how-to/credit-your-team-and-supporters): List the people and sources behind your game, such as the team, patrons, photographs and models, on a credits page. - [Offer New Game+](https://ifloom.dev/docs/how-to/offer-new-game-plus): Let a player who finished the game start again with some of their stats, kv keys and things, and write lines only a second run shows. - [Build a HUD](https://ifloom.dev/docs/how-to/build-a-hud): Build a heads-up display of your own with a stat bar, unread counts and the tracked quest's objective, in plain JS, React or Vue. - [Arrange the layout](https://ifloom.dev/docs/how-to/arrange-the-layout): Arrange the page around the story, with sections that fold or open in a dialog and a side column that becomes a drawer on a phone. - **Render it yourself** - Render it yourself - [Start your own UI](https://ifloom.dev/docs/how-to/render/start): Put a game on screen with a UI of your own in plain JS, React or Vue, from the runner's snapshot and the player's commands. - [Render the scene and its choices](https://ifloom.dev/docs/how-to/render/scene): Render the open scene or the room, with its beats, choices, inputs and inline links, in a UI of your own. - [Render stats, things and what changed](https://ifloom.dev/docs/how-to/render/stats-and-things): Render the stats, the things the player holds, what the last command changed, notices and dice rolls in a UI of your own. - [Render pictures and play sound](https://ifloom.dev/docs/how-to/render/pictures-and-sound): Render a scene's layered picture with its hotspots, and play the game's music, sounds and voices, in a UI of your own. - [Render timers, minigames and panels](https://ifloom.dev/docs/how-to/render/timers-minigames-panels): Render timer countdowns, a running minigame and an open panel in a UI of your own, in plain JS, React or Vue. - [Render saves, settings and the backlog](https://ifloom.dev/docs/how-to/render/saves-and-settings): Render a save and load screen, a settings screen and the backlog with Undo in a UI of your own, in plain JS, React or Vue. - [Render the calendar, locations and people](https://ifloom.dev/docs/how-to/render/world-plugins): Render the time of day, the location the player is at with its exits, and the people here in a UI of your own. - [Render quests, achievements and statuses](https://ifloom.dev/docs/how-to/render/progress-plugins): Render a quest log, an achievements page and the statuses in play in a UI of your own, in plain JS, React or Vue. - [Render the inventory, shop, jobs and wardrobe](https://ifloom.dev/docs/how-to/render/things-plugins): Render the things to use and drop, a vendor's counter, a job board and what the player wears in a UI of your own. - [Render messages, the feed and devices](https://ifloom.dev/docs/how-to/render/phone-plugins): Render texts with replies, a feed of posts and a device with its apps in a UI of your own, in plain JS, React or Vue. - [Render cheats, unlocks and debug](https://ifloom.dev/docs/how-to/render/player-tools): Render a cheat menu, a box for supporter codes and a debug readout in a UI of your own, in plain JS, React or Vue. - **The React UI** - The React UI - [Set up the React UI](https://ifloom.dev/docs/how-to/react/set-up-the-react-ui): Add the React UI to a game with React, Tailwind, the TypeScript and Vite settings, its stylesheet and the entry that mounts the game. - [Add splash cards](https://ifloom.dev/docs/how-to/react/add-splash-cards): Show your studio, publisher and game logo as cards when the game opens, beside or instead of the Powered by IFLoom card. - [Theme the React UI](https://ifloom.dev/docs/how-to/react/theme-the-react-ui): Give a game rendered with the React UI a look of its own, with a theme preset, colours, dark mode, a font and CSS. - [Rearrange or replace the React UI's parts](https://ifloom.dev/docs/how-to/react/replace-parts): Move the React UI's parts in your layout, replace a component everywhere, or render a scene, a page or the root your own way. - [Show plugins in the React UI](https://ifloom.dev/docs/how-to/react/show-plugin-uis): Show plugins in the React UI by listing their UIs, place them in a layout of your own, or render one yourself from its hook. - [Add panels, sections, components and hints](https://ifloom.dev/docs/how-to/react/extend-the-react-ui): Add your game's own panels, sections, components, ui hints and inline pieces to the React UI. - [Write a plugin's React UI](https://ifloom.dev/docs/how-to/react/write-a-plugins-react-ui): Give a plugin a React UI in its /react subpath, with components a game can replace and parts it can style, and test it. - **Write code** - [Run a game in code](https://ifloom.dev/docs/how-to/run-a-game-in-code): Play a game from code with no UI, in Node or a browser, by making a runner, sending commands and reading the view. - [Write your own condition, effect or macro](https://ifloom.dev/docs/how-to/write-your-own-condition-or-effect): Write a condition, effect, macro or value in the game's rules, and call it from content by name with game/ in front. - [Run code at the end of a turn](https://ifloom.dev/docs/how-to/run-code-at-the-end-of-a-turn): Run the game's own code as each turn ends, before or after the plugins move on, and test it. - [Write a plugin](https://ifloom.dev/docs/how-to/write-a-plugin): Write a plugin package with its own state, calls and tests, and publish it. - [Make plugins work together](https://ifloom.dev/docs/how-to/make-plugins-work-together): Make your plugin do more in a game that has another plugin, by asking it by name, and test it alone and with each partner. - [Write a save driver](https://ifloom.dev/docs/how-to/write-a-save-driver): Keep saves your own way with a save driver, such as compressed saves in localStorage or files in a desktop app. - [Let players add mods](https://ifloom.dev/docs/how-to/let-players-add-mods): Let players add mods to your built game with a mod manager in plain JS, React or Vue, and see what mods do to saves. - [Sell supporter content](https://ifloom.dev/docs/how-to/sell-supporter-content): Give the people who fund your game a code that opens cheats and extra scenes, and ship new codes with each release. - **Test, fix and ship** - [Test a route through your game](https://ifloom.dev/docs/how-to/test-a-route): Test a route through your game with Vitest and no browser, checking the stats, the view and the reasons for refusals. - [Playtest and snapshot from the command line](https://ifloom.dev/docs/how-to/playtest-and-snapshot): Check a whole game from the command line, play a week of it with nobody at the keyboard, and snapshot how every scene reads. - [Debug a game](https://ifloom.dev/docs/how-to/debug-a-game): Jump to the state you need with the debug plugin, see why a button is greyed out, and replay a player's save in a test. - [Find out why a choice doesn't show](https://ifloom.dev/docs/how-to/troubleshoot-a-missing-choice): Find out why a choice or an action is missing or greyed out, from every reason the engine hides or refuses one. - [Ship your game](https://ifloom.dev/docs/how-to/ship-your-game): Build your game into a folder that opens from disk or a static host, with pictures, sound and saves that work there. - [Build with Next.js](https://ifloom.dev/docs/how-to/build-with-next): Run an IFLoom game in a Next.js app from a client component that starts it, with ifloom check and playtest beside it. - [Build with webpack](https://ifloom.dev/docs/how-to/build-with-webpack): Build an IFLoom game with webpack, with the React UI's styles and a single index.html that opens from disk. - [Build with esbuild](https://ifloom.dev/docs/how-to/build-with-esbuild): Build an IFLoom game with esbuild, with a dev server and a short script that makes the single index.html that opens from disk. - Explanation: How IFLoom works and why - [How the pieces fit](https://ifloom.dev/docs/explanation/architecture): An IFLoom game is built in four layers, the engine, plugins, a UI and the toolchain, and only the engine is required. - [Why IFLoom works this way](https://ifloom.dev/docs/explanation/design): The rules the engine keeps, such as seeded randomness and nothing loaded at runtime, with the reason for each and its cost. - [State, commands and the view](https://ifloom.dev/docs/explanation/state-and-commands): The loop at the heart of a game, where commands change one plain state and a UI renders a view of it. - [Turns, scenes and the room](https://ifloom.dev/docs/explanation/turns-and-time): Time passes by the turn, the engine's one clock, and the player sees a scene or the room while it does. - [Content, packs and the base](https://ifloom.dev/docs/explanation/content-and-packs): Why loadGame takes a game as content, packs and a base, and what a mod, a save and an upgrade can change in each. - [Entities, things and traits](https://ifloom.dev/docs/explanation/entities-and-traits): The engine keeps one list of entities, each of a kind and carrying traits, which plugins share, and leaves who has what to variables or plugins. - [How plugins work](https://ifloom.dev/docs/explanation/plugins): A plugin adds one system to the engine, and the rules every plugin keeps let a game combine any of them. - [Choosing a UI](https://ifloom.dev/docs/explanation/choosing-a-ui): Compare the ready-made React UI with a UI of your own in any framework, and see what each gives you and costs. - [Three shapes of game](https://ifloom.dev/docs/explanation/shapes-of-game): One small core makes a linear novel, a management game and a life sim, as the three example games show. - Reference: Every package, feature and command - [Reference](https://ifloom.dev/docs/reference): The reference pages for every IFLoom export, grouped by package from the engine to the plugins, the React UI, the browser helpers and the CLI. - [Common types](https://ifloom.dev/docs/reference/common): The types the rest of the reference uses first, such as Result, Range and EntityRef, and the rules for ids. - [Glossary](https://ifloom.dev/docs/reference/glossary): One definition for each word the IFLoom docs use, with links to the explanation and the reference entry for each. - [Examples](https://ifloom.dev/docs/reference/examples): The three example games, with how to run each and which file shows each feature. - **The game** - [Content and packs](https://ifloom.dev/docs/reference/content): The content a game declares, how loadGame merges it with packs, and the problems it reports. - [The game](https://ifloom.dev/docs/reference/game): The loaded Game every engine function takes, with its fields, the room shown while no scene is open, and sceneOf. - [Game state](https://ifloom.dev/docs/reference/state): GameState, field by field, the one plain object that holds a game in progress and is its save. - [Stats](https://ifloom.dev/docs/reference/stats): A stat is a number the game keeps for the player or for each entity of a kind, with ranges, levels and derived values. - [Settings](https://ifloom.dev/docs/reference/settings): The settings a player can change, play settings kept in the state for conditions and ui settings kept in the profile. - [Entities](https://ifloom.dev/docs/reference/entities): Kinds, entities, traits and receivers, and the functions that read an entity, its traits and what someone owns. - [Scenes](https://ifloom.dev/docs/reference/scenes): A scene is one screen of story, a body of blocks and the choices under it, declared as data in content's scenes. - [Flowing scenes](https://ifloom.dev/docs/reference/flows): A flowing scene reads on as the player chooses, with builders that write its body and state that keeps its path. - [Storylets](https://ifloom.dev/docs/reference/storylets): A storylet is a scene drawn at random from a named set by weight and condition, with the seeded draw and its checks. - [Prose and markup](https://ifloom.dev/docs/reference/prose): The prose table, the markup in the words a player reads, and the functions that parse prose into beats and spans. - [Phrases](https://ifloom.dev/docs/reference/phrases): A phrase is a few words that change with the state, declared in content's phrases and printed in prose with a token. - [Strings](https://ifloom.dev/docs/reference/strings): The engine's and plugins' own lines by key, such as refusals and labels, and how a game or a translation rewords them. - [The words table](https://ifloom.dev/docs/reference/words): A pack's words table gives other words to each field a player reads by its key, and translatableFields lists those keys. - [Credits](https://ifloom.dev/docs/reference/credits): Credits are the people and sources a game thanks, in groups such as the team, patrons and image sources, which every UI and mod reads the same way. - **Logic** - [Amounts](https://ifloom.dev/docs/reference/amounts): An amount is a number content names, such as a stat or a formula, that the engine works out when it reads it. - [Conditions](https://ifloom.dev/docs/reference/conditions): Every kind of condition, a test of the state written as data, and the functions that check one and explain why it fails. - [Effects](https://ifloom.dev/docs/reference/effects): Every kind of effect, one change to the state written as data, and applyEffects, which runs a list of them. - [Commands](https://ifloom.dev/docs/reference/commands): A command is one thing the player does, and apply answers each with the next state or a refusal. - [Actions](https://ifloom.dev/docs/reference/actions): An action is something the player does outside a scene's choices, with the cost, blocked and once fields a choice shares. - [Locks](https://ifloom.dev/docs/reference/locks): A lock refuses some commands while a condition holds, with one line telling the player why. - [Rules and hooks](https://ifloom.dev/docs/reference/rules): The game's own code, GameRules, which the engine runs as the first plugin, with its state, commands, turn hooks and migrations. - [Calls by name](https://ifloom.dev/docs/reference/custom): The conditions, effects, macros and values a game writes in code and content calls by name with game/ in front. - **Systems** - [Storylines](https://ifloom.dev/docs/reference/storylines): A storyline is one thread of the story with a kv store of its own, which can close for some turns and open again. - [Notices](https://ifloom.dev/docs/reference/notices): A notice is news the game tells the player beside the story, shown as a toast or counted on a badge. - [Triggers](https://ifloom.dev/docs/reference/triggers): A trigger is a list of effects that runs by itself after a command once its condition holds, once a game or once a turn. - [Inputs](https://ifloom.dev/docs/reference/inputs): An input is a value the player types or picks, such as a name, checked and written to a kv key. - [Minigames](https://ifloom.dev/docs/reference/minigames): A minigame is a small game inside the story, declared as data with states, inputs and timers, and run by ticks. - [Timers](https://ifloom.dev/docs/reference/timers): A timer is a named countdown in real time, run down by ticks, that runs its effects when it runs out. - [Randomness](https://ifloom.dev/docs/reference/random): The seeded draws, which give the same values for the same save and turn, and the save's seed they hash. - [Dice rolls](https://ifloom.dev/docs/reference/rolls): A dice roll is the roll effect, which throws dice, keeps the total in the kv store and lists the roll for a UI. - [Changes](https://ifloom.dev/docs/reference/changes): The tracked stats the last command moved, listed in view.changes so a UI can show feedback such as +3 coins. - [Audio](https://ifloom.dev/docs/reference/audio): The tracks, playlists and channels a game declares, and the music and sounds the view lists for an audio player. - [Media](https://ifloom.dev/docs/reference/media): The pictures and videos a game shows, from pools picked by tags to layered pictures with hotspots. - [Panels](https://ifloom.dev/docs/reference/panels): A panel is a named piece of UI that content opens over the story, such as a vendor's counter or a job board. - [Presentation hints](https://ifloom.dev/docs/reference/ui-hints): The ui field that scenes, choices, entities and the game carry for a UI package, and the interfaces a UI augments to declare its hints. - **Running a game** - [The runner](https://ifloom.dev/docs/reference/runner): The runner is the one object a UI drives, with undo, a backlog, saves, autosave and a snapshot for its listeners. - [The view](https://ifloom.dev/docs/reference/view): The view is one plain value that holds everything a UI renders for a state, already worded for the player. - [Saves](https://ifloom.dev/docs/reference/saves): The save store, the drivers that decide where saves are kept, the save file and loadState, which brings a save into play. - [The profile](https://ifloom.dev/docs/reference/profile): The profile keeps what outlives a save, such as the player's settings, a finished game and achievements, for every save on a device. - [Mods](https://ifloom.dev/docs/reference/mods): A mod is a pack in a JSON file that a player adds to a built game, kept by the mod store and loaded over the content. - [Checking content](https://ifloom.dev/docs/reference/checks): The content checker, checkGame, and every problem it reports about the names and files a game's content uses. - [Testing helpers](https://ifloom.dev/docs/reference/testing): The helpers in @ifloom/engine/testing that game and plugin tests use, from loadChecked and play to the package checks. - **Writing plugins** - [Plugin API](https://ifloom.dev/docs/reference/plugin-api): A plugin's shape, from its id, version and state to its commands, hooks and providers, and definePlugin, which declares one. - [Declaring a plugin's calls](https://ifloom.dev/docs/reference/plugin-calls): The defineCalls and defineData functions declare a plugin's calls and data lists once, and type every call content makes to it. - [Queries and partners](https://ifloom.dev/docs/reference/plugin-queries): A query is an answer one plugin gives and another asks for by name, so plugins work together without importing each other. - [A plugin's view, scene and actions](https://ifloom.dev/docs/reference/plugin-views): A plugin's view, room scene, actions and audio show the player what it keeps, and its content brings kinds, entities and traits. - [Plugin migrations](https://ifloom.dev/docs/reference/plugin-migrations): A plugin's versions and migration steps carry its saved state, the content packs write for it and its command logs forward. - [A plugin's content checks](https://ifloom.dev/docs/reference/plugin-checks): The content checker checks a plugin's data, calls and panels from the plugin's references and its own check. - **Packages** - First-party plugins - [First-party plugins](https://ifloom.dev/docs/reference/plugins): Every first-party plugin, what it adds and the plugins it cooperates with. - [Calendar](https://ifloom.dev/docs/reference/plugins/calendar): The calendar plugin gives a game days, weekdays and periods of the day, a bed and a curfew, and sets how long a turn is. - [Places](https://ifloom.dev/docs/reference/plugins/places): The places plugin gives a game a map of locations with exits between them, and keeps track of where the player is. - [Cast](https://ifloom.dev/docs/reference/plugins/cast): The cast plugin gives a game characters with their own hours, whom the player can find, talk to and call. - [Quests](https://ifloom.dev/docs/reference/plugins/quests): The quests plugin keeps the player's quests, each a list of stages done by conditions, with tracking and news. - [Statuses](https://ifloom.dev/docs/reference/plugins/statuses): The statuses plugin adds timed statuses that change the player's stats for a few turns and run effects as they start, tick and end. - [Achievements](https://ifloom.dev/docs/reference/plugins/achievements): The achievements plugin marks things the player has done, earned by a condition, progress or an effect, with secret ones and a record in the profile. - [Inventory](https://ifloom.dev/docs/reference/plugins/inventory): The inventory plugin keeps the things the player and other people carry, and lets the player use, drop and give them away. - [Shop](https://ifloom.dev/docs/reference/plugins/shop): The shop plugin adds vendors who sell things for any spendable stat, with stock, restocking, selling back and daily discounts. - [Jobs](https://ifloom.dev/docs/reference/plugins/jobs): The jobs plugin adds jobs the player applies for, works shifts at, is promoted in and can be fired from. - [Generators](https://ifloom.dev/docs/reference/plugins/generators): The generators plugin makes new entities from templates, drawing each field from a pool, a range or a fixed value, the same on every replay. - [Wardrobe](https://ifloom.dev/docs/reference/plugins/wardrobe): The wardrobe plugin keeps track of what the player and each protagonist has on, in slots the game declares. - [Messages](https://ifloom.dev/docs/reference/plugins/messages): The messages plugin delivers texts, emails or letters when the story allows, kept in threads with replies that work like choices. - [Feed](https://ifloom.dev/docs/reference/plugins/feed): The feed plugin keeps timelines of posts that appear when the story allows, with the player's own posts, likes and comments. - [Devices](https://ifloom.dev/docs/reference/plugins/devices): The devices plugin gives the player devices such as a phone or a laptop, with apps built from sections and unread badges. - [Unlocks and cheats](https://ifloom.dev/docs/reference/plugins/unlocks): The unlocks plugin checks the codes a player enters, opens the scenes and encrypted packs each code unlocks, and gives the player cheats. - [Debug](https://ifloom.dev/docs/reference/plugins/debug): The debug plugin adds commands that set the state by hand past every lock while you test, and a readout of locks and triggers. - [Community plugins](https://ifloom.dev/docs/reference/plugins/community): Plugins other people have written for IFLoom, the criteria for listing one, and how to submit yours. - React UI: @ifloom/react - [The React UI](https://ifloom.dev/docs/reference/react): The optional React UI, @ifloom/react, with mountGame and its options, its two entries, its pages and its strings. - [Components](https://ifloom.dev/docs/reference/react/components): Every component and hook @ifloom/react exports, from GameShell to the pages around the game, with what each renders. - [Plugin UIs and the kit](https://ifloom.dev/docs/reference/react/kit): The kit in @ifloom/react/kit that plugin UIs are built from, with pluginKit, usePlugin, its parts and the shadcn/ui primitives. - [Presentation hints](https://ifloom.dev/docs/reference/react/hints): The ui hints and inline pieces the React UI reads from content, such as transitions, reveals, dice and stat bars, and checkUiHints. - [React UI parts](https://ifloom.dev/docs/reference/react/parts): Every data-part the React UI and the plugins' React UIs render, with its data attributes, for a stylesheet, the classes option or a test. - Browser: @ifloom/browser and @ifloom/audio - [Browser helpers](https://ifloom.dev/docs/reference/browser): The browser helpers in @ifloom/browser, which make a runner with saves, keep saves in the browser, tick the clock and handle keys. - [The audio player](https://ifloom.dev/docs/reference/browser/audio-player): The audio player in @ifloom/audio, which plays view.audio in the browser with plain audio elements. - CLI: @ifloom/cli - [The CLI](https://ifloom.dev/docs/reference/cli): The ifloom command's subcommands with their flags and exit codes, the game module they read and the Vite preset. - [ifloom new](https://ifloom.dev/docs/reference/cli#ifloom-new) - [ifloom dev](https://ifloom.dev/docs/reference/cli#ifloom-dev) - [ifloom build](https://ifloom.dev/docs/reference/cli#ifloom-build) - [The game module](https://ifloom.dev/docs/reference/cli#the-game-module) - [ifloom check](https://ifloom.dev/docs/reference/cli#ifloom-check) - [ifloom playtest](https://ifloom.dev/docs/reference/cli#ifloom-playtest) - [ifloom snapshot](https://ifloom.dev/docs/reference/cli#ifloom-snapshot) - [ifloom words](https://ifloom.dev/docs/reference/cli#ifloom-words) - [ifloom unlock-hash](https://ifloom.dev/docs/reference/cli#ifloom-unlock-hash) - [The Vite preset](https://ifloom.dev/docs/reference/cli#the-vite-preset) - **Other tools** - [Twine phrasebook](https://ifloom.dev/docs/reference/twine-phrasebook): Each SugarCube and Harlowe macro, special passage and idea beside the IFLoom scene, choice, condition, effect or plugin that does the same. - Upgrading: Moving a game to a newer engine, and what changed in each schema - [Upgrade IFLoom](https://ifloom.dev/docs/upgrading): Move a game to a newer IFLoom release by raising every @ifloom range together and fixing what TypeScript and the checker report. - [Schema history](https://ifloom.dev/docs/upgrading/schema-history): How upgradePack carries an older pack forward, and each change to the content format, schema by schema. - [Older saves](https://ifloom.dev/docs/upgrading/old-saves): How loadState carries a save written by an older engine forward, and each change to the save format. - [Migrate your players' saves](https://ifloom.dev/docs/upgrading/migrate-your-saves): Carry players' saves forward when an update changes your game's content, with a version and a migration step for each change. - [Stability before 1.0](https://ifloom.dev/docs/upgrading/status): IFLoom has no stable API before 1.0, but saves and packs already carry old data forward when the engine changes. - API: Every export, generated from the source - [API](https://ifloom.dev/docs/api): Every export of every IFLoom package, with its exact signature and fields, generated from the source and its TSDoc. - **Engine** - [@ifloom/engine](https://ifloom.dev/docs/api/engine): Every export of @ifloom/engine, the main entry for writing and running a game: its signature and its fields. - [@ifloom/engine/plugin](https://ifloom.dev/docs/api/engine-plugin): Every export of @ifloom/engine/plugin, the entry for writing a plugin: its signature and its fields. - [@ifloom/engine/testing](https://ifloom.dev/docs/api/engine-testing): Every export of @ifloom/engine/testing, the engine's test helpers: its signature and its fields. - **UI and browser** - [@ifloom/react](https://ifloom.dev/docs/api/react): Every export of @ifloom/react, the React UI: its signature and its fields. - [@ifloom/react/kit](https://ifloom.dev/docs/api/react-kit): Every export of @ifloom/react/kit, what a plugin's or a game's own React components are built from: its signature and its fields. - [@ifloom/browser](https://ifloom.dev/docs/api/browser): Every export of @ifloom/browser, the browser helpers for any UI: its signature and its fields. - [@ifloom/audio](https://ifloom.dev/docs/api/audio): Every export of @ifloom/audio, the audio player: its signature and its fields. - **CLI** - [@ifloom/cli](https://ifloom.dev/docs/api/cli): Every export of @ifloom/cli, the command line's parts for scripts: its signature and its fields. - [@ifloom/cli/game](https://ifloom.dev/docs/api/cli-game): Every export of @ifloom/cli/game, the game module's entry: its signature and its fields. - [@ifloom/cli/vite](https://ifloom.dev/docs/api/cli-vite): Every export of @ifloom/cli/vite, the Vite preset: its signature and its fields. - **Plugins** - [@ifloom/plugin-achievements](https://ifloom.dev/docs/api/plugin-achievements): Every export of @ifloom/plugin-achievements and its /react subpath: its signature and its fields. - [@ifloom/plugin-calendar](https://ifloom.dev/docs/api/plugin-calendar): Every export of @ifloom/plugin-calendar and its /react subpath: its signature and its fields. - [@ifloom/plugin-cast](https://ifloom.dev/docs/api/plugin-cast): Every export of @ifloom/plugin-cast and its /react subpath: its signature and its fields. - [@ifloom/plugin-debug](https://ifloom.dev/docs/api/plugin-debug): Every export of @ifloom/plugin-debug and its /react subpath: its signature and its fields. - [@ifloom/plugin-devices](https://ifloom.dev/docs/api/plugin-devices): Every export of @ifloom/plugin-devices and its /react subpath: its signature and its fields. - [@ifloom/plugin-feed](https://ifloom.dev/docs/api/plugin-feed): Every export of @ifloom/plugin-feed and its /react subpath: its signature and its fields. - [@ifloom/plugin-generators](https://ifloom.dev/docs/api/plugin-generators): Every export of @ifloom/plugin-generators: its signature and its fields. - [@ifloom/plugin-inventory](https://ifloom.dev/docs/api/plugin-inventory): Every export of @ifloom/plugin-inventory and its /react subpath: its signature and its fields. - [@ifloom/plugin-jobs](https://ifloom.dev/docs/api/plugin-jobs): Every export of @ifloom/plugin-jobs and its /react subpath: its signature and its fields. - [@ifloom/plugin-messages](https://ifloom.dev/docs/api/plugin-messages): Every export of @ifloom/plugin-messages and its /react subpath: its signature and its fields. - [@ifloom/plugin-places](https://ifloom.dev/docs/api/plugin-places): Every export of @ifloom/plugin-places and its /react subpath: its signature and its fields. - [@ifloom/plugin-quests](https://ifloom.dev/docs/api/plugin-quests): Every export of @ifloom/plugin-quests and its /react subpath: its signature and its fields. - [@ifloom/plugin-shop](https://ifloom.dev/docs/api/plugin-shop): Every export of @ifloom/plugin-shop and its /react subpath: its signature and its fields. - [@ifloom/plugin-statuses](https://ifloom.dev/docs/api/plugin-statuses): Every export of @ifloom/plugin-statuses and its /react subpath: its signature and its fields. - [@ifloom/plugin-unlocks](https://ifloom.dev/docs/api/plugin-unlocks): Every export of @ifloom/plugin-unlocks and its /react subpath: its signature and its fields. - [@ifloom/plugin-wardrobe](https://ifloom.dev/docs/api/plugin-wardrobe): Every export of @ifloom/plugin-wardrobe and its /react subpath: its signature and its fields.