Code view and preview
- The duration bars (effect bars) to the right of the line numbers in the code view draw, for the whole file, 3px vertical lines showing from which line to which line the background, BGM, looping sound effects and sprites last
(
GET /sweep/stage). The minimap at the right edge covers the whole file too. Click a bar to go to the line where it starts. Each column of bars is drawn inside boxes of equal width, so bars in the same column join up at the same horizontal position and width on every line, regardless of whether other columns have bars, the start and end marks, or wrapped lines - Point at a bar, the minimap or a card (background and sprite commands) to see the range in a peek window, along with the background image for a background, or for a sprite, the variant at that line and the sprite set’s image (looked up from the characters). Backgrounds are 16:9 at 480px wide, and sprites are 420px high (aspect ratio 3:4); if they don’t fit on screen, they shrink to the screen height or width, keeping the ratio. Until the image loads, an area of the same size is shown first (so the window doesn’t jump). The window is placed at the bottom right of the pointer, moves left or up if it would stick out, and if it fits neither way, moves toward the side with more room, staying within 8px of the screen edges. BGM and sound effects show only the name and the range. Images that are loading or can’t be loaded, and variants the character doesn’t have, are labeled as such
- Completion (command names, parameters, values) and the inputs of card forms are built from the command specs. For asset parameters, assets used in this file are suggested first,
followed by those in the asset folder (images are shown shrunk; sounds by name only). “Add from file” lets you choose a file on your computer,
adds it to the asset folder of that parameter (or the
folder=folder if given), and uses it as the value right away. “Show in folder” in the parameter form on the right selects the asset in the Finder or Explorer (on Linux, it opens the folder). If you write an asset that isn’t in the asset folder, the syntax check while typing tells you without waiting for a save. For choice lines, it completes the jump target and the parameters after it (if=and the look; the spec isCHOICE_OPTION). Parameter names aren’t suggested while you are typing inside"…"and(…) - In the code view, pressing Enter after a line of dialogue suggests the previous speaker and the other person who spoke before them. Choosing one (with Tab and so on) inserts
speaker「」(speaker ""when the original language is English), so you can type inside the brackets. It also suggests them when you split a line of dialogue in the middle, and choosing one closes the previous line and puts the rest of the text into the next line of dialogue. If you don’t choose a suggestion, nothing changes except the line break. The existing speaker completion at the start of a line lists the speakers within 30 lines before and after in the same scene, nearest first (it looks past branches and right after them as the same scene, and stops at labels, scene changes, and@jumpand@returnin the same flow; the suggestions after Enter work the same way), and then the others in order of how many lines of dialogue they have across all scripts. For the file being edited, its unsaved content is used. With touch on a phone, the speaker bar above the keyboard is used as before. - Choice lines with a condition (
if=) get a condition card in the right margin (“if expression” with a dashed border). Clicking it doesn’t open a form - The timeline draws this page’s effects from the command lengths and “whether to wait until done” (
waitsin the command’s spec; awaitwritten takes priority). When the cursor is on a command line, a mark is placed at the point when that command has finished running (for a command that waits, when it ends; for one that doesn’t, when it starts), and the commands and text after it are faded - The language selector in the row of controls below the preview (only when
languagesinliminalia.jsonhas two or more) shows the preview in a translated language (remembered per browser and per project). Choosing one reloads the player with?studio=1&lang=<language>and asks again for the screen it was showing. The player passes it toSystemEnv.languageof the system screens, and the standard system screens use it ahead of the config language and the device language (the translations of text, choices and speaker names, and assets per language; translations are written inlang/<language>.jsonunder “Translation” in the project). Nothing is saved to the script or the game data - The device selector in the row of controls below the preview lets you try PC (landscape, portrait) and phone (landscape, portrait) screens. PC is drawn as a screen whose long side is 1280 (the game’s aspect ratio if the orientation matches the game, 16:9 / 9:16 if not). Phone is drawn at roughly the screen size of an iPhone, leaving margins for the notch and home bar,
and shows the touch device UI (the menu button at the top right, hiding the quick menu at the bottom, the notice shown when a landscape game is held upright) (the player’s
?device=phone) - The preview shows that page for text and choice lines (“Line N” in the row below), and for command lines (effect commands,
@set, labels and so on) the screen right after that line runs, before the text (“Right after line N”). The state panel also shows the variables right after it. The route is shown below the preview. For empty lines and comment lines, it shows the nearest earlier line that has a state - The row below the preview holds the preview’s control buttons. The keys work even when the preview has the focus (when the writer has clicked the preview)
- Pause (⌘⇧P; press again to resume): freezes the preview on the current screen. Sound (BGM, sound effects, video) and moving effects (animations,
text display, auto, waits) stop, and clicking the preview doesn’t move it forward. “Paused” appears at the top right of the preview. While paused, moving the cursor
doesn’t rebuild the preview, and refetching the current position data (
GET /sweep) stops too (the state and the timeline are drawn from the state already fetched). Resuming shows the cursor line at that moment again and does the refetching that was held back. Also useful in heavy projects to stop the preview from moving on every keystroke. The paused state isn’t remembered (reopening starts it moving) - Mute (⌘⇧M): silences the preview without stopping it. It is remembered, so it stays silent even when the preview is rebuilt or reopened
- Enlarge (“Enlarge” in the preview heading, or ⌘⇧B; once pressed, it changes to “Normal size”): widens the right panel to make the preview larger (the timeline and the state at this line go below it; the script gets narrower). Remembered
- New window (the icon in the row of controls): shows the preview in a separate window. It expands to fit the window, and the cursor line, pause, mute and cursor sync keep working. In the panel, “Show window” brings the preview window to the front, and “Bring back” brings the preview back to the panel. Closing the window also brings it back to the panel. While in a separate window, the full screen button is hidden (make the window itself full screen)
- Full screen (⌘⇧Enter): shows only the preview (with its row of controls) full screen, centered at the largest size that fits with the game’s aspect ratio. Esc returns
- Screenshot (the camera icon in the row of controls; there is no key): captures the screen the preview is showing at the game’s size (
screeninliminalia.json, not the shrunk size of the preview), without Studio’s decorations (the line display, the “Paused” label and so on), and saves it inexports/shots/<file>-<line>.png(/ in nested file names becomes _; if the name exists, -2, -3… is added, never overwriting). What it captures is the screen last requested from the preview (for text and choice lines, that page fully displayed; for command lines, the screen right after), and if you moved the preview forward by clicking, the page it reached (named after that line too). The button can’t be pressed while capturing. When saved, the location appears in the status bar, with “Open folder” in the desktop app (opens Finder or Explorer with that file selected) or “Download” in a browser. How it captures is described in “Screenshots and performance measurement” below. Nothing is saved to the game data - Cursor sync (⌘⇧J; press again to turn off): when the preview moves forward by itself (the writer clicked the preview, auto, skip, or a choice), the script cursor moves
to the line of the page the preview started showing (for choices, that choice). If it moved on to another file with
@jumpor similar, that file opens. The cursor line it moves to doesn’t rebuild the preview (so the preview you moved forward doesn’t start over). Input isn’t moved to the script, so you can keep clicking the preview to move forward. It doesn’t move while you are typing in the script (when the script has the focus), while paused, on the Check screen, or while the change history panel or the panel for choosing between conflicting changes is open. When skip moves through several pages, it moves only to the last line. Moving the cursor from the script makes the preview show that line again as usual, and cursor sync continues from there. At a line it moved to, the state panel, route and timeline are drawn from the state actually reached in the preview (not the state at that point along the route). The line display below the preview becomes “Line N (preview state),” and the state panel gets the “State at this line (preview)” label. The route, as “Route (preview),” is the route up to the page the preview was asked to show plus the choices made in the preview, with marks on the choices made in the preview. Where a variable comes from (”← start 133”) is the line that set it in the preview if there is one, or, if the value is the same as at the page the preview was asked to show, where it came from at that page. When the system screens don’t report the line that set a value (SystemEnv.onAssignisn’t passed to the runner), a changed variable shows just ”← preview.” Moving the cursor from the script returns to the state at that point as usual. Whether it is on is remembered - Checks on screen (including cursor sync) are in
packages/studio/dev/verify.ts(dialogue per speaker, endings, saving themes, plugin checks and the English interface are inpackages/studio/dev/verify-lists.ts, which startslim studioon port 5313 to check; Play from Here, confirm before leaving, Go to Jump Target, Lines Leading Here and undo on screens are inpackages/studio/dev/verify-nav.ts, port 5315; scene actions, Move to another file, building on the flowchart, all-routes test progress, the breakpoint list, the preview language and overflowing pages are inpackages/studio/dev/verify-structure.ts, port 5316; find and replace in the block view, the scope and speaker of search across files, scene tags and status, text and tags in ⌘K, Go to Macro Definition, the lines using a macro and renaming a macro, TODO comments and the character count in the heading are inpackages/studio/dev/verify-find.ts, port 5319, which also measures speed on a large project with--project <copy> --file <large file> --word <word>; search from the desktop app’s menu is inpackages/studio-desktop/scripts/find-check.ts; replace in all files, “Delete all” and “Fix all,” undo on the settings screens (including the “takes effect after a restart” bar) and the change history of liminalia.json are inpackages/studio/dev/verify-undo.ts, translation on the Project screen (translations whose original changed, system screen text) is inpackages/studio/dev/verify-i18n.ts, and reloading a test play, “Open this page in the script” and runtime problems are inpackages/studio/dev/verify-test-play.ts; both start a dev server on a free port), and full screen and keys in the desktop app (Electron) are checked withnpx tsx packages/studio-desktop/scripts/stage-check.ts [--shots folder]
- Pause (⌘⇧P; press again to resume): freezes the preview on the current screen. Sound (BGM, sound effects, video) and moving effects (animations,
text display, auto, waits) stop, and clicking the preview doesn’t move it forward. “Paused” appears at the top right of the preview. While paused, moving the cursor
doesn’t rebuild the preview, and refetching the current position data (
- Breakpoints: click to the left of a line number to add a red mark (click again to remove it). When the preview is moving forward (clicks, auto, skip, choices)
and reaches that line’s command, the preview stops before running it (in the block view, add and remove them with “Breakpoint” in a line’s right-click menu). The script cursor moves to that line, and the state panel shows the state reached up to there.
In the block view, the line where it stopped is centered, with a red border and “Stopped here” (it disappears on resuming).
Press “Pause” again (⌘⇧P) to continue from that command. While stopped, “Step” appears in the row of controls below the preview; click it to run that command and
stop again before the next command (
stage-step). Adding lines above it keeps it on the same line. Rebuilding to show a requested line in the preview doesn’t stop at breakpoints (the messages to the preview arestage-breakpointsandstage-break, and the runner usesRuntimeOptions.beforeStep)- How they are remembered: in
breakpointsin the project’s.liminalia/studio.json, by line number, the line content (without leading and trailing spaces) and its hash (model/breakpoints.ts; older localStorage entries with only line numbers are remembered again using the line content when loaded). On opening and on startup, as with comment threads, they look for a line with the same content (the one nearest the original line if there are several), or else a similar line, and reattach there, so lines don’t shift even if the script is edited elsewhere. Those whose line can’t be found stay in the list with “(line not found)” - The list: when there are breakpoints, “Breakpoints N” appears in the row of controls below the preview. Click it to see a list of file and line, line content, a condition field and a remove button; click a row to go to that line, or “Remove all” to remove them all
- Conditional: write an expression in a condition field of the list (such as
game.n == 1; the same syntax as@if) and press Enter, and it stops only when the expression is true (empty stops every time). The preview’s runner evaluates the expression before that command, and stops if the expression can’t be read or evaluated (so you notice typos)
- How they are remembered: in
- Change history (the button above the script) shows the previous content kept on each save (recent saves in detail, older ones thinned more coarsely; see “Principles” below). Choose an entry in the list to see its differences from the current content (including edits not yet saved) line by line, and “Restore this content” replaces the current content with it and saves. The content before restoring is also kept in the change history, so a restore can be undone too (⌘Z undoes it as well). It can’t restore read-only files