Howdy, Stranger!

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

Makin link to previous visited passage in Twine 2 Alpha?

I've successfully used  somre old-style macro, but how to make user to jump to previous passage? Function previous() doesn't work.

Comments

  • This is how previous() is used, and it does work as intended: [[Back|previous()]] or <<set $foo = previous()>>. I'm posting real quick from school, but I believe one can also use <<back>> to create a link that will display the last passage.

    You can also set the name of passages to a variable like so: <<set $foo = "Name of Passage">>, or use <<set $foo = passage()>> to set it to the current passage's title.

    After doing so, you can add the variable to a link or macro like this: [[Link|$foo]] or <<display $foo>>.

    Again, I don't have twine, but to force the last passage to display, you might try this and see what happens:
    <<set $foo = previous()>>
    <<$foo>>
    Here are a couple links to read:

    http://twinery.org/wiki/function
    http://twinery.org/wiki/macro
  • No. It creates passages with titles like "$foo", or "previous()".
  • Like I explained in my post, but then neglected to put "display" in my code, if you <<set $foo = previous()>> then <<display $foo>>, I'm fairly certain <<display $foo>> will display the last-visited passage.

    Are you using Twine 1.4.x? The previous() function isn't available in 1.3.x.

    Copy and paste the code you're using or post a TWS or HTML file and we'll take a look.
  • Sharpe wrote:

    Are you using Twine 1.4.x? The previous() function isn't available in 1.3.x.


    Based solely on the "Twine 2 Alpha" in the subject, I'm guessing that they're using Twine 2, not Twine 1.x.
  • Shit. Sorry, I just now noticed in your title it says Twine 2 Alpha. Missed that in haste.

    Just tested the following in Twine 2 and it works the same as in the other versions:
    <<set $foo = "Second Passage">>
    <<display $foo>>
  • Sharpe wrote:

    Shit. Sorry, I just now noticed in your title it says Twine 2 Alpha. Missed that in haste.

    Just tested the following in Twine 2 and it works the same as in the other versions:
    <<set $foo = "Second Passage">>
    <<display $foo>>


    Yes, some macro works. But not previous() :( Which is most useful for me.
  • Well, give it time. It's still in Alpha. :)
Sign In or Register to comment.