Hello! I am using Harlowe in Twine 2.0.10. I'm also fairly new to Twine so it's possible I am making simple/dumb mistakes.
Here's a simple example sentence: "A Radiohead poster hangs in your room."
I want "Radiohead" to be a link that, when clicked, is replaced by another link ("Gone with the Wind", let's say). I want the user to be able to keep clicking that link and changing it to new things over and over, cycling through a list of 10-20 phrases over and over.
Here is my current solution:
A [Radiohead]<band1| poster hangs in your room.
(click: ?band1)[(replace: ?band1)[ [Gone with the Wind]<band2|]]
(click: ?band2)[(replace: ?band2)[ [Wu-Tang Clan]<band3|]]
(click: ?band3)[(replace: ?band3)[ [Rick and Morty]<band4|]]
(click: ?band4)[(replace: ?band4)[ [Real Madrid]<band5|]]
(click: ?band5)[(replace: ?band5)[ [Marilyn Monroe]<band6|]]
(click: ?band6)[(replace: ?band6)[ [Radiohead]<band1|]]
Problem is, even though Radiohead is re-named to be band1 at the end, it doesn't show up as a link at the end of the loop--it's just plaintext.
I suspected that the program was just running through the code once and giving up. So I tried just copy-pasting the above block over and over and that sort of worked--although, of course, once you run through it as many times as it's there, the same problem arises. This also seemed like a really dumb way to solve the problem.
So my questions are: is there a way to make the program loop back after the last line? Or is there a better way to make the program do what I want it to here?
Comments
One way to resolve this would be to do something like the following: (requires Harlowe ≥ v1.2.0) Which uses (link-repeat:) to make a link which may be clicked multiple times. The other bits simply declare an array of posters and rotate said array upon clicking the link, replacing the link text with the current 1st element of the array.
If you wanted to know later on which poster the player chose, it's the 1st index (i.e. $posters's 1st).
I'm not an expert on Harlowe, so there may be other ways as well.