0 votes
by (150 points)
closed by

Hi there everyone. 

I'm currently writing a game that is using F2Andy's inventory system (here). I'm using Twine 2, Sugarcube 2.21.0.

Basically, what I want to happen is this. When the player opens up the link to an item in their inventory, the item passage will add a variable to the player. Then, certain passages will have additional links available to them if they have that variable. 

For example.

The player picks up a journal. Inside the journal, it reveals the location to a hidden key. The option to find the key in the proper room is not avaialbe until the player actually looks at the journal in their inventory, not just on picking it up. 

Right now, the problem I'm having is the <<back>> and <<return>> macros on the inventory page and the item page. 

If I use <<back>> on the item passage, then the variable won't be saved when I go back to the inventory, and thus, the passage they're on. 

If I use <<return>> on the item, then the <<back>> on the inventory passage keeps getting stuck in a loop between the inventory and the item. 

I hope I'm making sense with this question.




closed with the note: Answered

1 Answer

0 votes
by (159k points)
selected by
Best answer

The answer to the Returning from menu question explains how to track the name of the last non-menu related Passage see by the Reader, and how to create a link that will forward the Reader to that passage.

by (150 points)
Perfect! Thank you so much. :)