I use Sugarcube. I'm working on something where the player will travel through a lot of different passages, but there's always the option to click on this one button I have that will take them to a different passage, like a hub
Only problem is, once the person's at the hub from whatever passage they came from, how do I get them back to that specific passage?
Let's say the player starts in Passage1, and travels all the way to Passage12, then goes to the hub. How do I code in that when they hit the
previous button, or whatever else, it returns them specifically to the one they just came from, rather than having to put them all the way back at a fixed passage like Passage1, and they have to redo everything.
Is there an easy way to implement this? I'd greatly appreciate any help with this problem.
Comments
So, like this, for example... assuming you have numbered passages as your text has suggested.
Just remember to rename the new passage because the auto-naming feature will jack it up.
Hi Sage, thank you for commenting.
It seems I've foolishly found an easy way to do what I'm asking.
Simply using the <<back "Home">> command returns you to the previous passage with a link titled "Home"
Thank YOU
Note there is also the previous() function. It returns the passage name.
For Harlowe, see this thread for more information: Incorporating the functionality of previous() in Twine 2?
Would it be possible to use the <<back>> or <<return>> command using an image instead of a text for the link? Something like <<return "<img/return.jpg>">>, only that works
Thanks a lot
(I post here because it's related to the topic, even though it's old, if it's wrong please let me know!)