Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
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:
# 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
Last edited by Orison on Fri Jul 26, 2013 3:50 am, edited 1 time in total.
This is the problem right here. You put this part of the code at the wrong location.
This code should go immediately after you increment the variable "day" by 1 at the start, so to make the variable "day" wrap around before the part of the code that depend on it being within value from 1 to 7.
This is the problem right here. You put this part of the code at the wrong location.
This code should go immediately after you increment the variable "day" by 1 at the start, so to make the variable "day" wrap around before the part of the code that depend on it being within value from 1 to 7.
I'm not sure if it's because it's 3am my time and my brain just made me paste that in the wrong spot or if it's the code itself but that, unfortunately, didn't work.