I have a branching story. I want to use a passage as a simple container which may be reached from any of three or four unsatisfying branches. I then want to give the reader the option of either starting the story anew or returning to the point where they made a sub-optimal choice. I could easily do this by making a separate passage for each of the “return to” pages, but reusing bits of code is always a good thing to do.
The passage to which they might want to return is not going to be the one they just left, so using previous() won’t work. In the code below, I’m trying to set the variable _target to the passage that the reader was in before the passage called “Tell Rob.” But this doesn’t work. Rather than use the content of the variable, Twine creates a new passage called _target.
How can I set it up so that the link for the words “head back” (in the last sentence) will be variable?
<<nobr>><<if previous() is "Tell Rob">> <<set _target to "More Dosing">> <</if>> <</nobr>> You've steered Jayfer to a not very satisfying point in her life. Would you care to start over and [[try again|Story Start]]? Or would you prefer to [[head back|_target]] to the point where you made the crucial choice?