Interactive Text Box (Help!)

Twine Version: 2.9.1
Story Format: Harlowe 3.3.8

Hello! I’m pretty new to twine and I’m looking for help making a password-protected passage. The hope is to have a textbox that a player will have to enter a specific phrase or word into in order to progress, but I’m having trouble figuring out how to do that just by reading the twine cookbook and Harlowe manual. I’ve figured out that (input: bind $Variable) will allow the player to change a variable to a string of whatever they enter into the box, but I’m lost with discovering how to translate a specific phrase into a way to get to the next passage. I know that (if: $Variable is "password")[[[next passage]]] won’t work because the if condition doesn’t continually check, and I thought that (cond: $Variable is "password")[[[next passage]]] might help me but I think I’m phrasing it wrong or otherwise it doesn’t do what I think because I keep getting this error message:
“The (cond:) macro was given the boolean value ‘false’, but needs 2 more values.”

Anyways, I’m going to keep reading to see if I can find what I need but help would be sooo appreciated! Thanks : )

One way to do this is to have an “enter” button/link that players can click after typing something in the text box, by putting something like this under your box:

(link-repeat: "Enter")[(if: $Variable is "password")[(goto: "next passage")](else: )[(dialog: "Incorrect password!", "OK")]]]

If you want to have the link to the next passage appear instead of sending the player there automatically, you can do that too, but I’m not a big Harlowe user so I’d have to poke around the documentation a bit to find the best way to do it (or someone else can if they get to this first).

1 Like

An enter button is perfect!! Thank you for this :slight_smile:

1 Like