wyOOtdocs

Worked examples

A full story, annotated

A short story that uses everything above, with notes on each choice.

On this page
Already know this?Where each tool is used

The other examples each show one idea. This one is a small complete story, about four minutes long, that uses all of them together: a text field, a number, a list, a yes/no value, a dice roll, forks, story history, show-only-if paragraphs and achievements. It also has four endings, one of them secret.

Play it first, and try to find all four. Then read how it is put together.

Try it#

Try it

The logbook

It is your first night as the keeper of this lighthouse. The last keeper's logbook is open on the desk by the door, with a line waiting for your name. Keeper:

Fill in the answer above to continue.

  • name
  • oil1
  • bag(empty)
  • door_openno
  • roll0
A stormy first night. Try to find all four endings. Your achievements appear as lines in the preview when you earn them.

The map#

waitoil leftno oilgo upkey + cabinetfirst timeotherwiseopenignorethe tuberoll 3+elseagainLogbookLamp roomStill lit?First lightLight goes outStoreroomTomorrow's entryKnocking?A knockMaraRadioMaydayStatic
Loops and side trips are left out to keep it readable: taking the oil, and asking Mara for the tube.

Where each tool is used#

ToolWhere it appearsPage
A text fieldThe logbook asks for your name. It is printed in Mara's greeting and in two endings.Asking the reader for text
A numberoil starts at 1. The spare cans in the storeroom add 3. The lamp needs 2 to last the night, and the last fork checks that.A notebook the story keeps
A listbag holds the brass key and the radio tube.Lists and inventory
A yes/no valuedoor_open is set when you open the door. It changes the lamp room text and two endings.A notebook the story keeps
A dice rollFixing the radio is a roll of 1 to 6. On a 3 or more it works.Randomness
ForksThree of them: the knocking, the radio, and the one that ends the night.Hiding choices and forking
Story historyThe knock starts once. The oil can be taken once. Waiting for morning appears late.Story history
Show-only-if paragraphsThe wind is louder on later visits. Mara is drying her coat if she is in.Showing values in the text
AchievementsThree: one for the dawn, one for the radio, one hidden.Achievements

Scene by scene#

The logbook#

The first scene has one choice and one job: get a name. The field is set to Answer required, so the reader cannot skip it, and the maximum length is 24.

The lamp room#

This is the hub. It has three choices, and two of them do not always show.

  • "Go down to the storeroom" always shows, so there is always something to do.
  • "Go downstairs to Mara" shows only once the door is open.
  • "Wait for morning" shows only after the reader has made six choices. That is a Choices made so far check, and it is what stops a reader ending the night in the first minute.

The text tells the reader the rule and prints their count: the lamp needs two cans of oil, and you have oil. One paragraph appears after the first visit ("The wind is louder"), and another appears when door_open is yes.

The storeroom#

Four choices, and two of them are worth noticing.

  • "Take the three cans of oil" adds 3 to oil, and it hides itself once taken. It does this with the story history check Chose an option earlier, not with a separate yes/no value. The story already knows the reader chose it.
  • "Take the brass key" adds an item to bag and hides itself once it is there.
  • "Unlock the keeper's cabinet" needs the key in the bag, and it leads to the secret ending.

The fork that decides when the knock comes#

Going back up from the storeroom passes through a fork called "Does the knocking start?". It has a single rule with two checks at once: the reader has made at least three choices, and they have not already visited the knock scene. If both hold, the knock happens. If not, they go straight back to the lamp room. That is how a one-time event is scheduled without a flag.

The knock and Mara#

Opening the door sets door_open to yes. Mara greets the reader by name, which is a small callback to the text field, and she gives them a radio tube if they ask, once. The tube goes into bag, and the choice to ask disappears.

The radio#

This is the dice example from the last page. The fork rolls 1 to 6, and 3 or more sends the reader to the good ending. Otherwise "Static" lets them try again, with a new roll each time.

Waiting for morning#

The last fork, "Is there enough oil?", checks whether oil is less than 2. If it is, the bad ending. If not, the neutral one. The reader starts with 1 can, so one who never fetches the spare cans from the storeroom ends in the dark, and one trip fixes it. The endings say why, so it never feels arbitrary.

The endings#

  • Mayday, the good ending, is only reachable by letting Mara in and getting the radio to work. It carries an achievement that also requires that the reader chose to open the door.
  • First light is quiet. It has a paragraph that appears only if Mara was let in.
  • The light goes out is the bad ending, and it names the reader.
  • Tomorrow's entry is the secret. It is the only way to see what is in the cabinet, and its achievement is hidden until earned.

Why it hangs together#

  • Nothing is decorative. Each tool solves a problem the story would otherwise have: a one-time event, a timer, a puzzle, and an ending that depends on whether the reader found the oil.
  • Every scene has a choice that always shows.
  • The two most surprising moments are cheap. The stranger knowing the reader's name is one printed value. The cabinet's secret is one list check.

Things to try#

  • Add a scene where Mara tells the reader something, and let it change depending on whether they asked for the tube.
  • Add a fifth ending for a reader who lets Mara in but never fixes the radio. Use Has visited a scene on the static scene, or the door value, to route them.
  • Make the storm worse over time. Use Choices made so far to add a line to the lamp room after ten choices.
  • Build it yourself from scratch in the editor, using this page as the plan. It is the best way to learn where each control lives.

The end of the tour#

You have now seen every tool in the editor. The reference pages that follow are for looking things up: the Glossary, every Validation message, Shortcuts and limits, the FAQ, and What's new for authors.

Make your own copy#

Want to take it apart? Copy this story into your Studio and change it however you like.