0 votes
by (260 points)

I'm new to coding just so you all know.

Now for more context. I already have the

(link-goto: "Return", (history:)'s last)

set up.


However, my game has an inventory system.

And within that inventory, code set up below,

(for: each _item, ...$inv)[
<br>- _item

(click: "Nightstick")[(go-to: "Nightstick details")]

(link-goto: "Return", (history:)'s last)

When I click on Nightstick, it routes me to the detail page. But then I go back to the main inventory and want to proceed to the actual game, but when I hit "Return" it brings me back to the detail page.

How can I route the "Return" command to never target my detail page?

I like the idea of having a detail page and don't want the text to be displayed on the actual inventory main page using the display: macro. So that workaround isn't a solution for me.


Thanks for your help.


1 Answer

+1 vote
by (159k points)
selected by
Best answer

Please use the Question Tags to state the name and full version number of the Story Format you are using, as answers can vary based on that information. Based on the marco syntax of your examples I will assume you are using Harlowe.

The Basic "return from menu passages" handling for Harlowe thread on the Old Twine Forums explains how to solve your problem.

note: The information in the above linked thread was originally written for Harlowe 1.x but will work as is for Harlowe 2.x as well, however I do suggest changing the (if:) macro referenced in point 3 to use an (unless:) macro instead.

(unless: ((passage:)'s tags contains "menu"))[(set: $lastPassage to (passage:)'s name)]


by (260 points)
You sir/ma'am, are a wizard.


Thanks for answering my second question as well.