# Split the script into several files

> Make a file for each chapter and connect them with jumps

When the script gets long, splitting it into files by chapter or by day makes it easier to find your way around. You create files, add scenes and rename them in the scene list on the left of the "Script" screen. Here, as a continuation of the tutorial, you create a file for the second day and connect it from the end of `start.lim`.

The examples on this page use the project you make in the [tutorial](/en/tutorial/), "Shiori of the Library." The background `hill_morning.webp` is from the sample assets ("Add sample assets" in the "…" menu of the Assets screen adds it).

## Create a new file

1. Click "New file" at the bottom of the scene list.
2. Type the file name (here, `day2`) in the name field and press Enter. Don't type the `.lim` extension.

![Typing the name of the new file.](/shots/en/h-files-new.webp)

File names can use letters, digits, `_` and `-`. Separate parts of the name with `/` to put the file in a folder (such as `chapter1/day2`).

The new file opens. It contains one scene with the same name as the file (`# day2`). Add backgrounds and narration as you did in the tutorial.

## Add a scene

1. In the scene list, click the "+" to the right of the file name (or "Add a scene" in the right-click menu).
2. Type the scene name (here, `night`) and press Enter.

![Adding a scene with the + on the file's row.](/shots/en/h-files-scene.webp)

A `# night` label is added at the end of the file. In the scene list, each scene is shown with a small picture of its background and its first line of text. Click one to go to that scene.

![day2.lim now has two scenes.](/shots/en/h-files-day2.webp)

## Jump to another file

1. In the scene list, click `start.lim` to open it, and select the last narration line ("On the way home, I walked…").
2. Double-click "Jump" in the "Flow" section of the parts panel, change the input field to `@jump day2`, and press Enter.

![A jump to another file.](/shots/en/h-files-jump.webp)

There are three ways to write a jump target.

| How to write it | Jump target |
|---|---|
| `#night` | A label in the same file |
| `day2` | The start of that file |
| `day2#night` | A label in that file |

When you play, the first line of `day2.lim` follows the last line of `start.lim`.

The game no longer reaches the lines after the jump (such as the `@title-screen` line added at the end in chapter 8 of the tutorial), so delete them if you don't need them.

![The story has moved on to day2.lim.](/shots/en/h-files-game.webp)

## Rename a file

1. In the scene list, right-click the file and click "Rename."
2. Type the new name (here, `chapter2`) and press Enter.

![The right-click menu of a file.](/shots/en/h-files-menu.webp)

When you rename a file, jump targets in other files that point to it are rewritten too ("Renamed (rewrote targets in 1 files)" appears at the bottom). The names of the labels in the file (`# day2`) don't change.

![After renaming. The jump target in start.lim is now chapter2.](/shots/en/h-files-renamed.webp)

The blocks of the file you had open may not show the change right away. If so, open another file in the scene list and then open this one again.

The same menu also has "Duplicate" and "Move to trash" for the file. The file where "New Game" starts (`start.lim` at first) can't be moved to the trash.

## Move a scene to another file

Right-click a scene in the scene list to see "Rename scene," "Duplicate scene," "Move to another file," "Split the file from here" and "Delete scene."

- **Move to another file**: Type the name of the destination file, and the scene moves to the end of that file. If there is no file with that name yet, a new file is created.
- **Split the file from here**: Moves everything from that scene to the end of the file into a new file.

Both rewrite the jump targets that point to the scene (`@jump`, `@call`, choices and so on) so that they point to the file it moved to.

## In code

```
// End of start.lim
On the way home, I walked down the hill, holding the {= game.book} to my chest.
@jump chapter2
```

```
// chapter2.lim
# day2
@bg hill_morning.webp
The next morning, I put the book in my bag and climbed the hill again.

# night
That night, I opened the borrowed book to its first page.
```
