Hello, I am a beginner in Twine working on an interactive fiction. I have made an inventory system that works, however, every time I click the item for its description, return back to the inventory, and then attempt to exit the inventory to resume the main storyline, it loops me back to the inventory.
This is my code for the item:
(if: $rustykey’s isCarried is true) [A (link: “rusty key”)[(set:$selectedItem to $rustykey)(set: $previousPassage to “Inventory”)(goto: “Item Description”)]]
This is my code to exit the inventory:
All the main storyline passages also have the following code to allow for return:
(set: $previousPassage to “NameofPassage”)
I’m unsure how to fix this issue. Thank you in advance for helping!