Objects Not Defined? NameError [Solved]

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.
Post Reply
Message
Author
User avatar
raeurae
Newbie
Posts: 8
Joined: Sat May 26, 2018 2:44 pm
Projects: Times New Roman
Tumblr: raeurae
Deviantart: raeurae
Location: weeaboo paradise
Contact:

Objects Not Defined? NameError [Solved]

#1 Post 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
Last edited by raeurae on Fri Jun 01, 2018 6:08 pm, edited 1 time in total.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Objects Not Defined? NameError

#2 Post 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.
Frameworks & Scriptlets:

User avatar
raeurae
Newbie
Posts: 8
Joined: Sat May 26, 2018 2:44 pm
Projects: Times New Roman
Tumblr: raeurae
Deviantart: raeurae
Location: weeaboo paradise
Contact:

Re: Objects Not Defined? NameError

#3 Post 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

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Objects Not Defined? NameError [Solved]

#4 Post by Remix »

lol, yup that page is a bit out of date... pesky google keeping that in the listings
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Majestic-12 [Bot]