0 votes
by (150 points)

I'd like to have an inventory system in my game that can be accessible at all times in the top or side of the page. I'd rather not have to copy/paste the link to it in every passage.

Is there a way to link to a passage in the stylesheet, to make a header with the link to this inventory passage? Also, can I make it so you can go back from the inventory to the last passage you were on, all variables still saved and the same etc?

Thank you!

1 Answer

+1 vote
by (23.6k points)

You'll need to give us the full version number of Twine and Sugarcube to get a definite answer to your question.

Here is a list of special passages in Sugarcube 2. Adding something to the passage entitled " StoryMenu " will add the element to Sugarcube's standard UI-Sidebar.

Here is a describtion of several functions in Sugarcube 2, including previous(), which will return the name of the last passage, that is not the current passage. The example given on the page also shows you how you can use this to return from an inventory passage back to the game.

by (150 points)
edited by

Oops, sorry: It's Twine 1.4.2 and Sugarcube 1.  Agh sorry, just looked again and it's actually Sugarcane. D:

I'll try out storymenu, thanks!

by (23.6k points)
If its Sugarcane, this answer probably won't work at all.
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.