I am using SugarCube 2.18.0 and Twine 2.1.3.
Okay so I have a time system in place and I wanted the player to be forced to 'sleep' after a certain time and then the day would go to the next and the 'time' would reset.
There are 8 turns in a day but the 'turns' arent counted by systems' original turn counter, it's counted by a special tag so specific passages don't take up time but others take up a lot of time (like three turns). I have the time displayed in a header and it follows the time really nicely.
Until I get to after the 8th turn (which is when the player is to be sent to sleep).
As I have the code right now, the passages up the turn and then my PassageReady page figures out if it's past the 8th turn and it's supposed
to goto send you to the Late] passage which links to [[Sleep
<<if $turn > 8>><<goto [[Late]]>><</if>>
The problem is, every time I test it after turn 8, it just...stops. It sends me to a blank page with nothing.
The passage it's supposed to send you to looks like this:
It's late and you are tired. You decide to get some sleep.
But again, it's blank.
Should I just have the player return to the base and have an if statement say after turn 8 the only thing you can do is sleep?
Instead of using a <<goto>> macro during the processing of the next passage to be show, use the Config.navigation.override feature in the Configuration Object to conditionally override which passage will be shown next.
Your code didn't check whether the player already was in the right passage and kept sending them there over and over. The code above fixes the problem.
Alternatively, this might work better, since otherwise resting might also send you back to "Late":