Howdy, Stranger!

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

Help with "if" macro?

Hello! I'm trying to create a story with a macro involved where the user cannot select a certain option until s/he has gone to a few pages.

I know in Twine v. 1, I can do this by inserting something like this:

<<if visited("Armoury", "Haberdasher")>>\
With your sword and hat, nothing can stop you!

But I'm using Twine v. 2, and no matter what I do, I can't figure out how to write it so the system recognizes it.

Please help!


  • <<if visited("ArmorPassage", "HatPassage", "SwordPassage") gte 1>>\
    You have everything you need!
    You are missing something.

    This should work, if I'm understanding the problem you're having correctly.
  • The Harlowe documentation mentions the (history:) macro, and the equivalent to your example would be:
    (set: $list to (history:))
    (if: $list contains "Armoury" and $list contains "Haberdasher")[With your sword and hat, nothing can stop you!]
    note: I assign the list returned by the (history:) macro to a $variable because I needed to search the list using the contains keyword more than once.
Sign In or Register to comment.