How do I send players to a place decided by a variable?

Twine Version: 2
harlowe 3.3.8
I am new so sorry if I am being stupid. I am working on a project and I want to be able to have people go to the last area they were in. I have the name of the last passage stored in.
I have tried things like [[go back->$lastarea]] and variations of that including paranthesis, quotes, and more. Any ideas?

1 Like

If the last area was also the last passage, you can do (link: "Go back")[(go-to: (history:)'s last). If that’s not the case, there are other ways of doing this, but I’m starting with this one since it’s the simplest!

1 Like

Use the (link-goto:) macro to create the link, as the link macros:

  • support passing the current value of a variable as an argument.
  • don’t cause the Twine 2.x application the mistakenly create a “Missing Passage” with the same Name as the variable, like using a Markup based Link does.
(link-goto: "go back", $lastarea)

While your answer is correct, the (link-goto:) macro would be a better choice, as it results in one less macro call.

(link-goto: "Go back", (history:)'s last)
1 Like