Options, jumps and hops

Options

Options are what the player can choose. Add one with Insert Option at the end of a line, with ⌥ Enter, or by starting a line with ->.

Type the option’s words and press Enter. The next line goes under the option. Write what happens if the player picks it. Press Enter on an empty line to step back out.

Ayumi: Will you help?
    -> Yes
        Ayumi: Thank you!
    -> No
        Ayumi: Oh well.
The sun sets.
  • The lines indented under an option happen only if the player picks it.
  • Options on lines next to each other are one menu.
  • A line that isn’t indented under an option ends the menu. The sun sets. always happens.

Indenting

Tsumugi looks after the spaces. In the Story Writer, each option has its own box, and the lines under it step in. A menu of two or more options shows them side by side, one column each.

Key What it does
Enter after an option Starts a line under it.
Enter on an empty line Steps back out.
Tab, ⇧ Tab Moves a line into, or out of, the option above.
Backspace before an option’s arrow Moves the option one step out.

Type -> under an option’s lines and the new option joins the same menu. For a menu inside that option, press Tab first.

If a line looks like it ends a menu by mistake, Tsumugi warns you and offers Move it in.

Events inside an option

An event under an option happens only when the player picks it. At the end of the option’s line, type a space, > and the event:

-> Take the fish > add item Fish

Press Enter. Tsumugi moves the event to its own line under the option.

Show an option only sometimes

At the end of an option’s line, type a space and > (or click Insert Event on it). The menu starts with This option:

  • Only if not chosen yet: the option goes away once the player picks it.
  • Only if …: pick what to check, like a variable or an item. The option shows only when it is true.
  • Always show it: takes the check off again.

In the file, the check sits at the end of the option. It needs no <<endif>>:

-> I check my hands <<if !optionChosen()>>
-> Give the fish back <<if $courage >= 2>>

See Conditions.

Numbered options

Does your game put 1:, 2:, 3: before its options, picked with those keys? Turn on Number the options in Settings. Each option shows its number, and the number keys pick them in the preview.

How many options fit

Tsumugi warns when more options show at once than your game can fit. Set the most your game shows with maxOptions in tsumugi.json.

Let the game pick

Sometimes the game should decide, like a coin toss. Type > random option (or pick Pick one at random). The player never sees these options: the game picks one, and what is under it happens.

<<random option>>
    -> #70%
        Ayumi: Lovely weather today.
    ->
        Ayumi: Looks like rain.

Leave the options’ words out. #70% after an arrow makes that one more likely. Without it, each is as likely as the others.

Let the player type

Instead of picking an option, the player can type an answer, like a name or a password. Type > player input. The game waits while the player types, and keeps the answer in $playerInput. Then check the answer with an If (Conditions).

If your game has no player input yet, Tsumugi can add it for you: a script, and the box the player types in.

Jump to

Jump to goes to another node.

> jump to Harbour

In the file: <<jump Harbour>>. If there is no node called Harbour yet, Tsumugi makes one, right after the node you are writing in. An arrow to it appears on the map.

Click the tag to open that node.

Hop to and Hop back

A hop visits another node, then comes back to where it left. Good for side conversations, like a shop.

  1. Where the player goes to the shop, type > hop to Shop.
  2. At the end of the Shop node, type > hop back.

The story then carries on from the line after the hop.

> jump back is the same for jumps: it goes back to the node the player jumped from.

Other files

Keep each chapter in its own file, like ChapterOne.yarn and ChapterTwo.yarn. To jump into another file, type > jump to. The menu also lists the nodes in your other files, like Chapter Two › Harbour.

<<jump ChapterTwo.yarn:Harbour>>

Those tags have a file mark. Click one to open that file.

Warning

Your game must load every file it jumps into. Tsumugi warns you if one isn’t loaded. See How Tsumugi reads your game.

Stop

> stop ends the conversation there.