Options

When you want to let the player decide what to say, you use an option. Options let you show multiple potential lines of dialogue to the player, and let the player select one.

Options are lines prefixed with a ->. You write as many options as you’d like the player to see, and the player chooses one of them. The content of the option is like any other line of dialogue.

For example, consider the following code:

title: Start
---
Navigator: The quantum fluctuations are intensifying. We need to jump now.
Captain: But the calculations aren't complete. We could end up anywhere.
Navigator: The wormhole is collapsing. It's now or never.
Captain: Fine. Initiate jump sequence.
Navigator: Something's wrong. We're being pulled backward...
Captain: That's impossible. Unless...
Navigator: We're arriving before we left. We've become our own rescue mission.
-> Captain: Let's alter our trajectory and break this temporal loop!
-> Captain: We must complete the cycle. Our past selves depend on it.
===
Lines 3–9 Regular lines of dialogue — these run one at a time, in order.
Lines 10–11 Options — lines prefixed with ->. The player chooses one.

In this example, the line Navigator: We're arriving before we left. We've become our own rescue mission. will run.

The player will then be given the choice for the Captain to say either Let's alter our trajectory and break this temporal loop!, or We must complete the cycle. Our past selves depend on it.

Options that are grouped together are delivered together. A regular line between two sets of options separates them into distinct groups:

title: Start
---
Navigator: The quantum fluctuations are intensifying. We need to jump now.
Captain: But the calculations aren't complete. We could end up anywhere.
Navigator: The wormhole is collapsing. It's now or never.
Captain: Fine. Initiate jump sequence.
Navigator: Something's wrong. We're being pulled backward...
Captain: That's impossible. Unless...
Navigator: We're arriving before we left. We've become our own rescue mission.
-> Captain: Let's alter our trajectory and break this temporal loop!
-> Captain: We must complete the cycle. Our past selves depend on it.
Navigator: Ayee! We're all going to die!
-> Captain: Nonsense! Keep yourself together!
-> Captain: AHHHH! We're all going to die!
===
Lines 10–11 First option group — these two options are delivered together.
Line 12 A regular line separates the two option groups.
Lines 13–14 Second option group — delivered separately from the first.

Two sets of options in the same node being displayed separately.

Options and Lines

Options can have their own lines, which are run when the option is selected. If a different option is selected, they won’t run. To write this, indent the lines that belong to an option.

In the following code, different lines will run based on which of the two options are selected.

title: Start
---
Navigator: The quantum fluctuations are intensifying. We need to jump now.
Captain: But the calculations aren't complete. We could end up anywhere.
Navigator: The wormhole is collapsing. It's now or never.
Captain: Fine. Initiate jump sequence.
Navigator: Something's wrong. We're being pulled backward...
Captain: That's impossible. Unless...
Navigator: We're arriving before we left. We've become our own rescue mission.
-> Captain: Let's alter our trajectory and break this temporal loop!
    Navigator: Risky, Captain. We'd be writing ourselves out of existence.
-> Captain: We must complete the cycle. Our past selves depend on it.
    Navigator: Then we're doomed to repeat this moment... forever.
===
Lines 10 & 12 Two options — the player picks one.
Line 11 An indented line below an option — only runs if that option is chosen.
Line 13 This indented line belongs to the second option — only runs if the player picks it.

Options within Options

You can also nest options below other options:

title: Start
---
Navigator: We're arriving before we left. We've become our own rescue mission.
-> Captain: Let's alter our trajectory and break this temporal loop!
    Navigator: Risky, Captain. We'd be writing ourselves out of existence.
    -> Captain: Damnit, Navigator! Nothing can stop me existing!
        Navigator: *sigh* Very well, Captain.
    -> Captain: By gods! You're right!
        Navigator: But it's only solution, I fear.
-> Captain: We must complete the cycle. Our past selves depend on it.
    Navigator: Then we're doomed to repeat this moment... forever.
    -> Captain: If we're doomed, at least we'll be remembered as heroes.
        Navigator: .. if anyone remembers us at all
    -> Captain: Forever... forever... forever...
        Navigator: Sir?
    -> Captain: We must do it!
        Navigator: As always, sir, you're right.
===
Lines 4 & 10 Top-level options — the player chooses one of these first.
Line 5 A line belonging to the first option — runs only after the player picks it.
Lines 6–9 Nested options under the first choice — a second set of options appears, each with its own indented response line.
Line 11 A line belonging to the second option — runs before its nested options appear.
Lines 12–17 Three nested options under the second top-level choice — deeper indentation means deeper nesting. Each has its own response.

The different groups of options, showing when they're grouped using colours.

Testing out Options

Your Turn

Add options to your tiny narrative.

Consider adding some lines that belong to the options below them, too. Then, run your single-node narrative using Preview.