Hi,
I am working in Harlowe at the moment and I am pretty new to programming. I am trying to have the players input the right password so that they can go on. If they don't get the password right they end up back at the passage that asks for the password.
ALSO
I am trying to have the input come up by clicking a link. Once the player has gotten the password right, i want the link to be replaced by another link so that they won't need to retype the password everytime they come to this passage.
Here is what I have so far:
(set: $eno to (goto: "HOME"))\
(set: $adams to (goto: "John Adams"))\
(link: "PLAY")[(set: $password to (prompt: "Serial #:"))\
(if: $password is "secret")$adams,(else:)$eno]\
Comments
You can use a variable to control if your check password code is executed or not.
1. Initialise the variable in your story's startup tagged special passage.
2. In your Check Password passage use the variable to determine if you check the password or display the other link. ... notice I use a (link-repeat:) macro to allow the Reader to retry entering the password without needing to re-show the current passage again and again (which pollutes/pads the story History), and a named hook combined with a (replace:) macro to show an error.