LiminaliaLiminalia
Technical docs: Writing scenarios: What the syntax check checks

What the syntax check checks

Open in Claude (new tab)

What it checks

The main checks, by category.

Syntax

codeSeverityContents
bad-encodingErrorA script can’t be read as UTF-8 (saved in Shift_JIS and so on; it isn’t read garbled. Save it again as UTF-8). lim check gives no other diagnostics for that file, and lim trace and lim coverage stop at that file
bad-labelErrorA malformed label: written without a space as in #name (correctly # name), or a name with characters other than letters, digits, _ and -
bad-command-nameErrorA command name with characters other than lowercase letters, digits and - (@Bg, {@ bg} and so on)
bad-define bad-paramErrorA malformed @define (not @define name(parameter: type = default, …)), a malformed parameter
nested-define nested-useError@define and @use not at the outermost level of the file
bad-set bad-set-target bad-letErrorNot in the form @set variable = expression, the left side of @set isn’t a variable, not in the form @let name = expression (both can use = += -= *= /=)
bad-guardErrorif= on lines with words that open blocks (@if @while @for @with @choice @define and so on) and in {@…} in text, and if= not written in (…) (if=game.x is fixed to if=(game.x); chapter 8)
bad-forErrorNot in the form @for name in expression, the first part of a variable name such as game used as the @for name, or looping over a value that is neither an array nor a dictionary, such as a literal number or string (chapter 8)
bad-function nested-function duplicate-functionErrorNot in the form @function name(argument, …) = expression (the block form up to @end is reported once, and if its body is a single @return, the one-line form is the suggested fix), not at the outermost level of the file, the same name as a built-in function or another @function (chapter 8)
bad-useErrorNot in the form @use file
bad-option empty-optionErrorA line inside @choice that isn’t - text -> target, a choice without text (except one with image=, which makes an image button, or with width= and height=, which make a click area)
bad-targetErrorA jump target that’s none of #label, file and file#label, or something other than to= after a jump target written as an expression
missing-expressionErrorAn empty expression in @if and so on
unclosed-string unclosed-paren missing-value unexpected-argumentErrorAn unclosed "…" or (…) in a parameter, no value after name=, a parameter written on a command that takes none
bad-color bad-size bad-speed bad-image bad-fxErrorA mistake in {c #color …} {mark #color …}, {size 32 …}, {speed 600ms …}, {img path} or {fx wave …} in text (chapter 3)
duplicate-labelErrorThe same label twice in the same file
unclosed-block orphan-end orphan-branch branch-after-elseErrorAn unclosed block such as @if @while @with @choice @define, or an @end @elif @else without a matching block
bad-with bad-content bad-returnErrorA malformed @with, @content outside @define, or a @return (expression) that can’t return a value (chapter 8)
with-without-contentWarningA macro without @content called with @with (chapter 8)
label-in-ifErrorA label inside @if (chapter 8)
stray-brace unclosed-inline unknown-inline dangling-escapeErrorUnmatched {…} in text, unknown syntax, \ at the end of a line
noclick-not-last noclick-in-optionError{noclick} that isn’t at the end of a line, {noclick} in choice text (chapter 3)
bad-speaker-nameErrorA mistake in a display name {name …} (empty, something other than characters and {= expression}, no dialogue bracket or quotation mark right after it; chapter 2)
empty-ruby bad-rubyErrorEmpty base text or reading in ruby, or no | separating the reading, or a full-width | (chapter 3)
aozora-ruby tyrano-tagWarning《》 ruby and TyranoScript tags ([p] [l] [r] [cm] [er]) left in the text. They’re shown as is
unknown-speakerWarningA line shaped like dialogue that became narration (including ユイ:「…」 【ユイ】「…」, {name …} on a name that isn’t a speaker, and Nora: "…" on two or more lines of the same file; chapter 2)
fullwidth-symbol option-outside-choiceWarningA full-width @ # // at the start of a line, a full-width =, a choice line outside @choice (chapter 2)
trailing-commentError, warning// at the end of a line (an error on command and choice lines, a warning on dialogue and narration; chapter 2)
duplicate-line-id bad-line-idError, warningA fixed line ID used twice in the same file, a #line: with characters other than letters, digits, _ and - (chapter 2; a #line: that isn’t a line ID is shown as text)
invisible-spaceWarningInvisible characters (see below)

Commands and parameters

codeSeverityContents
unknown-commandErrorAn unknown command. If it’s a macro in another file, @use appears in the suggested fix
renamed-commandErrorA command with a name from an earlier version (@scene is now @scene-change). The suggested fix replaces it with the current name, and lim migrate fixes the whole project (“Script format versions” in chapter 10). Not reported if there’s a macro with the same name
renamed-paramWarningA parameter with a name from an earlier version (@bg x.jpg fade=1s is now time=1s). It keeps working under the old name. The suggested fix replaces it with the current name, and lim migrate fixes the whole project (“Script format versions” in chapter 10). Parameters of a macro with the same name aren’t reported
legacy-endingWarningIn a project with script format 2 or earlier, wording written in ending= of a command that ends the playthrough (ending="BAD END"), the earlier way. The suggested fix splits it into the kind and title=, and lim migrate moves the whole project (“The end of a playthrough” in chapter 2)
unknown-ending-kindErrorAn ending kind that doesn’t exist (from script format 3; the suggested fix is the closest kind name, or for wording, the kind and title=). A kind in playtest.avoidEndings or endings() in an expression that matches nothing is a warning
unknown-param missing-param too-many-positionalErrorAn unknown parameter, a missing required parameter, too many unnamed parameters
ambiguous-bool-shorthandErrorA boolean written as just its name could also be read as the value of an unnamed parameter. Write the boolean as name=true
positional-by-nameErrorAn unnamed parameter written with a name
duplicate-paramErrorThe same parameter written twice
bad-effect-maskErrorThe mask= of @filter or @effect can’t be read ("radial x y width height" or "radial-out x y width height soft", all in px)
flipbook-frames flipbook-dataErrorA mistake in how the frames of @flipbook are written (neither image nor data, {n} in image but no frames, and so on), the JSON of data= doesn’t exist
flipbook-missingWarningFrame images of @flipbook aren’t in the asset folder
flipbook-loop-wait flipbook-off-unknownWarningwait=true written on loop=0 (repeat until stopped; it moves on without waiting), no @flipbook loop=0 has the name of @flipbook-off in its name=
effect-mask-ignoredWarningmask= on a @effect type that can’t be limited to an area (wave, glitch, chromatic; it covers the whole screen. Choose where it applies with layer=)
flash-rateWarningA @flash that flashes more than 3 times a second (counted from count, time, gap and the project defaults; flashing light can cause seizures)
hide-name-unknownWarningNo @cutin stay=true, @hud-text or @hud-button shows the name given to @cutin-hide, @hud-text-off or @hud-button-off (nothing is hidden). Not checked for a kind whose names are given as expressions
bad-valueErrorA value of the wrong type (a duration without a unit and so on). The suggested fix is the line with only the value fixed
redundant-paramErrorA parameter that isn’t used when written together with another (at when both x and y are written, and so on)
same-as-defaultInfoA parameter with the same value as the project default (commandDefaults in liminalia.json; 500ms and 0.5s are the same). With a fix that removes it. Values equal to a command’s built-in default aren’t reported
scene-change-candidateInfoA block from @mask to @mask-off that does the same as one @scene-change (see “Merging into a scene change” below). With a fix that turns the block into one line
scene-change-sprite-overlapWarningThe previous sprites haven’t finished disappearing when the fade-in starts, so they may be seen faintly. The suggested fix is a @scene-change that finishes hiding them while the screen is covered and then fades in (fixing it changes how they disappear)
chara-replace-conflictErrorreplace on @chara conflicts with a position or with hiding everyone
chara-replace-unknownErrorThe character written in replace isn’t in cast.json
chara-replace-targetErrorThe character to replace isn’t on screen, there’s more than one character at that position, or the character to show is already on screen
bad-expression unknown-variable unknown-function bad-argumentsErrorA mistake in an expression, an undefined variable, an unknown function (if it’s a @function in another file, @use appears in the suggested fix), the wrong number of function arguments
unset-variable undeclared-variableWarningA variable that’s read but never given a value anywhere, when a variable that is given a value has a similar spelling (it’s taken as a misspelling, and that name is the suggested fix), a variable not written in variables when check.variables is "declared" (chapter 8)
uninitialized-variableWarningReads a variable with no initial value that is only calculated from its previous value with += and the like (reaching that line before it’s added to reads it with no value; chapter 8). The fix is an initial value in variables (for temp., set a value with = first). Also a line that calculates a local variable from its previous value with @let x += 1 and the like before any value is set (the fix is @let x = 0 on the line before)
forbidden-propertyError__proto__ or similar used in a variable name and so on
shadows-param duplicate-defineErrorA @let with the same name as a macro parameter, two macros with the same name
define-shadows-commandWarning, errorA macro with the same name as a built-in command (the project’s macro is used; warning), a macro with the same name as a syntax word (error)
unknown-typeErrorAn unknown type for a @define parameter
plugin-replaces-commandWarningA plugin command overrides a built-in command, or a command with the same name from a plugin loaded earlier (such as the standard commands), without declaring it (replaces: true)
script-not-allowed script-skippedError, warning@script in a project without allowScript (error). Even in a project with it, the contents of @script don’t run (warning; rewrite them as plugin commands)
staff-roll-emptyWarningA @staff-roll with no content (chapter 5)
html-tag-not-allowed html-attribute-not-allowed html-event-attribute html-dynamic-attributeErrorA tag that can’t be used in @html (<script> and so on), an attribute that can’t be used, an on… attribute, {= expression} in an attribute that can’t take expressions (chapter 5)
html-external-url html-empty-srcErrorAn external URL in @html, an empty src=
html-unclosed-tag html-bad-nestingErrorAn unclosed tag in @html, badly nested tags
html-inlineError{@html …} in text (@html is written on the lines up to @end)
html-empty html-wait-without-jump html-jump-without-waitWarningAn @html with no content, wait=true without any element that jumps when pressed, data-jump without wait=true

Jump targets

codeSeverityContents
unknown-label unknown-fileErrorAn unknown label, an unknown file
unknown-targetsWarningThe candidates of a jump target decided by an expression can’t be read, and there is no to= (chapter 8)
all-options-conditionalWarningEvery choice has if=, so none might be shown and the game might stop (chapter 8)
unknown-optionWarningThe choice with the text in chosen("text") isn’t in any scenario (it’s always false; chapter 8)
call-without-returnWarning@return can’t be reached from where @call goes (it stops at the end of the file and doesn’t return to the caller). Not reported when it moves elsewhere with @jump or a choice on the way
unreachable-lineWarning, infoLines without a label after @jump, @return, @stop or a command that ends the playthrough (they can’t be reached from anywhere). A warning if the unreachable lines include dialogue, narration or choices, info if they’re only commands
unused-labelInfoA label that’s never jumped to and isn’t continued into from the line before (the scene can’t be reached). "#label" in expressions, entry and replays in liminalia.json, and targets in plugin data also count as jumps
scene-start-no-bgInfoA scene (a label or the start of a file) reached from another file by @jump or a choice doesn’t set the background (@scene-change or @bg with a background image, or a solid-color background) before its first text. It starts on the previous file’s screen, which differs from playing it from that point. A @scene-change without an image (the template for scenes made in the Studio) doesn’t count as setting the background. Not reported when every jump into it sets the background just before jumping (before the @if too, when jumping from inside one), or for @call, call=true choices, expression targets, and scenes that start with @if or a macro, draft files, and works that use no backgrounds
unused-define unused-speakerInfoA macro that’s never called, a speaker not used in any dialogue (shown on that speaker’s line in speakers in cast.json; speakers listed in check.unusedSpeakers in liminalia.json are left out)
draft-targetWarningA file that isn’t a draft goes to a draft file (// lim: draft, chapter 10). Drafts aren’t exported, so the check before lim build treats it as an error
draft-useErrorA file that isn’t a draft uses a draft file with @use (the exported game doesn’t have that file’s macros and functions)
draft-entryErrorentry (New Game), afterLoad, or the target of a replay or chapter in extras in liminalia.json points to a draft file (the exported game stops there)

Characters

codeSeverityContents
unknown-cast unknown-appearance unknown-variant unknown-positionErrorA character, sprite set, variant or position that isn’t in cast.json
unknown-toneErrorAn unknown color tone
bad-castErrorA malformed cast.json (including a character’s side other than left or right; chapter 6)
cast-ambiguousWarningThe base variant or default sprite set falls to the order they’re listed in (chapter 6)
model-plugin-missingWarningThe plugin that draws a model type in cast.json (live2d, spine) isn’t loaded and isn’t in plugins in liminalia.json, or a close misspelling of a type (Live2D). The game shows the image sprite (live2d-spine.md)
chara-reshowWarningThe same character is shown again after their sprite was hidden, with no text in between (it disappears and appears again, so it flickers). When hiding everyone and the show right after can be made one @chara … clear=… with the same effect, that’s the suggested fix. Depending on the case, such as hiding a single character, a suggested fix that deletes the line that hid it is also given. Not reported when the sprite set changes, when the character moves in or out with enter exit, or with a background change, a fade to black, a movie or @wait between hiding and showing again (chapter 6)
chara-hide-per-lineWarningHiding everyone with @chara-hide-all and showing them again within every 2 lines of dialogue, 3 or more times in a row (chapter 6)
chara-soloInfo@chara on the line right after an @chara-hide-all while someone is on stage. Comes with a suggested fix that makes them one line, @chara … solo=true (for fixing the one-at-a-time style all at once; lim check --fix chara-solo). Not reported when the hide-all has anything other than time, when the character moves in, when a character on stage is shown again with the position or variant left out, or when it can’t tell whether the character is on stage (chapter 6)

Assets and project settings

codeSeverityContents
missing-assetErrorAn asset file that doesn’t exist
asset-not-exportedWarningA reference to a kind of file that isn’t exported (an extension not in the table of assets)
redundant-cg-unlock unshown-cgInfo, warningA @cg-unlock that isn’t needed because showing the CG unlocks it, a CG that no scenario shows or unlocks (it can’t be seen in the extras)
font-no-vertical-metricsWarningThe font for vertical text has no vertical advance widths (vmtx)
asset-case-mismatchErrorAn asset name differs from the file name only in upper and lower case (it opens on Mac and Windows but can’t be read on Linux servers or phones). It’s compared against the real names in the folder, and the suggested fix replaces it with that name
lfs-pointerErrorA referenced asset is still a Git LFS pointer (its content hasn’t been fetched, so it can’t be shown or played). Reported at the first reference of each asset. The fix is git lfs pull (in CI, lfs: true on actions/checkout)
missing-voiceWarningA voice file that doesn’t exist (only for speakers with a single @voice-auto pattern)
bad-configError, warningliminalia.json or cast.json can’t be read as JSON (the line and column are shown), a mistake in a variables name or in the value of saves.location (that item isn’t used; chapter 10), a malformed check.sound (a scene in quiet that doesn’t exist is a warning; “Gaps in sound” below)
unknown-config-keyWarningAn item not in the schema in liminalia.json, cast.json or a translation file (it isn’t used). The suggested fix is an item with a similar spelling (chapter 10)
newer-formatWarningformat in liminalia.json (the version of the script format) is newer than this engine’s format version (a script written with a newer engine; “Script format versions” in chapter 10)
bad-ui bad-items bad-extra bad-after-loadErrorA malformed ui items extra afterLoad in liminalia.json
unknown-nvl-styleErrorThe look name in @nvl on style= isn’t in ui.nvlStyles in liminalia.json (chapter 4)
bad-command-defaultsErrorA mistake in commandDefaults in liminalia.json (an unknown command or parameter, a value of the wrong type; that value isn’t used; chapter 5)
bad-chapters chapter-filesError, warningMalformed chapters in liminalia.json, a file pattern that matches no scenario, or a file in two chapters (chapter 10)
bad-auto-layoutErrorMalformed autoLayout in liminalia.json (a number of positions that doesn’t match the number of characters, an unknown enter or exit, a byCount key that isn’t a headcount or an empty name), or a position name that isn’t in any sprite frame (the written side of byCount too; chapter 6)
chapter-card-emptyWarningA @chapter-card or @chapter-end with no number or title in a script file that isn’t in any chapter (a blank card appears; chapter 10)
not-in-chapterInfoIn a project that uses chapters, a script file reached from the start with text that isn’t in any chapter (the chapter heading in save slots and chapter() are empty; chapter 10)
unknown-itemErrorAn item that isn’t in items
not-in-extraWarningA command that unlocks a name that isn’t in the extra lists
missing-translation bad-translationWarning, errorA translation file doesn’t exist, or can’t be read as JSON (the line and column are shown)
translation-lost-command unused-translation stale-translationWarning, infoAn inline command in the original text is missing from a translation, a translation is unused, translations of original text that’s no longer in the scenario are left in stale
untranslatedInfoThe number of untranslated items (items with an empty translation and items not yet in the translation file: text lines, choices, command text, project settings text)
outdated-translationInfoThe number of items whose original changed after translation (lines with a fixed line ID; the translation of the earlier original is shown). lim i18n --export xliff --changed exports them (chapter 10)
voice-unlocked voice-lock-outdated voice-lock-duplicateWarning, errorMistakes in locked voice numbers: a line with no number (it doesn’t play), a number for a line that’s no longer in the scenario, the same number given to more than one line (chapter 10)
bad-voice-lockErrorvoice-lock.json can’t be read as JSON
ui-css-missingErrorA file listed in ui.css (the work’s CSS) in liminalia.json doesn’t exist (shown on that line of ui.css)
ui-css-syntaxErrorThe work’s CSS can’t be read (an unclosed comment, quote or bracket; shown on that line of that file)
ui-css-assetErrorA file that a url() or @import in the work’s CSS points to doesn’t exist (looked up relative to the CSS file)
ui-css-outsideErrorA url() or @import in the work’s CSS points outside the work (an absolute URL like http:, a path starting with /, or above the work’s folder; it isn’t exported and can’t be read in the exported game)
bad-rules bad-scenesError, warningMalformed check.rules and scenes in liminalia.json (see below)

Screen templates (ui.templates)

Standard screen templates that a project copied and edited (screen-templates.md) are checked against the standard template and the rules of that screen (the part names, the values of data-role and data-field, and the data-role values the screen needs). Problems in liminalia.json go on the line of that screen in ui.templates, and problems inside a template go on the line of that file.

codeSeverityContents
template-missingErrorA file registered in ui.templates doesn’t exist or can’t be read (the standard screen is shown as is)
template-unknown-screenWarningA screen name in ui.templates isn’t a screen that can be made with a template (it isn’t used). Shows a name with a similar spelling, or the screens that can be made
template-overriddenWarningA plugin’s screens.* (also system, and the screens.* of the chosen theme) replaces the same screen, so the template isn’t used. Only what can be read from how the plugin’s ./web is written is checked
template-unknown-partWarningA part name (data-part) in the template isn’t in that screen, a <template> has no data-part, or the file has no parts and no <style> (it isn’t used)
template-unknown-valueWarningA value of data-role, data-field, data-text or data-setting does nothing in that screen (pressing does nothing, no text goes in). Shows a value with a similar spelling
template-missing-roleErrorA data-role the screen needs is missing (none of close, cancel and ok to close it, no ok in the confirmation screen, and so on). Checked on the whole screen, with the project’s parts placed over the standard parts
template-list-itemErrorA data-list in a part has no data-item, or the data-item part doesn’t exist (the rows of the list can’t be made)
template-unsafeWarningThe template has something the game removes at run time (elements such as script, attributes starting with on, outside URLs, links to other pages, @import), so it doesn’t work
template-outdatedWarningThe version a part was copied from (its data-version) is older than the standard’s current version, or has no version (the standard template changed). Shows the part name and the standard’s current version, and points to lim screens diff <screen>
template-script-exportWarningThe screen JS (the .js next to the template with the same name; ui/screens/<screen>/<screen>.js when no template is registered) has no export default (it does nothing when loaded)
template-script-unknownWarningThe screen JS uses something the screen api doesn’t have (such as api.answer), or an api.press value that does nothing in that screen. Only checked when the parameter is named api. Shows a similar name

Project data (data declared by plugins)

Project data whose shape a plugin declares (the .json files in paths.data; docs/plugins.md) is checked against the declaration.

codeSeverityContents
data-missing data-type data-duplicateErrorA required item is missing, a value has the wrong type, the same id appears twice
data-bad-exprErrorA condition expression in the data can’t be read
data-missing-asset data-unknown-cast data-unknown-scene data-unknown-refError, warningAn asset, character, scene or other item referred to in the data doesn’t exist
data-flag-unset data-flag-unreadWarning, infoNo script or data sets a flag the data reads, nothing reads a flag the data sets
unknown-data-keyErrorThe value of a plugin command’s data-name parameter (t.dataKey) isn’t in the project’s data (also when the data file doesn’t exist, or when the path the parameter reads isn’t in the file)
unknown-investigation unknown-codex-entryErrorThe name for a standard investigation (@investigate) or codex (@codex-unlock and so on) isn’t in the project’s data (data/investigation.json, data/codex.json). Also when a view or section name doesn’t exist. Found while running, it’s a runtime diagnostic (a warning for the codex)
map-spot-hiddenWarningThe middle of a spot’s press area on a map choice screen (@map-choice) is under the details panel (panel), so it can’t be pressed. Move the spot out from under the panel, or put panel on a side that doesn’t cover it

Plugins

codeSeverityContents
plugin-loadErrorA project plugin can’t be loaded (the package doesn’t exist, a syntax error and so on; the reason is given). Studio and lim studio open without that plugin, and reports that its commands are undefined are gathered into the hint of this diagnostic
plugin-check-failed plugin-check-invalidErrorA plugin’s check threw, or returned something that isn’t an array of diagnostics or diagnostics with the wrong shape (the other checks run to the end)
plugin-api-version plugin-engine-versionWarningA plugin uses a newer interface version than this engine (apiVersion of defineCommandPlugin, and liminalia.api and engines.liminalia in package.json; “Declaring compatible engines” in plugins.md)
theme-engine-versionWarningengines.liminalia of a theme in the project (themes/<id>/theme.json) doesn’t match this engine’s interface version (some of the look may not show)
engine-versionWarningengines.liminalia in liminalia.json (the engine interface versions the game or template works with) doesn’t match this engine
plugin-function-clashWarningA plugin’s expression function has the same name as a built-in function, so it isn’t used