wyOOtdocs

Memory: variables

Story history

React to scenes visited, choices made and turns taken.

On this page
Already know this?Where you can use it

So far, every check has been about a value you set yourself. Story history is different. The story already knows where the reader has been and what they have chosen, and you can check that directly, without setting up a value first.

The four checks#

Open the first dropdown of any check. Below your values is a group called Story history with four kinds of check.

  • Has visited a scene. Yes or no: has the reader been to this scene?
  • Times a scene was visited. How many times, compared with a number.
  • Chose an option earlier. Yes or no: did the reader pick this particular choice in this scene?
  • Choices made so far. How many choices the reader has made in total, compared with a number.

To add one directly, use or check the story history under a new check, or story history check once a check is already there.

A choice with a story history check: 'Choices made so far is at least 8'.
A choice with a story history check: 'Choices made so far is at least 8'.

When a visit counts#

A scene counts as visited once the reader leaves it. That is what makes a scene able to check its own history. The first time a reader arrives at the porch, visits of the porch is 0. After they walk away and come back, it is 1. So "visits is at least 1" means "the reader has been here before".

The same idea applies to "chose an option earlier": the choice is recorded when the reader takes it.

History covers scenes only. Forks are not counted, because readers never stop at one.

Try it#

Try it

The porch

You stand on a porch. A rocking chair creaks in the wind, and the front door is shut.
Walk away from the porch and come back. The text changes. Visit the garden, and a new choice appears on the porch.

Where you can use it#

You can use a history check wherever you can use any other check:

  • On a choice, to hide it or show it. The choice's check control appears once your story has at least one remembered value, and a spare one will do.
  • In a fork's rules, to route by what happened.
  • In a Shown-only-if paragraph, always. A paragraph block does not need any remembered value at all.
  • In an achievement's requirements, again once the story has a value.

What to use it for#

  • First visit against return visit. A scene that reads differently the second time, as in the example above.
  • Locking something until the reader has seen something else. "Try the door handle" appears only once they have looked around the back of the house.
  • Remembering a choice without a value. If the only fact you care about is "the reader chose to spare the guard", use Chose an option earlier. You do not need to set a yes/no value in that choice and check it later.
  • Pacing. Choices made so far lets you make things happen on a timer. After eight choices the storm arrives, whatever the reader has been doing.

Things to know#

  • History depends on the reader's actual path. It is worked out from what they did, so you cannot set it or reset it.
  • If you delete a scene or choice that a check points at, the editor flags the check as broken.
  • Stories that use history need a newer version of the Wyoot app than older stories do. Readers on a very old version of the mobile app are asked to update before opening one. The website always works.

Next#

You can now make a story respond to almost anything. The last piece of the toolbox is showing off what readers have achieved. Read Achievements, or skip ahead to Debugging your logic.