Twine Version: 2.6.2
Harlowe 3.3.5
Hey! I’m new to these kinds of communities, so if I mess anything up in formatting or using these forums wrong, please feel free to correct me! I’ve looked around other topics and am emulating what I see as best I can
My problem: I’m trying to code a timer/clock that starts at a specific time when the player opens the passage it’s on, and which continues counting up until the player leaves. (I would like to be able to have whatever it’s on when the player leaves appear in a different passage later on, but that’s much less important tbh). I’ve figured out the live: macro to an extent and have it working somewhat off of that? But I’ve run into a problem where, when the seconds variable reaches 59 and I set it back to zero, I’m having the minutes variable tick up by one, and while it’s doing that, it’s not doing it on zero seconds, like I set it to- it’s doing it on 1 second. What am I doing wrong?
Here’s my code, frankenstein-ed from the Twine For Beginners: Timers and Live Text thing on Wordpress (I would link but it doesn’t want me to? Weird)
{
(set:$hour to 0)
(set:$min to 8)
(set:$sec to 50)
(set:$milli to 0)
$hour : (live:1s)[(if:$sec is 0)[(set:$min to it+1)]$min] : (live:1s)[(set:$sec to it+1)$sec(if:$sec>=59)[(set:$sec to it-60)]] : (live:25)[(set:$milli to it +12)$milli(if:$milli >84)[(set:$milli to 0)]]
}
(note: I have $milli set to just be random numbers instead of anything affecting the rest of the clock, because it flashes by too fast for it to need to make sense, and I was having enough trouble with the sec/min, haha)