I suspect that the answer to this is probably that I should just stop being lazy. But anyway, here it goes.
I wished there was a macro that quickly links to the "parent" passage of a passage.
() previous doesn't get the job done, because if, for example: I have a passage that's a room, then a wardrobe, then a drawer, and all of them have previous () at the end , I would get caught in a loop between wardrobe and drawer when going back from drawer.
It would also need to remember any variable changes when going back.
Is there a more automated way of doing this than writing customized links for going back in every passage? It can be a bit bothersome when there's a lot of exploring.
Comments
<<set $playboy = "notFound">>
Bedroom
You're in a bedroom. There is a chest of drawers here.
<<display 'Choices'>>
Choices
[[Search room.|Search]]
[[Check first drawer.|First Drawer]]
[[Check second.|Second]]
[[Check third.|Third]]
Search
You find nothing.
<<display 'Choices'>>
First Drawer
Clothes.
<<display 'Choices'>>
Second
Socks.
<<display 'Choices'>>
Third
Underwear.
<<if $playboy eq "notFound">>[[Look through underwear|Underwear][$playboy = "found"]]<<endif>>
<<display 'Choices'>>
Underwear
You find dad's Playboy magazines!
<<display 'Choices'>>
I found a fundamental flaw in the logic I was proposing though.
It would be impossible to have a macro that returns you to the "Parent Passage" since passages can have more than one parent. How would Twine know?
So yeah. This works just fine
If there are options in the bedroom you want to break the backtrack chain then ...just incase they find their way to another backtrack link without passing through another backtrackable location.
A more complicated solution would use an array as a stack that backtrackable locations would push themselves onto and the backtrack would pop them off of. Not got the variables for tracking what's where sorted yet though I suspect it should be doable with a <<backtrackable>> macro for the checkpoints and a tail on the backtrack links to flag that a backtrack is happening. It would differ from rewind in that it would not undo variable updates that have occured...