Twine Version:2.12.0
I’m making a game in sugar cube at the moment but I ran into the issue of return looping happening if the player tries to go from one menu to the next without returning to the main game. I wanted to try and solve it using the following code but it didn’t work. Any solutions or ideas?
<<if !tags(previous()).includes("menu")>>
<<script>>
$Return=previous();
<</script>>
<</if>>
<<return “close menu” $Return>>
the idea is to make the Return variable be the string of whatever passage name you were last in that wasn’t a menu, and have $Return only be assigned a passage whenever you entered a menu to begin with to not just unnecessarily update it. Yet it never updates $Return