Modifying DSE for days of the week[SOLVED]
Posted: Wed Jul 24, 2013 9:58 pm
Hello, I'm a bit new at coding with python/ren'py, so please bear with me >_<"
I modified the DSE framework a little so that it could accommodate days of the week, a week count and seasons. It seemed to work fine at first, but for some reason, Monday kept getting skipped over. Instead of going "Sunday -> Monday -> Tuesday" it just went "Sunday -> Sunday -> Tuesday". The second Sunday also manages to get the day planner even though it should jump to "label weekend" as well as move the week number up by one (so if it was week #0 on the first Sunday, it became week #1 on the second Sunday). All the other day transitions seem to work except for Sunday to Monday.
I'm not exactly sure what I'm doing wrong, so any help would be greatly appreciated c:
I modified the DSE framework a little so that it could accommodate days of the week, a week count and seasons. It seemed to work fine at first, but for some reason, Monday kept getting skipped over. Instead of going "Sunday -> Monday -> Tuesday" it just went "Sunday -> Sunday -> Tuesday". The second Sunday also manages to get the day planner even though it should jump to "label weekend" as well as move the week number up by one (so if it was week #0 on the first Sunday, it became week #1 on the second Sunday). All the other day transitions seem to work except for Sunday to Monday.
I'm not exactly sure what I'm doing wrong, so any help would be greatly appreciated c:
Code: Select all
# This is the entry point into the game.
label start:
# Initialize the default values of some of the variables used in
# the game.
$ day = 0
$ dayname = "undefined"
$ weekcount = 0
$ seasoncount = 1
# Show a default background.
scene black
# The script here is run before any event.
"...Blah blah blah..."
# We jump to day to start the first day.
jump day
# This is the label that is jumped to at the start of a day.
label day:
# Increment the day it is.
$ day += 1
if day == 1:
$ dayname = "Monday"
if day == 2:
$ dayname = "Tuesday"
if day == 3:
$ dayname = "Wednesday"
if day == 4:
$ dayname = "Thursday"
if day == 5:
$ dayname = "Friday"
if day == 6:
$ dayname = "Saturday"
if (day == 7):
$ dayname = "Sunday"
if day == 8:
$ weekcount += 1
$ day == 1
if weekcount == 8:
$ seasoncount += 1
$ weekcount == 0
if seasoncount == 1:
$ season = "Prevernal"
if seasoncount == 2:
$ season = "Vernal"
if seasoncount == 3:
$ season = "Estival"
if seasoncount == 4:
$ season = "Serotinal"
if seasoncount == 5:
$ season = "Autumnal"
if seasoncount == 6:
$ season = "Hibernal"
if seasoncount == 7:
$ seasoncount == 1
"It's [dayname]. This is week [weekcount] during the season [season]."
# Now, we call the day planner, which may set the act variables
# to new values. We call it with a list of periods that we want
# to compute the values for.
if (day == 6) or (day == 7):
jump weekend
else:
call day_planner(["Morning", "Afternoon", "Evening"])
label weekend:
"It's the weekend, I don't have anything to do! WHOOT!!!"
call events_end_day
jump day