you are using something that's half completed so we can't really help you
not in less you are the user of that post
go look in the cookbook forum of that site there is a couple of daytime systems there
and sharing your full code what you have so far would be helpful too
#I have putted this in the script
init python:
class day_time(object):
def __init__(self):
self.day = 1 # set this to whatever starting day is
self.weekdays = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] # arrange these so first weekday goes first
self.time_of_day = ["morning", "noon", "evening", "night"] # add or remove to increase time of day slots
self.end_of_day = self.time_of_day[-1] # automatically picks last slot as end of day
property
def weekday(self):
return self.weekdays[(self.day-1)%7]
property
def time(self):
return self.time_of_day[0]
def advance(self, increment = 0, days = 0):
if not (increment + days): # no input
increment = 1
if days: # add to increment by length of time_of_day
increment += days * len(self.time_of_day)
while increment > 0: # loop through increments to shift timeslot and days forward
if self.time_of_day[0] == self.end_of_day:
self.day += 1
self.time_of_day.append(self.time_of_day.pop(0))
increment -= 1 # reduce incrememnt to escape loop after enough runs
default clock = day_time()
label start:
stop music fadeout 1.0
$ clock.advance()
scene black
with fade
show text _("The events and characters depicted in this game are fictional. Any resemblance to actual events or persons is purely coincidental.") at truecenter
pause 6
scene black
with fade
menu:
"{color=#800000}WARNING. The game features content not intended for persons under the age of 18. Are you over 18 years old?{/color}"
"{color=#32CD32}I am over 18 years old{/color}":
jump intro
"{color=#FF0000}I am under 18 years old{/color}":
"Come back when you reach the age of 18. Have a nice day!"
return
"{b}clock.day{/b} returns Day: {b}[clock.day]{/b}"
"{b}clock.weekday{/b} returns Weekday: {b}[clock.weekday]{/b}"
"{b}clock.time{/b} returns Time of Day: {b}[clock.time]{/b}"
"{b}$ clock.advance(){/b} advances time"
$ clock.advance() # advances time by one slot
"Advanced 1 slot:\n\nDay [clock.day] ([clock.weekday]) [clock.time]"
$ clock.advance(2) # advances time by two slots
"Advanced 2 slots:\n\nDay [clock.day] ([clock.weekday]) [clock.time]"
$ clock.advance(days=1) # advances one day
"Advanced 1 day:\n\nDay [clock.day] ([clock.weekday]) [clock.time]"
$ clock.advance(1,8) # advance 8 days and one slot
"Advanced 1 slot and 8 days (note night to morning still advances addition day):\n\nDay [clock.day] ([clock.weekday]) [clock.time]"
label morn:
scene black
if clock.time=="evening":
jump evening
if clock.time=="morning":
jump morning
if clock.time=="noon":
jump noon
if clock.time=="night":
jump night
else:
return
label evening:
scene black
"evening"
label morning:
scene black
"morning"
label noon:
scene black
"noon"
label night:
scene black
"night"
#It works like this but I want that he jumps to the noon label (if it morning for example) when I push the screen button
screen day_time_map:
zorder 103
if clock.time=="morning":
add Transform("morning.png", xpos=130, ypos=62)
if clock.time=="noon":
add Transform("noon.png", zoom=.8)
if clock.time=="afternoon":
add Transform("afternoon.png", zoom=.8)
if clock.time=="evening":
add Transform("evening.png", zoom=.8)
if clock.time=="night":
add Transform("night.png", zoom=.8)
screen week_day_map:
zorder 103
if clock.weekday=="Monday":
add Transform("monday_button.png", xpos=130, ypos=12)
if clock.weekday=="Tuesday":
add Transform("tuesday_button.png", zoom=.8)
if clock.weekday=="Wednesday":
add Transform("wednesday_button.png", zoom=.8)
if clock.weekday=="Thursday":
add Transform("thursday_button.png", zoom=.8)
if clock.weekday=="Friday":
add Transform("friday_button.png", zoom=.8)
if clock.weekday=="Saturday":
add Transform("saturday_button.png", zoom=.8)
if clock.weekday=="Sunday":
add Transform("sunday_button.png", zoom=.8)