I'm using Twine 2 and Sugarcube 2.
Recently I asked how to avoid return loops and got the answer to use the following:
predisplay["Menu Return"] = function (taskName) {
if (! tags().contains("noreturn")) {
State.variables.return = passage();
}
};
and
[[Return|$return]]
This works fine in some cases, but it turns out that many situations need the equivalent of the back macro, not the return macro, as returning to certain passages sets variables too many times. How would I get that with a function, or otherwise skip parts of the history with a back macro or similar function?
The problem could be sidestepped if I could determine which passages the ui bar shows up in. Is there a way to do that? I think I've seen it in some games.
Comments
note: I am not at a machine with SugarCube 2 installed, so I have not tested the following.
Try replacing a $return link with: