How do you make a link disappear after clicking it?

Hi, I’ve been struggling with this for a very long time. I want my character to search a room but I would like for that link to disappear after clicking it.

For example:
Inspect bathroom
Inspect underneath bed
Inspect in drawer

I don’t understand how to do the “set” and “if” conditions.

I don’t know if this is real or I’m confusing all the different things I’ve read, but isn’t there some flavor of Twine that has a “choicelist” markup style - like <<choicelist: [[link]] [[link2]] [[link3]]>> that puts them in a bulleted list and vanishes them after choosing?

As you didn’t supply a code example of what each of your links is currently doing it is difficult to know if they are:

  1. redirecting the Reader to another Passage, which then redirects the Reader back to the current one.
    eg. a markup based like [[Inspect bathroom]]
  2. dynamically updating the contents of the current page without the need for a Passage Transition.
    eg. a macro based like (link: "Inspect bathroom")[...code to change the current page...]

And the solution to your problem is different in each of the above use-cases.

If you sending the Reader to an interim Passage when they select one of the links then you can use the fact that that interim Passage has now been “visited” to determine if the related link should be shown.

The (visited:) macro combined with (unless:) macro to conditionally show content, like a link.
(untested example)

(unless: (visited: "Inspect bathroom"))[ [[Inspect bathroom]]]
(unless: (visited: "Inspect underneath bed"))[ [[Inspect underneath bed]]]
(unless: (visited: "Inspect in drawer"))[ [[Inspect in drawer]]]
1 Like