Howdy, Stranger!

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

[[Home|previous()]] going to a passage named previous?

Another Harlowe to Sugarcube question.

When I use the syntax of previous() Twine creates a passage named previous(). All I want it to do is make the button Home go back to the previous passage.

Am I doing something incorrect?

Using Sugarcube latest version.

Comments

  • That is a "feature" of Twine 2 itself.

    You have several options to work around it:
    1. Simply delete the offending passage. Note, however, each time you make a new link like that, you'll have to do it again.
    2. Use the <<return>> macro—not its sibling <<back>>, as that undoes history.
    3. Use the <<link>> macro with a backtick expression (under: Passing an expression as an argument). For example:
      <<link "Home" `previous()`>><</link>>
      
  • The Link worked! Thanks again. @TheMadExile
  • what would be a set of circumstances to pick back instead of return macro?
  • That question was for @TheMadExile
  • what would be a set of circumstances to pick back instead of return macro?
    The only times you may want to use <<back>>, as opposed to anything else, are in cases where the player reaches a passage where: no state is modified—in particular, no story variable modifications—and there's no reason to know that they've been there—you never check its history.

    For example, a passage which only exists for the player to see some text. You don't modify any variables in it and you will never check for its existence within the history—via visited() or whatever. Probably not something that's commonly done much anymore.

    Usage of <<back>> was more important in SugarCube v1, because its history is unbounded. On the other hand, SugarCube v2's history is—by default—a limited sliding window, so <<back>> isn't really necessary.
Sign In or Register to comment.