Howdy, Stranger!

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

Harlowe replacements for visited and turns?

edited July 2015 in Help! with 2.0
I'm a newbie trying out playing with (history:) but at the moment I can only check if it /contains/ - ie if reader has been to a particular passage at all.

I specifically want to be able to tailor most passages' response to the number of visits. If I only wanted to do a few I'd create a variable for each one: is there a better way? I believe that sugarcube used 'visited:' for this.

I also want to be able to get an 'in-game' timer to track time in game across passages - ie after 50 passage shifts, a global variable can change (from night to day...).

I don't really know whether I'm looking for a different macro or something that doesn't exist for Harlowe yet - I note there was a comment that history: might be updated in the future...


  • How about:
    (if: (count: (history:), "Passage Name") is 1)[You have been here before.]
    (elseif: (count: (history:), "Passage Name") is 2)[You have already been here twice.]
    (elseif: (count: (history:), "Passage Name") > 2)[You have been here many times.]
  • Yes - thankyou guinevak. I suppose what I really wanted was to see the code showing me how to inter-relate count and history. I haven't been using elseif yet either - so that's a significant little step up for me. Ta!
  • Is "Passage Name" taken from the actual passage automatically or does the actual passage name need to be hard coded as an argument?
  • "Passage Name" would just look for a passage called "Passage Name". In order to get the name of the current passage you need to use the (passage:)'s name macro.

    so guinevak's code would become
    (if: (count: (history:), (passage:)'s name) is 1)[You have been here before.]
    (elseif: (count: (history:), (passage:)'s name) is 2)[You have already been here twice.]
    (elseif: (count: (history:), (passage:)'s name) > 2)[You have been here many times.]
  • Just a note: I find that
    (if: (count: $X, $Y) is 1)
    is more conveniently written as
    (if: $X contains $Y)
    - although I can see why for consistency's sake you'd want to use the former alongside other (count:) uses.
Sign In or Register to comment.