Howdy, Stranger!

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

Okay, there's $currentPassage, but is there also a $previousPassage?

Hi!
My last thread got no answer so I started to painfully look into the code from scratch, and I wondered one thing. Sorry if that's a noob question, but if there is a $currentPassage is there also a $previousPassage? I couldn't find any information on $currentPassage on the wiki, and I couldn't find a list of things similar to it (I don't even know how to call these things that start with a $).
Basically, I'm trying to find a way to show choice history on screen and I wondered if a $previousPassage would do the trick.
Thanks!

Comments

  • You need to state which Story Format (both name and version) you are using when you ask a question, as answers can be different for each one.

    I am unsure which story format you are asking this question about because after using code similar to the following to do a quick test story for all the ones currently available for Twine 2 (including SugarCube 2 and Harlowe 2) I was not able to find one that had a built-in $currentPassage variable.
    currentPassage: $currentPassage
    
  • Oh yes indeed! Sorry, that was Twine 2 and Harlowe. I found a $currentPassage used in a test story on these forums and I downloaded it, it seems to work fine on Harlowe. Thank you for your answer.
  • Did the test story include either a header or footer tagged passage that contained code like the following:
    (set: $currentPassage to (passage:)'s name)
    
    ... because Harlowe does not have a built-in variable named $currentPassage.


    You can implement your own $currentPassage and $previousPassage variables by:

    1. Placing code like the following in a header tagged passage.
    (set: $previousPassage to $currentPassage)
    (set: $currentPassage to (passage:)'s name)
    
    2. Placing code like the following in a startup tagger passage:
    (set: $currentPassage to "")
    

    warning: The above examples were written from memory and have not been tested.
Sign In or Register to comment.