Hi! I’m totally new to Twine, and have only been teaching myself to code for a year so this is a pretty basic question.
I’m at a part in my game where the player is faced with 3 doors, once they’ve gone through each door, I want a 4th option to appear. This is definitely super simple but I don’t even know what to look up to get started.
Could someone please explain to me how I could get this scenario to work? I really want to learn but I don’t fully understand macros yet so have hit a wall with this step.
To clarify, I’m also using Sugarcube. I want the player to go through each path once, and once they’ve been through all three paths to have a fourth one open up.
You didn’t supply a code example of the links you are using to access the first three ‘doors’ so it is difficult to know if each of the links leads to a unique Passage or not. I will assume your existing code looks something like the following.
You are in a hallway.
[[Door 1|Library]]
[[Door 2|Study]]
[[Door 3|Bathroom]]
There are a number of methods you can use to achieve the result you want. If my above assumption is correct then the simplest method is to use the hasVisited() function within an <<if>> macro to determine if all three Passages have been visited.
You are in a hallway.
[[Door 1|Library]]
[[Door 2|Study]]
[[Door 3|Bathroom]]
<<if hasVisited("Library", "Study", "Bathroom")>>[[Door 4|Bedroom]]<</if>>