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.
Current best practices, especially to ensure the proper functioning of save and rollback is to declare your variable using default. Also you forgot the global declaration in your weekday function.
default day = 4
default hours = 18
default daynames = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
init -1 python:
def clocktick():
global hours
global day
hours += 1
if hours > 23:
hours = 0
day += 1
return
def weekday():
global daynames
return daynames[(day%7)]
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
trooper6, thanks for the answer! In general, everything works as it should, except for one thing: while saving and later loading, the values are reset to the initial ones that were set as default