My problem might be a little complex, I'll try to keep it as simple as possible since I understand only the basics of twine as it is.
I'm currently using Sugarcube and I have two additional options in the sidebar - 'Appearance' and 'Inventory'.
'Appearance' is simply a reference for what the character looks like and thus I ended it with a <<back>> macro. It doesn't and cannot influence the story in any way.
'Inventory' however, can influence the story as the main character can use items within the inventory cell. Therefore I ended it with a <<return>> macro.
Herein lies the problem. If one goes into 'Appearance' and then 'Inventory' using the sidebar, you'll get stuck in an infinite <<return>> <<back>> loop.
The current fix I have is disabling the Appearance tab when using the Inventory and vice versa. However, when I leave the Inventory tab using <<return>> the appearance tab stays off.
So here's my question. Is there a way to add the <<set $EnableAppearance to 1>> whenever the <<return>> macro is clicked? Or will I have to put <<set $EnableAppearance to 1>> in every other passage in my story because of this?
My apologies if this isn't clear.
Comments
Disregard everything. I've decided to move the inventory option away from the sidebar for now.
Anyway, you don't need a $variable simply to gate your menu links. Assuming that you're doing something like the following: Then you could simply check the active passage and enable/disable the links based on that, like so: Hopefully, you get the idea. If your inventory screen isn't a single passage, then its guard will need to be modified (e.g. preferably by checking for a tag).
Additionally, there are other ways to solve this problem: