Suslik575151
Member
- Jan 28, 2022
- 275
- 379
- 163
Hey so, if you click on Toggle Kinks and then click on Settings in the sidebar, it gets stuck in the return loop. I assume your return link works by recording the name of the last visited passage (also assuming you built this in sugarcube).
To avoid that, just tag the "settings" and "toggle kinks" passages (something like 'noreturn') and then make it so the last passage var only gets overwritten if the passage doesn't have that tag (that means you'll have to tag all the walkthrough passages as well as the achievements)
It should be pretty simple, the code should look something like this:
$(document).on(': passagestart', function (ev) {
if (!ev.passage.tags.includes('noreturn')) {
State.variables.return = ev.passage.title;
}
});
and then your return link should look like this [[Return|$return]]
Now, it's been a while, but I think Twine will automatically make a passage named $return, you just gotta delete it.
Edit: there's no space after the very first colon in the code
To avoid that, just tag the "settings" and "toggle kinks" passages (something like 'noreturn') and then make it so the last passage var only gets overwritten if the passage doesn't have that tag (that means you'll have to tag all the walkthrough passages as well as the achievements)
It should be pretty simple, the code should look something like this:
$(document).on(': passagestart', function (ev) {
if (!ev.passage.tags.includes('noreturn')) {
State.variables.return = ev.passage.title;
}
});
and then your return link should look like this [[Return|$return]]
Now, it's been a while, but I think Twine will automatically make a passage named $return, you just gotta delete it.
Edit: there's no space after the very first colon in the code
Last edited: