Need a little help with a glitch(Resolved)

I have

*temp unc1 0
*rand unc1 1 180
*set sec + unc1
*goto_scene opening
Then Opening
[b]DAY ONE: 
*gosub_scene calculation death_clock
*page_break ${sec} Sec ${min} Min ${hrs} Hrs ${days} Days[/b]

Under Calculation

*label death_clock
*gosub sec
*gosub min
*gosub hours
*gosub days

*label days
*if (days=3)
 *goto_scene death

*label hours
*if (hrs>=25)
 *set days + 1
 *gosub co2
 *set hours - 24

*label min
*if (min>=61)
 *set min - 60
 *set hours + 1
 *gosub warmth

*label sec
*if (sec>=61)
 *set sec - 60
 *set min + 1
 *set batt - drain
 *set batt + input
 *gosub heater
 *gosub batt

The problem is the minutes will change accordingly but the seconds do not. It will show 88 seconds for example. The minute changed but the function did not set the seconds back to under 60. So what am I doing wrong, thanks for any help.

What is unc1 I notice you have

*set sec+unc1

Is it that?

1 Like

Sometimes I solve my own problems after posting lol. I did try solving this for 20 minutes before geting fustrated and asking for help. Sorry to post this then but the problem lies in the *rand unc1 1 180
and the equation exceeds the 60 that is subtracted from the seconds. I have redone the setup which now works well. Thanks for anybody that may have looked at this.

@Nocturnal_Stillness it is just a temp name I give for a random number is all. :smile:

1 Like