Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Make a new link appear after visiting all links in a passage?

Hey there. I'm trying to make it so that when the player visits all of the available links in a given passage, a link to a new passage appears.
I'm using 2.0 and Harlowe, and tried using the history macro, but I guess that only checks for one passage at a time, so maybe it's the wrong tool.
Here's what I tried:
(if: (history:) contains "1", "2", "3", "4")[[[new link here]]]
I get why this doesn't work, I think, because history can't have more than one string attached to it, I'm just not sure what the alternative would be. Thanks in advance for the help.

Comments

  • edited September 2015
    First a couple of clarifications:

    1. The (history:) macro returns an array containing the names of all the passages you have navigated forward through up to and including the previous passage.

    2. The contains keyword checks an array for a single value, not a list.

    3. When evaluating more than one expression within a (if:) macro you need to separate each expression with either an and or an or depending on if all expressions need to be true or only some of the expressions need to be true.

    The following is one way to do what you want:
    note: I am assigning the current value of (history:) to a local variable because we don't know how much work Harlowe has to do to generate the history array and we need it to generate that array four times.
    (set: $list to (history:))(if: $list contains "1" and $list contains "2" and $list contains "3" and $list contains "4")[ [[new link here]]]
    
    ... note the single space character between the (if:) associated hook's open square bracket and the start of the new link here markup link, this is current;y needed due to a bug.
  • Yeah, that did it. Thanks!
    I am so horribly confused as to how to use variables, I would never have considered that solution. I appreciate the help.
  • ... note the single space character between the (if:) associated hook's open square bracket and the start of the new link here markup link, this is current;y needed due to a bug.

    Well I wish I knew that about eight hours ago. I was using crazy macros to try to overcome that problem. At least there's an easy fix!
Sign In or Register to comment.