Login
Remember
IF Answers
Ask a Question

# Twine: how can I check if a passage has been visited?

+2 votes
174 views
asked Apr 7 in Authoring by peterorme (104 points)

In Twine 1.4, is there some built-in way of checking whether a given passage has been visited?

- twine

## 1 Answer

0 votes
answered Apr 7 by AndrewS (250 points)
selected Apr 8 by peterorme
Best answer

I made a small Twine with Start, Room 1, Room 2 and Room 3. Start pointed to Room 1 and Room 2, which pointed to each other.

Here is a sample code of Room 1:

    You can visit [[Room 2]].

    Room 1 is visited <<print visited("Room 1")>> times.
    Room 3 is visited <<print visited("Room 3")>> times.

    <<if visited("Room 3")>>How did you manage to visit room 3? Wow!<<else>>Room 3 is unvisited!<<endif>>

commented Apr 8 by peterorme (104 points)
Right. The twine documentation is a little hard to traverse if you're not sure what you're looking for, but this info is on the "function" page: http://twinery.org/wiki/function

## Related questions

- How can I add changing maps or inventories to a Twine game?
- How can I find a good Twine game?
- Twine with sugarcube: can you display visited links differently?
- Twine: Is there a macro or something to automatically go to another passage?
- How do I pass variables between Twine and javascript?

...