[SOLVED] Calendar Object Not Defined
Posted: Fri Oct 15, 2021 6:55 pm
Hello fellow devs,
I am a very new Ren'Py developer who has just started learning thanks to Thundy's awesome Ren'Py tutorials on YouTube. I am in lesson 11 and have just created my first class that will be used to hold calendar data. I created the code exactly as instructed by the video, I have re-checked my code at least 4 times already. In the tutorial, after he creates the object he wants to check and see if the Calendar Object is populating using the developer console. Mine says that Calendar is not Defined when I try it.
Here is the code that is being called:
When he runs the developer console and types "print Calendar.object" he gets a hex value of some sort. Mine has a panic attack and says that the object is not defined and presents this message:
I am not sure if this is the expected behavior or not, but can someone give it a glance and let me know?
Also, this is an Xpost to my thread in the RenPy Sub on Reddit.
I am a very new Ren'Py developer who has just started learning thanks to Thundy's awesome Ren'Py tutorials on YouTube. I am in lesson 11 and have just created my first class that will be used to hold calendar data. I created the code exactly as instructed by the video, I have re-checked my code at least 4 times already. In the tutorial, after he creates the object he wants to check and see if the Calendar Object is populating using the developer console. Mine says that Calendar is not Defined when I try it.
Here is the code that is being called:
Code: Select all
init python:
class Calendar(object):
def __init__(self, Hours, Hour, Days, Day, Months, Month, WeekDays, MonthDays):
self.Hour = Hour
self.Hours = Hours
self.Days = Days
self.Day = Day
self.Month = Month
self.Months = Months
self.WeekDays = WeekDays
self.MonthDays = MonthDays
@property
def Output(self):
return self.WeekDays[self.Day] + " " + self.Months[self.Month] + " " + str(self.Days + 1) + " " + str(self.Hours).zfill(2)Code: Select all
File "renpy/common/00console.rpy", line 689, in run
renpy.python.py_exec(code)
File "/Users/************/RenPy/renpy-7.4.9-sdk/renpy/python.py", line 2258, in py_exec
exec(py_compile(source, 'exec'), store, locals)
File "<none>", line 1, in <module>
NameError: name 'Calendar' is not definedAlso, this is an Xpost to my thread in the RenPy Sub on Reddit.