Passages you only want to appear once in Twine with Sugarcube 2.31.1

So I’m making games with a good amount of items right now. and in such a way that the set $haskeys thing will get pretty obnoxious, because I’m using Chapels Inventory system.
I was wondering if anyone knew of a tag or a code or a custom method or macro or anything that can make it so, once you view a passage once, you cant view it again.

First, the ` back tick for doing the inline code markup is on the same key as the ~ tilde key (on a US keyboard). It looks a lot like a ’ single quotation, but it’s not. :slight_smile:

Second, there’s the function visited() (reference is here) that counts how many times you’ve seen a passage. visited() returns the amount for the current passage (it’s incremented at the time of loading a passage, so it’ll be 1 if it’s the first time visiting the current passage), and visited("passage_name") is for a specific passage.

So basically, you can do this to have it only list the link if you haven’t been to the passage before:

<<if !visited("next_passage")>>[[Next|next_passage]]<</if>>

An alternative is to redirect to a different page if you’ve already been to the current one. This will happen before the page is displayed, so it shouldn’t be noticeable to the player.

<<if visited() > 1>><<goto "some_other_passage">></if>>