Time progression help
Posted: Sat Feb 20, 2021 7:29 pm
Hello! I am a beginner Renpy coder so sorry for any errors! I've been trying to keep the coding simple for now until I learn more.
I am trying to have an object (a bed) increase time in the game. I have the bed as an imagebutton:
screen bed_westbedroom2():
imagebutton:
action Call("WestBedroom2BedMenu")
and clicking on it calls this label:
label WestBedroom2BedMenu:
menu:
"Nap":
call Nap
"Sleep Until Next Day":
call Sleep
"Back":
return
$ renpy.pause(hard=True)
label Nap:
$Time += 1
return
label Sleep:
$Day += 1
$Time = 0
return
And have this as the variables:
$ WeekDays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
$ TimeofDay = ["Morning", "Noon", "Afternoon", "Evening", "Night", "Midnight"]
$ Day = 0
$ Time = 4
$ Output = WeekDays[Day] + " " + TimeofDay[Time]
if Time > 5:
$ Time = 0
$ Day += 1
if Day > 6:
$ Day = 0
I can't get the time to progress (I have the Output variable showing on the screen as a hud). Any help would be appreciated, thanks!
I am trying to have an object (a bed) increase time in the game. I have the bed as an imagebutton:
screen bed_westbedroom2():
imagebutton:
action Call("WestBedroom2BedMenu")
and clicking on it calls this label:
label WestBedroom2BedMenu:
menu:
"Nap":
call Nap
"Sleep Until Next Day":
call Sleep
"Back":
return
$ renpy.pause(hard=True)
label Nap:
$Time += 1
return
label Sleep:
$Day += 1
$Time = 0
return
And have this as the variables:
$ WeekDays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
$ TimeofDay = ["Morning", "Noon", "Afternoon", "Evening", "Night", "Midnight"]
$ Day = 0
$ Time = 4
$ Output = WeekDays[Day] + " " + TimeofDay[Time]
if Time > 5:
$ Time = 0
$ Day += 1
if Day > 6:
$ Day = 0
I can't get the time to progress (I have the Output variable showing on the screen as a hud). Any help would be appreciated, thanks!