Show chapter title cards and chapter ends
On this page
When the chapters’ numbers and titles are written in one place, the “Chapter card” and “Chapter end” parts show the current chapter’s number and title without any parameters. The chapter information is also used for save slot headings and autosaves.
The examples on this page use the English sample story, “Waiting for Stars” (choose “A sample story” and English in New Project, or run lim new --lang en; the characters are Akari and Sou).
Set up the chapters
Chapters are written as chapters in liminalia.json in the project folder. For each chapter, write a name, a number, a title and the chapter’s script files.
"chapters": [
{ "id": "ch1", "number": "Chapter 1", "title": "The hill of stars", "subtitle": "Waiting for the meteor shower", "files": ["start"] },
{ "id": "ch2", "number": "Chapter 2", "title": "The slope at dawn", "files": ["epilogue"] }
]
| Item | Contents |
|---|---|
id | The chapter’s name (required). The value returned by the expression chapter() |
title | Title (required) |
number | How the number is written (Chapter 1, EPISODE 01 and so on) |
subtitle | A subtitle or a title in another language |
files | The names of the chapter’s script files (without the extension). * matches any run of characters (chapter1_* matches every file that starts with chapter1_) |
files that match no script file, and files that fall in two chapters, are warnings in Check.
Show a chapter title card
- Select the line just before where you want the title card.
- Type “chapter” in the search box at the top of the parts panel, and double-click “Chapter card” in the results.
When the story reaches that line, the chapter’s number, title and subtitle fade in over the whole screen, and fade out after a while. If you leave number, title and subtitle empty, they come from the chapter of the current script file. Anything you write is shown instead.
| Parameter | What it sets | Default |
|---|---|---|
image | A background image to lay behind it (unlocks it if it’s a CG in the extras) | The theme’s color |
time | How long it stays | 2500ms |
fade | How long it takes to appear and to disappear | 800ms |
leave | What happens after. With mask, the story goes on with the screen covered in black | none |
With leave set to “mask,” the card fades to black, and the story goes on to the next line with the screen still covered. Set up the background and sprites meanwhile, then open it with the “Fade in” part (@mask-off).
Show a chapter end
Add the “Chapter end” part at the end of the chapter. It shows the chapter’s number and title with 完 under them and ends by fading to black. When the game is played in English, it shows End instead of 完. To change the closing text, enter it in text (To be continued and so on).
The default leave of “Chapter end” is mask, so the story goes on with the screen covered in black. Open it with “Fade in” at the start of the next chapter. The black cover is kept in saves, and stays after load.
The colors and font of the card and the end change to match the theme. They don’t show while skipping.
What the chapters change
- Save slots on the save and load screens show the number and title of the chapter where the save was made (anything written in “Chapter names shown on save slots” under “Saves and log” in the game settings takes priority).
- Check “Autosave at the start of a chapter” under “Saves and log” in the game settings, and the game autosaves on the first page after the chapter changes.
- The expression
chapter()reads the current chapter’sid(@if chapter() == "ch2").
In code
# start
@mask
@chapter-card leave=mask
@bg hill_dusk.webp
@mask-off time=1500ms
At the top of the slope stood a small observatory.
The end of a chapter is written like this.
Sou "Go ahead. Waiting is what this place does best."
@chapter-end
@jump epilogue
For details, see @chapter-card, @chapter-end and Chapters in the documentation.