I am trying to replicate the menu-based conservation model from Inform 7 in Twine 2.0. I am using Harlowe. While I think I understand how the (set:) macro functions, I cannot figure out how to trigger a change in the value of a variable based on clicking on a link that keeps the reader within the same passage (as opposed to moving them to a new passage where I could clearly just reset the $variable there). Here is the code I am using:
Essentially, I want do want the link "Sweet" to appear until the reader has reader all three segments of the conversation, regardless of which order they are read in. I suspect there may be a simpler manner to achieve this goal.
(set: $convo to 1) Opening text..... Please select one: (link: "(1) >ASK PETER ABOUT HIS MOOD")["It sucks, bud," Doug says, "I can;t figure out how to code this passage," (set: $convo to it +1)] (link: "(2) >ASK PETER ABOUT HIS LIFE GOALS")["To be honest with you, I can't see my way out of this coding challenge at the moment." (set: $convo to it +1)] (link: "(3) >YOU'RE An IDIOT, PERIOD")["Only reason I hang out with you is because you make me feel cool. Get with the program," Doug says. Dougs looks at a floating plastic bag, caught by the wind between two derelict buildings." (set: $convo to it +1)] (if: $convo >= 4)[(link: "Sweet!")[(goto: "Next passage")]
Essentially, I want do want the link "Sweet" to appear until the reader has reader all three segments of the conversation, regardless of which order they are read in. I suspect there may be a simpler manner to achieve this goal.