If you are requesting technical assistance with Twine, please specify:
Twine Version: 2.34.1
Story Format: SugarCube
Hi all! Very similar to the javascript return issue mentioned here, I have storymenu buttons that the player can access at any time (i.e. ‘Appearance’). However, I noticed that return, back, and arbitarily long return do not stop the original cell from rerunning random().
Example origin cell:
<<set $RNG to random(1,100)>>
$RNG
I have tested this with everything I could find of return, back, and the following javascript coutesy of HiEv:
/* Trigger the following code at the start of navigation to a new passage. */
$(document).on(":passagestart", function (event) {
/* Make sure the current passage doesn't have a "noreturn" tag. */
if (!tags().includes("noreturn")) {
/* If it doesn't, then set $return to the current passage name. */
State.variables.return = passage();
}
});
$RNG is always, always a different number each time and it’s causing complications
Also, I’m unable to use HiEv’s SlideWin for now due to some storymenu buttons themselves containing links.