# Writing scenarios

## 10. Project files

| File | Contents |
|---|---|
| `liminalia.json` | Placed directly in the project folder. The items are in `packages/project/src/index.ts` |
| `cast.json` | Speakers and characters (sprite definitions) |
| `voice-lock.json` | Locked voice numbers (`paths.voiceLock`) |
| `lang/<language>.json` | Translations |

Asset paths are checked for existing files by the syntax check before exporting.

**Mistakes in the settings JSON.** If `liminalia.json`, `cast.json` or `lang/<language>.json` can't be read as JSON, the line and column where it can't be read are shown with a message that explains it
(`liminalia.json:5:1 Can't read it as JSON: There can't be a , after the last item` and so on; it tells apart a trailing `,`, a missing `,`, comments and `'…'` strings. `bad-config`, `bad-translation`).
A mistake in a `variables` name or in the value of `saves.location` in `liminalia.json` doesn't stop everything; only that item isn't used, and the syntax check treats it as an error (`bad-config`).
Items not in the schema aren't used even if written, so they're warned about, with an item with a similar spelling as the suggested fix (`unknown-config-key`; inside `ui`, `bad-ui` checks).
Mistakes in the shape of a value (`bad-ui`, `bad-chapters`, `bad-extra`, `bad-command-defaults`, `bad-config` for `check.sound` and so on) are shown on the line of the item with the mistake
(found by the settings path in the message, such as `ui.window.padding`, by `@command parameter`, or by the character name; if it isn't found, the first line of that item).
In `cast.json`, an unused speaker is shown on that speaker's line in `speakers`, and a missing sprite or a `model` with no plugin on that character's line.
When `voice-lock.json` can't be read as JSON, the line and column where it can't be read are shown too (`bad-voice-lock`). Studio's check shows the same, and
for a script that can't be read as UTF-8, only `bad-encoding` is shown (no diagnostics from the garbled content).

The list of items is available as JSON Schema (`liminalia.schema.json`, `cast.schema.json` and `lang.schema.json` in `packages/project/schemas`,
made from the types `ProjectConfig`, `CastEntry` and `TranslationFile` with `npx tsx packages/project/scripts/config-schema.ts`). The VS Code extension
applies them to `liminalia.json` and `cast.json` and shows completion and descriptions of the items. They're also on the site at `https://liminalia.skyta.dev/schemas/<name>.schema.json`.
`lim new` writes `"$schema"` with that URL at the top of `liminalia.json` and `cast.json`, and `lim i18n` does the same for translation files it creates (so other editors and AI assistants can look up the items too).
For a project made earlier, write `"$schema": "https://liminalia.skyta.dev/schemas/liminalia.schema.json"` and so on at the top of the file.

### Drafts (`// lim: draft`)

Writing `// lim: draft` in the comments at the top of a file makes it a draft.

```
// Chapter 3, unfinished
// lim: draft
# start
……
```

- It isn't exported (`lim build`), and doesn't count in the players' flowchart (`flow.json`) or the automatic CG list (`extra.cgAuto`)
- The all-routes test (`lim coverage`, Studio) doesn't run it and it doesn't count toward coverage
- Unreachable lines and unused labels (`unreachable-line`, `unused-label`) aren't reported
- The syntax check runs on it like any other file. The check before `lim build` doesn't count the diagnostics in drafts
- A line in a file that isn't a draft that goes to a draft is a warning (`draft-target`), and an error in the check before `lim build`
- A file that isn't a draft using a draft with `@use` is an error (`draft-use`). So is `entry`, `afterLoad`, or the `target` of a replay or chapter in extras in liminalia.json pointing to a draft (`draft-entry`), because the exported game stops there. In Studio, the `entry` file can't be marked as a draft
- It can be played in test play (`lim dev`, Studio)

The scene list in Studio shows "Draft" next to the file name, and "Mark as draft" and "Unmark as draft" in the file menu rewrite the mark at the top.

Drafts aren't a folder (`scenario/drafts/`) because moving a finished file out of the folder changes its name (the jump target `drafts/…`),
and every line pointing at it would have to be fixed. With a mark, the file name and change history stay the same.

### cast.json

```json
{
  "speakers": ["Yui", "Ren", "???"],
  "cast": {
    "Yuika": {
      "defaultAppearance": "uniform",
      "appearances": {
        "uniform": {
          "label": "Uniform",
          "variants": {
            "normal": {
              "image": "chara/yuika/uniform_normal.png",
              "frame": { "width": 440, "height": 680, "positions": { "left": { "left": 60, "top": 40 }, "center": { "left": 420, "top": 40 }, "right": { "left": 780, "top": 40 } } }
            },
            "smile": {
              "image": "chara/yuika/uniform_smile.png",
              "frame": { "width": 440, "height": 680, "positions": { "left": { "left": 60, "top": 40 }, "center": { "left": 420, "top": 40 }, "right": { "left": 780, "top": 40 } } }
            }
          }
        },
        "casual": {
          "label": "Casual",
          "variants": {
            "normal": {
              "image": "chara/yuika/casual_normal.png",
              "frame": { "width": 460, "height": 700, "positions": { "left": { "left": 50, "top": 20 }, "center": { "left": 410, "top": 20 }, "right": { "left": 770, "top": 20 } } }
            }
          }
        }
      }
    },
    "Ren": {
      "appearances": { "default": { "variants": { "normal": { "image": "chara/ren/normal.png" } } } }
    }
  }
}
```

The shape is the same as tatie's settings (`characters` in `settings.js`), except that a variant's image is written as `image` instead of `storage`.

**What to write for a character**

| Item | Contents |
|---|---|
| `appearances` | Sprite set name → `{ label, variants, layers, face }`. `label` is a name for display (optional). For a character without sprites (a speaker who only sets a name color, and so on), `{}` is fine |
| `defaultAppearance` | The default sprite set (optional) |
| `color` | Text color in the name box (a CSS color; optional). The color of the character whose ID or `speaker` matches the speaker name of the dialogue is used |
| `text` | How this character's dialogue text looks (optional). `{ "color": "#e8b4c8", "font": "Georgia, serif", "italic": true }`. Omitted items use the project's defaults. It also applies to the text in the backlog. Styling in the text such as `{c …}` comes first, and so do the read-page color (`ui.text.readColor`) and the font the player chose |
| `nameImage` | Name box image while this character speaks (a path from `image`; optional). `ui.name.image` if omitted |
| `windowImage` | Message window image while this character speaks (a path from `image`; optional). `@window-image` comes first. `ui.message.image` if omitted |
| `speaker` | The speaker name in the text. Write it when it differs from the character ID (it ties lip sync and the name color to the speaker) |
| `side` | The home side in the automatic layout by order of appearance (`left` or `right`; optional; chapter 6) |
| `lip` `blink` | Overlay images for lip sync and blinking (see below) |

**What to write for a variant (inside `variants`)**

| Item | Contents |
|---|---|
| `image` | A path from `assets/fgimage/` |
| `frame` | Position and size. `width` / `height` are the displayed size (px; 632×843 if not written). `positions` maps position names → `{ left, top }` (top-left coordinates). `flipAxis` is the axis the picture is mirrored around when the sprite is flipped (optional; see below) |
| `parts` | Written instead of `image` for layered sprites (see below) |
| `face` | The picture for the face window (a path from `assets/fgimage/`) |
| `cacheKey` | No need to write it (see below) |

Rules for `frame`:

- `left` `center` `right` exist even if you don't write them; if not written, they're (0, 0).
- `auto` is a reserved name and isn't written in `positions` (chapter 6).
- A variant without `frame` is shown at the image's actual size, and its only named position is `center` (bottom center of the screen). Use it for sprites placed automatically (`at=auto`) or by coordinates (`x` / `y`).
- `flipAxis` is the axis used when the sprite is flipped with `@chara … flip=true`, written as an X from the image's left edge (image px). If it isn't written, the picture is mirrored around the image's center (the picture is mirrored inside the frame, so the frame's position doesn't change).
  Whatever lies on the axis (such as the chin) stays in the same place when flipped. Studio's "Match head size" writes this value for the variants it aligns (not for the reference variant), so the chin doesn't shift sideways between variants when they're flipped.

**Cache**: Export (`lim build`) writes a hash of each asset's content to `project/assets.json`, and the game adds it to the asset's URL.
Images and sounds replaced under the same name aren't shown from an old cache. During development (`lim dev`, Studio), assets are checked again and returned every time.
If there is a `cacheKey`, it's added to the URL too (the Characters screen changes it only when an image is overwritten under the same name, for the preview that's open).

**Lip sync and blinking (`lip` `blink`)**

- Overlay images of the same size as `image` with only the mouth or eyes drawn.
- List `lip` as slightly open mouth → wide open mouth, and `blink` as half-closed eyes → closed eyes.
- The mouth moves with the volume of that character's voice while it plays, or, when no voice is playing, only while the characters of that character's page are appearing.

**Layered sprites (`layers`)**

- In a sprite set, write the list of layers stacked from the bottom: `{ name, options: { picture name: image }, default }`.
- A variant writes `parts` (layer name → picture name; `""` hides that layer) instead of `image`. Layers not written use `default` (if there is none, they aren't shown).
- The game builds a single picture with the layers stacked before showing it, so changes, position and size are handled the same as for a single image.
- Draw the layer pictures at the same size (they're stacked with their top-left corners aligned).
- You can make them from PSD and PSB files with `lim psd` (chapter 12).

**Face window (`face`)**

- Written in a variant, it's that picture (a path from `assets/fgimage/`).
- Written in a sprite set, it's the area `{ x, y, width, height }` (px) cut out of the sprite (after stacking, for layered sprites).
- The variant's picture takes priority. A character with neither has no face window.

**Sprites drawn by a plugin (`model`)**

- A sprite that a plugin draws instead of an image (`{ "type": "live2d", … }`; everything other than `type` is read by that plugin).
- `image` becomes the still image that decides the position and size. How it's drawn is in the plugin's `extensions.spriteParts` ([plugins.md](../../plugins.md)).
- A `model` written on the character applies to every variant. A `model` of the same `type` written on a variant is laid over the character's `model` (for a different `type`, only the variant's is used).
- `sway` (sways a single image) is built in. With the official plugins installed, `live2d` (Live2D Cubism) and `spine` (Spine) can be used too ([live2d-spine.md](../../live2d-spine.md)).

**Importing from TyranoScript**: `lim import` builds it from `[chara_new]` / `[chara_face]`. There is one sprite set, `default`,
and the variant `default` is the `storage` of `[chara_new]`. `width` / `height`, if present, become the `frame`. If there are tatie settings
(`data/others/plugin/tatie/settings.js`), they're layered on top, and for the same sprite set and variant, the tatie settings win.

### Script format versions (format)

```json
{ "id": "my_game", "title": "My Game", "version": "1.0.0", "format": 4, "entry": "start" }
```

- `format` is the version of the format the scripts (.lim) are written in. `lim new` writes the current version. A project without it is treated as having scripts from before versions were written (1).
- When the engine changes the format (renaming commands and so on), the version goes up by one, and `lim migrate` gets a path that moves the earlier way of writing to the current one.
  The syntax check reports lines written the earlier way, with a replacement in the current way as the suggested fix (`renamed-command`, `renamed-param`).
- If `format` is newer than the engine's format version, the syntax check warns (`newer-format`; a script written with a newer engine is being checked with an older engine).

| Version | What changed |
|---|---|
| 1 | Scripts from before versions were written |
| 2 | Removed the command names of the earlier version: `@show` → `@chara`, `@hide` → `@chara-hide`, `@hide-all` → `@chara-hide-all`, `@sprite-config` → `@chara-config`, `@scene` → `@scene-change` (the arguments stay the same) |
| 3 | `ending=` of commands that end the playthrough became the kind of ending instead of on-screen wording, with the name moved to `title=`: `ending="BAD END"` → `ending=bad`, `ending="Passing Shower"` → `ending=other title="Passing Shower"` ("The end of a playthrough" in chapter 2). The format 2 way keeps working, and the syntax check reports it as `legacy-ending` |
| 4 | The time an action takes moved from `fade=` to `time=` (`@bg`, `@chara`, `@chara-hide`, `@chara-hide-all`, `@mask`, `@mask-off`, `@bgm`, `@stop-bgm`, `@se`, `@stop-se`, `@scene-change`, `@window`, `@image`, `@particles`, `@html` and others, 36 commands in all). `@effect`, `@effect-off`, `@staff-roll`, `@flash`, `@chapter-card` and `@chapter-end`, which already use `time=` for something else, keep `fade=`, as do `fade-in`, `fade-out`, `crossfade`, `hide-fade`, `bgm-fade`, `filter-fade` and `auto-fade`. `fade=` from format 3 and earlier keeps working, and the syntax check reports it as `renamed-param`. Commands without a target (`@chara-hide-all`, `@mask`, `@mask-off`, `@stop-bgm`, `@stop-se`, `@stop-voice`, `@stop-bg-movie`) also read an unnamed time as `time` (`@mask 600ms`) |

**`lim migrate`**

```
lim migrate              # Moves the scripts to the current format and rewrites them
lim migrate --check      # Doesn't rewrite; fails if there's anything to move (CI)
lim migrate --json       # The moved lines as JSON
lim migrate --keep-behavior               # Also writes settings that keep the old behavior where the default look or behavior changed
lim migrate --keep-behavior chara-swap    # Only the ones you choose (separate names with commas)
```

- In commands at the start of lines (`@scene …`) and inside text (`{@show …}`), command names, and parameter names that changed in script format 4, are changed to the current names. The contents of `@script`, `@html` and `@staff-roll`, and comment lines, aren't changed.
- If the project has a macro with the same name (`@define scene(…)`, the scene-change macro of the earlier template), that name isn't changed (it's working as the project's macro).
  A macro can be called only in the file that defines it and in files that `@use` that file, so built-in commands with the same name in other files are moved.
- Scripts in packs (`packs/*/scenario`) and `import.ink.commands` and `import.yarn.commands` in `liminalia.json` (the command templates for imports) are moved too.
- For lines whose original text changed because a command inside the text was rewritten, translations (for lines with a line ID the key stays the same, so the translation's source and the commands in the translation are rewritten)
  and voice number locks (keys and source in `voice-lock.json`; the numbers stay, and they aren't marked for re-recording) are moved too. Read marks come from the original text, so moved lines go back to unread for players of the version before migrating.
  Lines in pack scripts are moved the same way. A pack's translations (`packs/<id>/lang/*.json`) replace the whole translation for that language when the pack is installed, so the lines of both the main scripts and the pack scripts are moved in them. Voice number locks for pack dialogue are moved in the project's `voice-lock.json` (packs don't have their own). When the main project and a pack have a script with the same name and only one of them is migrated (for example, because only that script can call a macro with the same name as a built-in command), the translation and voice lock keys that the unmigrated script still uses are kept, and the new keys are added (a pack's translation keeps only the keys used when the pack is installed).
- Earlier names in `commandDefaults` in liminalia.json are changed to the current names too (if the current name is also set there, the unused earlier name is removed), and `format` is set to the current version (if `format` is the only thing to move, only the `format` line is rewritten, or added if it isn't there, and nothing else is changed).
- The formatting settings used up to 0.1.17 (`"format": { "indent": 2, "expressions": false }`) are moved to `fmt` before `format` is set to the current version (if `fmt` exists, only the missing keys are moved).
- Wording in `ending=` of commands that end the playthrough is moved to the kind and `title=`. Wording that tells the kind (BAD END, GOOD END, TRUE END, NORMAL END, with variants in case, ENDING,
  full-width letters and katakana) becomes the kind only; other wording becomes `other` with the wording in `title=`. Wording that starts with a kind and goes on (`BAD END 2: Silence`) is split into the kind and the rest in `title=`,
  with a note to check it. If the earlier wording differs from the kind's default wording (`Bad End`), it's written to `endingKinds` so the screen keeps the same wording (only when each kind is spelled one way).
- Wording in `playtest.avoidEndings` (`BAD END`, `BAD`) becomes the kind too. In translation files (`lang/*.json`), translations of the moved wording go to the `title=` key for names,
  and for a kind's wording to the key of the `endingKinds` wording (project settings text) or to `ending.kinds.<kind>` in `ui` (only translations that differ from the default wording); keys no longer used are removed.
- If a script can't be read as UTF-8, it stops without rewriting the other scripts or liminalia.json (also with `--check`; save it again as UTF-8 in an editor, then migrate).
  `lim fmt`, `lim rename`, `lim i18n`, `lim prose` and the other commands that rewrite the project do the same.
- It lists the changes to the default look or behavior since the project's format version (the "action needed" items in CHANGELOG) that concern the project. With `--keep-behavior`,
  for those a setting can undo, it writes that setting to liminalia.json (settings the project has already decided aren't written). For those a setting can't undo, it shows steps to get closer to the old behavior.
  After migrating, the project is in the current format and the list isn't shown anymore, so add the flag when you migrate if you want to keep the old behavior.

| Name | Changed in | What changed | Setting for the old behavior |
|---|---|---|---|
| `line-break` | 0.1.18 | Japanese and Chinese text wraps with `strict` | `ui.text.lineBreak: "auto"` |
| `chara-swap` | 0.1.18 | When characters swap in the same position, the previous one leaves first | `commandDefaults.chara.swap: "cross"` |
| `chara-keep-text` | 0.1.18 | During `@chara` with `wait=true`, the previous speaker's name box and text are cleared | `ui.chara.keepText: true` (since 0.4.1, `page-keep-text` is needed too) |
| `movie-skip` | 0.1.18 | A first-time `@movie` plays even during skip | (A setting can't undo it; write `skip=true`) |
| `voice-overlap` | 0.1.18 | Two `@voice` lines with different speakers or channels play at the same time | (A setting can't undo it) |
| `bgm-filter` | 0.1.18 | `@bgm` for the same track sets the filter again | (A setting can't undo it) |
| `choice-position` | 0.1.21 | Choices move to a height that doesn't cover the sprites' faces (projects that set `ui.choice.y` stay as before) | `ui.choice.position: "center"` |
| `ending-card` | 0.1.21 | Ending with `ending=` shows the ending's name and waits for a press (only projects with endings) | `commandDefaults.title-screen.card: "false"` |
| `ending-font` | 0.2.0 | The ending name's font follows the text font (only projects that set `ui.text.font`) | The old Mincho stack in `ui.ending.font` |
| `system-colors` | 0.2.0 | The colors of confirmation and input dialogs and of notices follow the colors in `ui.system` (only in projects that write colors in `ui.system`) | (A setting can't undo it; set them in the project's CSS) |
| `page-keep-text` | 0.4.1 | After a click turns the page, the first command clears the previous page's name and text | `ui.message.keepText: true` |
| `reduce-motion` | 0.5.0 | The "Screen effects" (standard / reduced) setting was removed, and text effects, `@effect` and the like always move | (A setting can't undo it; remove the branches that use `ctx.reduceMotion` and `lm-reduce-motion`) |

The format version became 2 in 0.1.18, 3 in 0.2.0 and 4 in 0.6.0. The changes in 0.1.19 to 0.1.21 came in while the format version was still 2, so they're listed for format 2 projects too (it can't tell whether the project was made before them).
Likewise, the changes in 0.2.1 to 0.5.x are listed for format 3 projects.

### Declaring compatible engines (engines)

```json
{ "id": "my_game", "title": "My Game", "format": 4, "engines": { "liminalia": ">=2" }, "entry": "start" }
```

- `engines.liminalia` is the range of engine interface versions the game (and a template someone shares) works with (`>=`, `<`, `^`, `2 - 3` and `||` are understood). It's written the same way, and uses the same version,
  as a plugin's `package.json` and a theme's `theme.json` ("Declaring compatible engines" in [plugins.md](../../plugins.md); currently 8). If you don't write it, it isn't checked.
- If it doesn't match, the syntax check warns (`engine-version`). `lim new <folder> --template <template>` also tells you before creating the game when the template's `engines` or `format` doesn't match.
- `format` is the version of how scripts are written, and `engines` is the version of the engine's features (the interfaces for commands and rendering, and the items of themes and project settings).

### Save versions

Save data has a `version` (the version of the save format). When loading, the version is checked, and older versions go through the conversion for each version in turn to reach the current one.
Saves from a newer version than the game, and malformed saves, aren't loaded, and the player is told (the game screen says it can't be loaded, and the current playthrough isn't thrown away).

- Even after updating the engine, saves made with the previous version can be read as they are.
- When rewriting the scenario has moved the place to resume from, it resumes from a nearby line (`save-relocated`). A save inside `@call` or a macro also keeps a marker for where to return (the line after the calling command;
  for a choice with `call=true`, that choice), so even if the caller's lines shift, it returns after the same command. For saves from earlier versions without the marker, if the line just before the return point
  isn't a calling command, it returns after whichever command that calls the called place is closest to the original position.

**After loading**: `afterLoad` (`file#label`) in liminalia.json is the place called right after loading (`@return` goes back to the loaded page).
`temp.` isn't kept in the save, so recalculate anything you need after loading here.

**Game version**: Save data has the version of the game that made it (`version` in liminalia.json; `gameVersion` in the save data), which expressions can read as `save.version`
(read only. For a loaded playthrough it's the version of that save data, for a newly started playthrough the current version, and for save data from before the version was recorded an empty string.
Saving again makes it the current version). When an update changes the name or meaning of a variable, convert save data from earlier versions in `afterLoad`.
Compare versions with `version_before(save.version, "1.1.0")` (they're compared as numbers, so 1.9.0 comes before 1.10.0; an empty version comes before every version):

```
// liminalia.json: "version": "1.1.0", "afterLoad": "common#after_load"
// In 1.1.0, game.affection was renamed to game.love
# after_load
@if version_before(save.version, "1.1.0")
  @set game.love = game.affection
@end
@return
```

As you add conversions, put the `@if` blocks in order from the oldest (a 1.0.x save goes through the 1.1.0 conversion and then the 1.2.0 one too).

If there's a local variable (a macro parameter or `@let`) named `save`, that's read instead.

`saves` sets where saves are kept (desktop version) and whether save data is protected (see exporting in the README).

### Locked voice numbers (voice-lock.json)

Locks the numbers of numbered voices (chapter 7) to each line of dialogue. `lim voice-lock` creates and updates it.
Dialogue in packs (`packs/<id>/scenario`) also plays with the numbers in this file, so `lim voice-lock` (and "Lock numbers" in Studio) and the syntax check count pack scripts too
(they read the main scripts with the pack laid over them, give numbers to pack dialogue, and don't move the numbers of pack dialogue to `retired`). The first time,
it also runs the game with packs laid over the main scripts, and dialogue that only pack scripts have gets the number that plays when the pack is installed. Players can install any combination of packs,
so the combinations are all of them: the main scripts alone, with each pack, with each two packs, and so on (laid in the order of `order` and `id` in `pack.json` like the game, the later pack winning; an export includes all of the project's packs, and the desktop version lays the installed packs over the main scripts).
The first time, smaller combinations run first, and a line that already played in an earlier combination doesn't get numbers from later ones (a combination with no lines left to copy isn't run, and a jump to a scenario the combination doesn't have ends the run there).
With more than 8 packs that have scripts there are too many combinations, so only the main scripts alone, with each pack, and with all packs are read, and
`lim voice-lock` (and "Lock numbers" in Studio) reports how many combinations weren't read (lines that play a numbered voice only in those combinations get no number).
The output of `lim voice-lock` writes the place of pack dialogue as `packs/<folder>/scenario/<scenario>:<line>`.

```json
{
  "lines": {
    "start:v26410599": { "speaker": "Yui", "n": 1, "source": "\"...A visitor?\"" }
  },
  "retired": {
    "start:v8d01e2aa": { "speaker": "Yui", "n": 7, "source": "\"A deleted line\"" }
  }
}
```

- The key is made from the file, the speaker and the original text (if the same line appears several times in the same file, which occurrence it is). Adding or moving lines doesn't change it.
  A line with a fixed line ID at the end (`#line:ID`; chapter 2) uses `file:v@ID`, so rewriting the original doesn't detach the number (a line whose original changed gets `"rerecord": true`).
- Numbers are given only to lines where a numbered voice plays. The script is read from the top, following, for each speaker, whether `@voice-auto` is in effect (set, `@voice-auto-off`, resumed) and
  the `@voice` right before. The start of a file combines the states of the places that jump to it (the `entry` file starts with nothing in effect).
  Each branch of `@if` is read and merged, and a macro call reads the contents of the macro. A file that nothing jumps to is assumed to possibly have any speaker with a setting in effect.
  The numbers of lines that don't play are moved to `retired` (if you make them play later, they get their previous numbers back).
- **The first time**: it runs from "New Game" several times with different choices, and copies the numbers that play with the current counting (locking the recorded numbers as they are).
  Lines whose number changed depending on the route, and lines that played the same number as another line, are listed. Lines not reached in these runs get new numbers.
- **When updating**: locked numbers don't change.
  - New lines get numbers per speaker, starting after the largest number so far.
  - A line whose original text was slightly rewritten keeps its previous number (in the same file, with the same speaker, and with original text close enough). The recorded voice no longer matches the original, so
    it's marked `"rerecord": true` and appears in the output of `lim voice-lock` and in the "needs re-recording" column of the recording script. After re-recording, clear the mark with `lim voice-lock --clear-rerecord`.
    A line whose original stayed the same but whose key changed (which occurrence of the same line it is changed, or a line ID was given) carries over without the mark.
  - The numbers of deleted lines are kept in `retired` and aren't given to other lines (if you bring the line back, it gets its previous number back).
- The dev server reads the lock when it starts (reopen it after updating). Export includes it in the game.

What the syntax check reports:

| code | Contents |
|---|---|
| `voice-unlocked` | A line that isn't in the lock (it doesn't play). Only lines where a numbered voice plays |
| `voice-lock-duplicate` | The same number for the same speaker among lines that are played together (the main scripts alone, or with any combination of packs laid over them; all combinations are checked, however many packs there are) (error) |
| `missing-voice` | A voice file that doesn't exist (only for speakers with a single `@voice-auto` pattern) |
| `voice-lock-outdated` | Numbers for lines that aren't in the current scenario |
