Page 1 of 1

Objects Not Defined? NameError [Solved]

Posted: Fri Jun 01, 2018 5:40 pm
by raeurae
Alrighty, I've done everything that I could think of, and I am still receiving this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 1858, in script
    
  File "game/script.rpy", line 1858, in <module>
    
NameError: name 'maki_eventone_done' is not defined
I am not entirely sure why this is occurring, as I have defined "maki_eventone_done" at the beginning of the script:

Code: Select all

$ maki_eventone_done = False
$ sasha_eventone_done = False
$ opal_eventone_done = False
$ lye_eventone_done = False
$ joseph_eventone_done = False
Here is where the error occurs:

Code: Select all

label end_daytwo:
    player_name "Alright, everybody, the day is almost over!  Time to share what we found."

    if maki_eventone_done == True:
    	"Sample Text"
Thanks in advance for the help <3

Re: Objects Not Defined? NameError

Posted: Fri Jun 01, 2018 5:46 pm
by Remix
Use

default maki_eventone_done = False

etc. Not inside any label, Not inside any init block, just that.

Where did you learn to use $ var = value for setting variables? It is nowadays mostly just a path to lots of errors and headaches. Maybe we can track down where people are learning that (yes, lots of people ask the same) and update those docs.

Re: Objects Not Defined? NameError

Posted: Fri Jun 01, 2018 6:03 pm
by raeurae
Remix wrote:
Fri Jun 01, 2018 5:46 pm
Use

default maki_eventone_done = False

etc. Not inside any label, Not inside any init block, just that.

Where did you learn to use $ var = value for setting variables? It is nowadays mostly just a path to lots of errors and headaches. Maybe we can track down where people are learning that (yes, lots of people ask the same) and update those docs.

Oh boy, that instantly fixed it, thank you so much.

One of the archived/historic Ren'py wiki pages is the first thing that comes up in Google: https://renpy.org/wiki/renpy/doc/tutori ... er_Choices

And, while I know it is very old, and some of it doesn't apply anymore (like this lmao), it seemed to be the only place I could find a complied version of information relevant to what I was looking for. Also,,, I think it is the first page that appears when you search anything related to storing choices

Re: Objects Not Defined? NameError [Solved]

Posted: Fri Jun 01, 2018 6:57 pm
by Remix
lol, yup that page is a bit out of date... pesky google keeping that in the listings