renpy claiming name is not defined

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
monkeykg
Regular
Posts: 48
Joined: Mon Jan 01, 2018 6:36 pm
Projects: DATE KNIGHT
Tumblr: monkeywiki
Contact:

renpy claiming name is not defined

#1 Post by monkeykg »

Ok, i am getting this error

Code: Select all

While running game code:
  File "game/script.rpy", line 663, in script
    menu:
  File "game/script.rpy", line 665, in <module>
    "The beach" if thebeach1_done == False:
NameError: name 'thebeach1_done' is not defined

For this code-- which, it keeps telling me it's not defined, but i already defined the variables

Code: Select all

$ salon1_done = False
$ bar1_done = False
$ thebeach1_done = False
$ cafe1_done = False
$ park1_done = False
$ walk1_done = False
$ gohome1_done = False

Code: Select all

 menu: 
        
        "The beach" if thebeach1_done == False:
            $ thebeach1_done = True
            jump thebeach1
        "The salon" if salon1_done == False:
            $ salon1_done = True
            jump salon1
        "The bar" if bar1_done == False:
            $ bar1_done = True
            jump bar1
        "The park" if park1_done == False:
            $ park1_done = True
            jump park1
        "The cafe" if cafe1_done == False:
            $ cafe1_done = True
            jump cafe1
        "Just keep walking" if walk1_done == True:
            jump walkingoptions1
        "Go home" if gohome1_done == True:
            jump gohome2
I have no idea what the issue is.

mikolajspy
Regular
Posts: 169
Joined: Sun Jun 04, 2017 12:05 pm
Completed: Too many, check signature
Deviantart: mikolajspy
Location: Wrocław, Poland
Contact:

Re: renpy claiming name is not defined

#2 Post by mikolajspy »

Instead of $ symbol, which is used to change variable use define or default (define for something static, default for variables), so:

Code: Select all

default salon1_done = False
default bar1_done = False
default thebeach1_done = False
default cafe1_done = False
default park1_done = False
default walk1_done = False
default gohome1_done = False

User avatar
monkeykg
Regular
Posts: 48
Joined: Mon Jan 01, 2018 6:36 pm
Projects: DATE KNIGHT
Tumblr: monkeywiki
Contact:

Re: renpy claiming name is not defined

#3 Post by monkeykg »

mikolajspy wrote: Tue Feb 13, 2018 1:37 pm Instead of $ symbol, which is used to change variable use define or default (define for something static, default for variables), so:

Code: Select all

default salon1_done = False
default bar1_done = False
default thebeach1_done = False
default cafe1_done = False
default park1_done = False
default walk1_done = False
default gohome1_done = False
OHHH lmfao thank you, I was looking at an outdated code reference for it, probably.

Post Reply

Who is online

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