Jumps

flowchart TD
  start["<b>Start</b><br>Navigator: Where to, Captain?"]
  earth["<b>Earth</b><br>Navigator: Earth it is sir."]
  star["<b>SecondStar</b><br>Navigator: Can you be more specific?"]
  done["<b>Done</b><br>Navigator: Being a Navigator sure is hard work!"]
  start -->|"-#gt; Captain: I want to go back to earth!<br>#lt;#lt;jump Earth#gt;#gt;"| earth
  start -->|"-#gt; Captain: Second star to the left!<br>#lt;#lt;jump SecondStar#gt;#gt;"| star
  earth -->|"#lt;#lt;jump Done#gt;#gt;"| done
  star -->|"#lt;#lt;jump Done#gt;#gt;"| done
The nodes in the example on this page. The option the player chooses in Start jumps to Earth or SecondStar, and both of those jump to Done.

The <<jump>> command lets you move the dialogue between nodes. It is used by writing << then the word jump, a space, and then the full title of the node you want to jump the narrative to, then another >>.

To jump to a node with the title Rescue_the_Kitten , for example, you would write the line <<jump Rescue_the_Kitten>>.

Jump commands should always be placed on their own line, indented as appropriate.

Using the Jump Command

For example, consider the following conversation, which could be structured inside one node, using nested options, or split over several nodes using options and jump commands. The before version is inside a single node, and works fine, but the after version is structured across multiple nodes, and is easier to make sense of.

Yarn
title: Start
---
Navigator: Where to, Captain?

-> Captain: I want to go back to earth!
    Navigator: Earth it is sir. 
    Navigator: This jump will take us 10 hours.
    Navigator: Permission to jump, sir?
    -> Captain: Granted, let's go!
        Navigator: On it, sir.
    -> Captain: Not yet. Just wait a moment.
        Navigator: Standing by, sir.
-> Captain: Second star to the left!
    Navigator: Can you be more specific?
    -> Captain: I cannot, no.
        Navigator: Right away, sir.
    -> Captain: ... that one *gestures*
        Navigator: Very good, sir.

Navigator: Being a Navigator sure is hard work!
===
The whole conversation in a single node.
Yarn
title: Start
---
Navigator: Where to, Captain?

-> Captain: I want to go back to earth!
    <<jump Earth>>
-> Captain: Second star to the left!
    <<jump SecondStar>>

Navigator: Being a Navigator sure is hard work!

title: Earth

Navigator: Earth it is sir. Navigator: This jump will take us 10 hours. Navigator: Permission to jump, sir? -> Captain: Granted, let's go! Navigator: On it, sir. -> Captain: Not yet. Just wait a moment. Navigator: Standing by, sir. <<jump Done>>

title: SecondStar

Navigator: Can you be more specific? -> Captain: I cannot, no. Navigator: Right away, sir. -> Captain: … that one gestures Navigator: Very good, sir. <<jump Done>>

title: Done

Navigator: Being a Navigator sure is hard work! ===

The same conversation split into nodes, using jumps.

Separating dialogue segments into nodes can aid in writing neater files that are easier to edit as they grow.

When you use <<jump>> command, they’ll be shown in the Graph View in Yarn Spinner for Visual Studio Code as an line with an arrow leading to the node that’s being jumped to:

VS Code with a Yarn file on the left and the Graph View on the right. The Start node contains <<jump Treasure>>, and an arrow leads from the Start node to the Treasure node.
The «jump» command being visualised in the Graph View.

If you use the <<jump>> command to jump to a node that’s in a different .yarn file, it will be visualised as a line leading to a small circle:

The Witch node in the Graph View, with a line leading out of it to an arrow and a small empty circle.
A jump from the Witch node to a node in another file.

Write some Jump Commands

Write a simple story with several nodes

Spread your story out over the nodes in a sensible manner.

Use the <<jump>> command to move between nodes in your story

Specify the name of the node you want to jump to inside each <<jump>> command.

Run your story using Preview

Play through it, and check that the jumps behave as you’d expect.

Next up, learn about the Jump Command’s close relative, the Detour Command.