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: Captain, we're nearly out of tea.
Captain: How nearly?
Navigator: Two bags, and one of them is peppermint.
Captain: Then set a course for the nearest shop.
Navigator: There's a service station on the next moon.
Captain: Does it sell biscuits as well?
Navigator: It does, sir, but it closes in ten minutes.
-> Captain: Full speed ahead, then!
-> Captain: Let's not rush. We'll find another one.
===In this example, the line Navigator: It does, sir, but it closes in ten minutes. will run.
The player will then be given the choice for the Captain to say either Full speed ahead, then!, or Let's not rush. We'll find another one.
Options that are grouped together are delivered together, for example, consider the following updated script:
title: Start
---
Navigator: Captain, we're nearly out of tea.
Captain: How nearly?
Navigator: Two bags, and one of them is peppermint.
Captain: Then set a course for the nearest shop.
Navigator: There's a service station on the next moon.
Captain: Does it sell biscuits as well?
Navigator: It does, sir, but it closes in ten minutes.
-> Captain: Full speed ahead, then!
-> Captain: Let's not rush. We'll find another one.
Navigator: Ayee! We're all going to die!
-> Captain: Nonsense! Keep yourself together!
-> Captain: AHHHH! We're all going to die!
===In this example script these two options will be delivered together:
-> Captain: Full speed ahead, then!
-> Captain: Let's not rush. We'll find another one.As will these, separately:
-> Captain: Nonsense! Keep yourself together!
-> Captain: AHHHH! We're all going to die!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 shortcut options are selected.
title: Start
---
Navigator: Captain, we're nearly out of tea.
Captain: How nearly?
Navigator: Two bags, and one of them is peppermint.
Captain: Then set a course for the nearest shop.
Navigator: There's a service station on the next moon.
Captain: Does it sell biscuits as well?
Navigator: It does, sir, but it closes in ten minutes.
-> Captain: Full speed ahead, then!
Navigator: Full speed uses a lot of fuel, Captain.
-> Captain: Let's not rush. We'll find another one.
Navigator: The next one is three days away, sir.
===The player has the choice of saying either “Full speed ahead, then!”, or “Let's not rush. We'll find another one.”
Depending on their choice, the Navigator will say “Full speed uses a lot of fuel, Captain.” or “The next one is three days away, sir.”.
Options within Options
You can also nest options below other options. For example, consider the following snippet of Yarn Spinner Script:
title: Start
---
Navigator: Captain, we're nearly out of tea.
Captain: How nearly?
Navigator: Two bags, and one of them is peppermint.
Captain: Then set a course for the nearest shop.
Navigator: There's a service station on the next moon.
Captain: Does it sell biscuits as well?
Navigator: It does, sir, but it closes in ten minutes.
-> Captain: Full speed ahead, then!
Navigator: Full speed uses a lot of fuel, Captain.
-> Captain: Then we'll buy fuel there as well!
Navigator: *sigh* Very well, Captain.
-> Captain: By gods! You're right!
Navigator: But it's only solution, I fear.
-> Captain: Let's not rush. We'll find another one.
Navigator: The next one is three days away, sir.
-> Captain: Three days is fine. We still have the peppermint.
Navigator: Nobody drinks the peppermint, sir.
-> Captain: Three days? Without tea?
Navigator: Sir?
-> Captain: We must do it!
Navigator: As always, sir, you're right.
===In this example script, the following options will be delivered together:
-> Captain: Full speed ahead, then!
-> Captain: Let's not rush. We'll find another one.And then, depending on which one was chosen, another set of options will be delivered together.
For example, if the player chooses Captain: Full speed ahead, then! , then the line from the Navigator will be delivered (Navigator: Full speed uses a lot of fuel, Captain. ) and then two options for the Captain will be provided:
-> Captain: Then we'll buy fuel there as well!
-> Captain: By gods! You're right!And if the player chooses Captain: Let's not rush. We'll find another one. , then the line from the Navigator will be delivered (Navigator: The next one is three days away, sir.) and then three options for the Captain will be provided:
-> Captain: Three days is fine. We still have the peppermint.
-> Captain: Three days? Without tea?
-> Captain: We must do it!
Testing out Options
Consider adding some lines that belong to the options below them, too.
