NameError: global name '_menu' 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
messenjerk
Newbie
Posts: 8
Joined: Tue Feb 27, 2018 3:07 pm
Contact:

NameError: global name '_menu' is not defined

#1 Post by messenjerk »

my game was working fine, i wrote the last two endings (ge4 and be7) when it suddenly gave this error and wouldnt load

heres my script

Code: Select all

define v = Character("Vesta")
define h = Character("Tyler")
define f = Character("Toby")
define b = Character("Bill")
define s = Character("Stacie")
define t = Character("Taylor")
define a = Character("Alex")

label start:

show game
with fade

label start1:
    
    "Today is the day that I finally get Vesta."
    
    "Time to make my profile!"
    
    label name:
    
    v "Please enter your name."
    
    $ player_name = renpy.input("My name is...")
    
    $ player_name = player_name.strip()
    if player_name == "":
        $ player_name="Carol"
    if player_name == "testingcheats on":
        jump cheat
            
    v "You have entered your name as %(player_name)s, is this correct?"

menu:
    "Is your name correct?"
    
    "Yes.":
        jump picture        
    "No.":
        jump name
        
label cheat:
    
    f "Now what do you think you are doing?"
    
    h "Are you... trying to cheat?"
    
    h "What the heck, dude?! Why would you do that?"
    
    f "Well, the player needs to learn their lesson."
    
    f "What should we do as punishment?"
    
    h "How about... we give them something that shows the world how they're a cheater?"
    
    f "Like a dunce cap?"
    
    h "Yeah!"
    
    f "That sounds great. Well player, here you go."
    
    h "Cheaters never prosper!"
    
    jump se1
    
label se1:
    
    show text "Secret Ending: Developer Tools" at truecenter
with dissolve
pause 1
hide text
with dissolve

return

label picture:
    
    v "Please pick your profile picture."
    
menu:
    
    "one":
        $ skin = "white"
        jump game
    
    "two":
        $ skin = "light"
        jump game
        
    "three":
        $ skin = "dark"
        jump game
        
    "four":
        $ skin = "black"
        jump game
    
label game:

    v "Hey, %(player_name)s! Welcome to Vesta!"
    
    label usern:

    v "Please choose a username."
    
python:
    usern = renpy.input("My username is...")
    usern = usern.strip()
    
    if not usern:
        usern = "%s123" % (player_name)
    
menu:
    "Do you want [usern] to be your username?"
    
    "Yes.":
        jump chrs        
    "No.":
        jump usern
        
label game2:
    
    v "Okay, [usern], now it's time to fill out your profile."
    
label chrs:
    
    v "You have 4 new friend requests!"
    
    "I only want to talk to one person right now..."

label who:

menu:
    "Who do you want to talk to?"
    
    "billiam743698":
        jump ap
        
    "xxstacie.malikxx":
        jump bp
        
    "taylor.peters44":
        jump cp
        
    "alexkicks_11_":
        jump dp
        
label ap:
    
    "His profile makes him seem pretty cool."
    
menu:
    "Should I talk to him?"
    
    "Yes.":
        jump a1
        
    "No.":
        jump who
        
label bp:
    
    "It's my good friend Stacie's profile!"
    
menu:
    "Should I talk to her?"
    
    "Yes.":
        jump b1
        
    "No.":
        jump who
        
label cp:
    
    "Her profile makes her seem kinda weird."
    
menu:
    "Should I talk to her?"
    
    "Yes.":
        jump c1
        
    "No.":
        jump who
        
label dp:
    
    "His profile makes him seem pretty chill."
    
menu:
    "Should I talk to him?"
    
    "Yes.":
        jump d1
        
    "No.":
        jump who
        
label a1:
    
if skin == "white":
    show gamewhite
    with dissolve
if skin == "light":
    show gamesecondmid
    with dissolve
if skin == "dark":
    show gamethirdmid
    with dissolve
if skin == "black":
    show gameblack
    with dissolve
    
    "Hi."
    
    b "Hi! Here's a photo of my dogs!!"
    
menu:
    
    "Cute!":
        jump a2
        
    "Do I know you??":
        jump a3
        
label a2:
    
    "Cute dogs, dude!"
    
    b "Thanks, %(player_name)s!"
    
    jump a2q
    
label a3:
    
    "Do I know you?"
    
    b "I'm Bill, I go to Windsor High."
    
    "...really?"
    
    jump a3q
    
label a2q:
    
menu:
    
    "I have pets too!":
        jump a4
        
    "What are your dogs' names?":
        jump a5
        
label a3q:
    
menu:
    
    "I've never seen you before.":
        jump a6
        
    "Ok, I guess. Tell me about your dogs.":
        jump a5
        
label a4:
    
    "I have pets too, actually!"
    
    b "Really? What do you have?"
    
    "I have a cat named Nacho."
    
    b "Aww! Cute name, haha."
    
    jump a7
    
label a5:
    
    b "The yellow lab's name is Blondie, and the husky's name is Fuzzo."
    
    b "Do you have any pets?"
    
    jump a4
    
label a6:
    
    "I've never heard of you."
    
    b "Oh, really?"
    
    b "I'm in STEM, and I take Photography."
    
menu:
    
    "Ok, whatever. What's your dogs' names?":
        jump a5
        
    "... I don't trust him.":
        jump ge1
        
label a7:
    
    b "You know what would be fun?"
    
    "What?"
    
    b "If we met up!"
    
menu:
    
    "Sounds like fun!":
        jump a8
        
    "Maybe not...":
        jump a9
        
label a8:
    
    "Sounds like a ton of fun!"
    
    b "So I need your address, what is it?"
    
    jump a8q
    
label a9:
    
    "Uhh... I can't today. Sorry."
    
    b "What?! Come on dude!"
    
    "I have class later today."
    
    "Plus, I just met you."
    
    b "Come on, %(player_name)s! It'll only be a second!"
    
    b "And it'll be super fun! Come on, please?"
    
    jump a9q
    
label a8q:
    
menu:
    
    "Here's my address!":
        jump a12
        
    "Uhh...":
        jump a11
        
label a9q:

menu:
    
    "Fine, I'll go.":
        jump aa11
        
    "No thanks.":
        jump a10
        
label a10:
    
    "Dude, you're being super creepy right now. I don't want to go."
    
    b "%(player_name)s, you're going to make me really sad if you don't come."
    
    "Uh... I'm sorry?"
    
    "I don't wanna go."
    
    b "Please?"
    
    "No."
    
    b ":-("
    
    jump ge1
    
label a12:
    
    "My address is 582 Blazetrail Drive!"
    
    b "Awesome! I'll be there in a second!"
    
show text "15 minutes later..." at truecenter
with dissolve
pause 3
hide text
with dissolve

label aa12:

    b "I'm at the end of the street, do you mind walking?"
    
    "Not at all! I'm on my way!"
    
    "Also, what does you car look like?"
    
    b "I have a white pickup truck."
    
show blackbg
with dissolve

show text "{color=#FFF}I walk to the end of my street and get into his car.{/color}" at truecenter
with dissolve
pause 3
hide text
with dissolve

show text "{color=#FFF}I am surprised to see a middle aged man in the truck instead of the teen in his profile picture.{/color}" at truecenter
with dissolve
pause 5
hide text
with dissolve

show text "{color=#FFF}I gasp as he puts a gun to my head and locks the car's doors.{/color}" at truecenter
with dissolve
pause 3
hide text
with dissolve

show text "{color=#FFF}Bad Ending: Kidnapped.{/color}" at truecenter
with dissolve
pause 5
hide text
with dissolve

jump ret

label a11:
    
    "Uhhh..."
    
    b "What?"
    
    "I don't think I'm comfortable with giving my address to you."
    
    "I literally just met you."
    
    b "That's fine! We can meet at Kaiser Park!"
    
    "Ok! I'll meet you there!"

label be2:
    
show blackbg
with dissolve

show text "I walk to Kaiser park." at truecenter
with dissolve
pause 3
hide text
with dissolve

show text "I look around for Bill, but I can't find him anywhere." at truecenter
with dissolve
pause 5
hide text
with dissolve

show text "I am suddenly grabbed from behind, and I'm dragged away." at truecenter
with dissolve
pause 5
hide text
with dissolve

show text "Bad Ending: Kidnapped." at truecenter
with dissolve
pause 5
hide text
with dissolve

jump ret

label aa11:
    
    "Fine, let's meet at Kaiser Park."
    
    b "Okay! See you there!"
    
    jump be2
    
label ge1:

show blackbg
with dissolve

show text "I block Bill." at truecenter
pause 3
hide text
with dissolve

show text "I'm not sure if he actually goes to WHS." at truecenter
with dissolve
pause 5
hide text
with dissolve

show text "I'll make sure to ask tomorrow." at truecenter
with dissolve
pause 5
hide text
with dissolve

show text "Good Ending: Playing It Safe." at truecenter
with dissolve
pause 5
hide text
with dissolve

jump ret

label ret:
    return
    
    
label b1:
    
if skin == "white":
    show gamewhite
    with dissolve
if skin == "light":
    show gamesecondmid
    with dissolve
if skin == "dark":
    show gamethirdmid
    with dissolve
if skin == "black":
    show gameblack
    with dissolve

label b11:
    
    s "Hi hunty!!!!!!!"
    
    "What's up Stacie?"
    
    s "Nothing much, what about you?"
    
    "I'm doing pretty good!"
    
    s "So did you see the new episode of Pretty Little Girls??"
    
    s "I was actually screeching."
    
menu:
    
    "Don't say anything! I haven't watched it yet!":
        jump b2
        
    "Tell me everything!!":
        jump b3
        
label b2:
    
    "Don't you dare say a word!"
    
    "I haven't watched it yet!!"
    
    s "Ok... but someone dies... ;)"
    
    "Stacie!!!"
    
    s "I'm joking, I'm joking!!"
    
jump b2q

label b3:
    
    "Spill the tea!"
    
    s "SOOO..."
    
    s "Ryan and Mikayla break up!"
    
    "WHAT??!!!"
    
    s "I'm not even done yet!!"
    
    "Come on! Tell me then!"
    
    "..."
    
    "Hello?"
    
    "Stacie??"
    
    "Where'd you go?"
    
    s "Sorry lol, I'm driving haha."
    
jump b3q

label b2q:
    
menu:
    
    "You better be!":
        jump b4
        
    "Ugh, Stacie, don't scare me like that!!":
        jump b5
        
label b4:
    
    "You better be joking..."
    
    s "I am, don't worry."
    
    "Ugh...."
    
label bw:
    
    "So what are you doing right now?"
    
    s "Driving to the mall."
    
jump b3q

label b5:
    
    "Don't scare me like that!!"
    
    s "Sorry %(player_name)s, I had to. :)"
    
jump bw

label b3q:
    
menu:
    
    "You're driving?!":
        jump b6
        
    "Okay, cool.":
        jump b7
        
label b6:
    
    "What?!"
    
    s "?"
    
    "You're drving right now??"
    
    s "Yeah?"
    
    "Get off your phone!"
    
    "You could get into an accident!"
    
    s "But I text and drive all the time, and I've never crashed."
    
    "It doesn't matter!"
    
    "Get off your phone, Stacie."
    
    s "Fine, whatever."
    
    s "See you in a bit, %(player_name)s."
    
    jump ge2
    
label b7:
    
    "Ok."
    
    s "Yeah lol, there is so much traffic right now."
    
    "Ugh dude, that sucks."
    
    s "Ye"
    
    "Ye?"
    
    "Lol, what even."
    
    "..."
    
    "Hello?"
    
    "Helllllooooooo????"
    
jump be3

label be3:
    
show blackbg
with dissolve

show text "I didn't see Stacie at school the next day." at truecenter
with dissolve
pause 3
hide text
with dissolve

show text "Her mom calls me, and tells me that she got into a fatal car accident." at truecenter
with dissolve
pause 5
hide text
with dissolve

show text "I know exactly why it happened." at truecenter
with dissolve
pause 3
hide text
with dissolve

show text "Bad Ending: Accidental." at truecenter
with dissolve
pause 5
hide text
with dissolve

jump ret
    
label ge2:
    
show blackbg
with dissolve

show text "Stacie is at school the next day, thankfully." at truecenter
with dissolve
pause 3
hide text
with dissolve

show text "Even if she is the best driver, I don't want to risk losing her." at truecenter
with dissolve
pause 4
hide text
with dissolve

show text "Her mom thanked me." at truecenter
with dissolve
pause 2
hide text
with dissolve

show text "Good Ending: Being Careful." at truecenter
with dissolve
pause 5
hide text
with dissolve

label c1:
    
if skin == "white":
    show gamewhite
    with dissolve
if skin == "light":
    show gamesecondmid
    with dissolve
if skin == "dark":
    show gamethirdmid
    with dissolve
if skin == "black":
    show gameblack
    with dissolve

label c11:
    
    "Hi!"
    
    t "Hello."
    
    "How are you?"
    
    t "Good."
    
    "..."
    
menu:
    
    "Aren't you going to ask me?":
        jump c2
        
    "Uhh... are you ok?":
        jump c3
        
label c2:
    
    "You are supposed to ask me too."
    
    t "I'm sorry?"
    
    "It's polite to ask how I'm doing since I asked you were doing."
    
    t "Does it look like I care about you?"
    
jump c2q

label c3:
    
    "Are you ok?"
    
    t "What?"
    
    "You seem upset."
    
    t "I guess I am."
    
    "Do you want to talk about it?"
    
    t "Kinda."
    
    t "Can I talk to you in person?"
    
menu:
    
    "How about we just talk on here?":
        jump c4
        
    "Sure!":
        jump c5
        
label c2q:
    
menu:
    
    "Excuse me?":
        jump c6
        
    "I'm gonna go.":
        jump c7
        
label c4:
    
    "How about we just talk on here?"
    
    t "Why."
    
    t "I thought you wanted to help me?"
    
    "I do!"
    
    "I just met you though."
    
    t "Ugh, go away."
    
    t "If you aren't going to help me in person, then I don't want to talk to you."
    
jump ge3

label c5:
    
    "Okay, where do you want to meet up?"
    
    t "At my house, please."
    
    t "My address is 4023 Main Street."
    
    "Ok, I'm coming right over."
    
jump be5

label c6:
    
    "Excuse me?"
    
    t "I don't care about how you feel."
    
    t "At all."
    
    "Why would you say that?"
    
    "We literally just met."
    
    t "Because I already know what you are going to be like."
    
    "How do you know that?"
    
    t "I can tell."
    
jump c6q

label c7:
    
    "I'm gonna go."
    
    t "Good."
    
jump ge3

label c6q:
    
menu:
    
    "How can you tell?":
        jump c8
        
    "Whatever.":
        jump c9

label c8:
    
    "How can you tell?"
     
    t "I'm smarter than you."
    
    "Oh really?"
    
    t "Absolutley."
    
jump be6

label c9:
    
    "Whatever."
    
    "Have a nice day."
    
jump ge3

label be5:
    
show blackbg
with dissolve

show text "I walk to the address and find a small, dirty house." at truecenter
with dissolve
pause 3
hide text
with dissolve

show text "I knock at the door, and an older woman answers." at truecenter
with dissolve
pause 4
hide text
with dissolve

show text "She drags me into the house." at truecenter
with dissolve
pause 2
hide text
with dissolve

show text "Bad Ending: Kidnapped." at truecenter
with dissolve
pause 5
hide text
with dissolve
         
jump ret

label be6:
    
show blackbg
with dissolve

show text "Taylor and I fight all day." at truecenter
with dissolve
pause 3
hide text
with dissolve

show text "I send something I shouldn't have." at truecenter
with dissolve
pause 4
hide text
with dissolve

show text "I'm all over the Internet the next day." at truecenter
with dissolve
pause 2
hide text
with dissolve

show text "Bad Ending: Blackmailed." at truecenter
with dissolve
pause 5
hide text
with dissolve
         
jump ret

label ge3:

show blackbg
with dissolve

show text "Taylor never tries to talk to me again." at truecenter
with dissolve
pause 3
hide text
with dissolve

show text "The next day, my friends tell me that she's not a good person." at truecenter
with dissolve
pause 4
hide text
with dissolve

show text "I block her." at truecenter
with dissolve
pause 2
hide text
with dissolve

show text "Good Ending: Blocked." at truecenter
with dissolve
pause 5
hide text
with dissolve

jump ret

label d1:
    
if skin == "white":
    show gamewhite
    with dissolve
if skin == "light":
    show gamesecondmid
    with dissolve
if skin == "dark":
    show gamethirdmid
    with dissolve
if skin == "black":
    show gameblack
    with dissolve
    
label d11:
    
    "Hi!"
    
    a "heyyyy"
    
    a "what's up"
    
menu:
    
    "Nothing much.":
        jump d2
        
    "I'm doing homework.":
        jump d3
        
    "Watching a movie.":
        jump d4
    
label d2:
    
    "Nothing. You?"
    
label d5:
    
    a "just doing work haha"
    
    "What kind of work?"
    
    a "i sell shoes on my website"
    
    a "you should check it out btw ;)"
    
    a "im trying to decide where i should hang flyers"
    
    a "what do u think"
    
jump d5q

label d3:
    
    "I'm doing homework."
    
    a "borinnggggg"
    
    a "you should help me instead"
    
    "What do you need?"
    
    a "so i have a website where i sell custom shoes"
    
    a "and im deciding where i should hang flyers"
    
    a "what do u think"
    
jump d5q

label d4:
    
    "Just watching a movie."
    
    "What about you?"
    
jump d5

label d5q:
    
menu:
    "Everywhere!!":
        jump d6
        
    "In the Town Green.":
        jump d7
        
    "By the mall.":
        jump d8
        
    "By the school.":
        jump d9
        
label d6:
    
    "Anywhere you can!"
    
    a "really?"
    
    a "seems like a ton of work tbh lol"
    
    a "but i think itll work"
    
    a "im hanging some on pear tree drive rn"
    
jump d6q

label d7:
    
    "In the Town Green, because tons of locals will see it."
    
    a "dude, great idea"
    
    a "ru in honors or smth"
    
    "Lol, thanks!"
    
    a "im hanging some on pear tree drive rn"
    
    a "town green is next on my list"
    
jump d6q

label d8:
    
    "By the mall, so not only locals see it."
    
    a "man, you are so smart"
    
    "Thanks!"
    
    a "i will go to the mall in a sec"
    
    a "im hanging some on pear tree drive rn"
    
jump d6q

label d9:
    
    "By the school, so the kids can see."
    
    a "dude ur awesome at this"
    
    "Thanks!"
    
    a "im gonna head there after i finish putting some on pear tree drive"
    
jump d6q

label d6q:
    
    "Cool!"
    
    a "i got like two left"
    
    a "wait"
    
    "What?"
    
    a "some guy is yelling at me lol"
    
    a "hes like 'get off my lawn' lolllll"
    
    a "annoying old man"
    
menu:
     
    "Maybe you should listen?":
        jump d10
        
    "Whatever!":
        jump d11
        
label d10:
    
    "Maybe you should listen?"
    
    a "dont worry"
    
    a "im being careful"
    
    "Well... still?"

    a "wait"
    
    a "omg"
    
    "What?"
    
    a "he has a gun"
    
    "Are you joking?? Run!!!!!"
    
jump ge4

label d11:
    
    "Whatever! He's probably crazy."
    
    a "lol yeah"

    a "wait"
    
    a "omg"
    
    "What?"
    
    a "he has a gun"
    
    "Are you joking?? Run!!!!!"
    
jump be7

label ge4:
    
show blackbg
with dissolve

show text "After a couple minutes, Alex texted me back." at truecenter
with dissolve
pause 3
hide text
with dissolve

show text "He called the police and told them about what had happened." at truecenter
with dissolve
pause 4
hide text
with dissolve

show text "The police never found the man, but at least Alex was safe." at truecenter
with dissolve
pause 4
hide text
with dissolve

show text "Good Ending: Mystery Man." at truecenter
with dissolve
pause 5
hide text
with dissolve

jump ret

label be7:

show blackbg
with dissolve

show text "I texted Alex over and over again." at truecenter
with dissolve
pause 3
hide text
with dissolve

show text "I waited nervously for a response." at truecenter
with dissolve
pause 4
hide text
with dissolve

show text "I never got one." at truecenter
with dissolve
pause 2
hide text
with dissolve

show text "Bad Ending: Missing Person." at truecenter
with dissolve
pause 5
hide text
with dissolve

jump ret
sorry its so long :(
Sodium, atomic number 11, was first isolated by Humphry Davy in 1807. A chemical component of salt, he named it Na in honor of the saltiest region on earth, North America.

messenjerk
Newbie
Posts: 8
Joined: Tue Feb 27, 2018 3:07 pm
Contact:

Re: NameError: global name '_menu' is not defined

#2 Post by messenjerk »

nevermind! i saw my problem. thanks to anyone who actually looked!
Sodium, atomic number 11, was first isolated by Humphry Davy in 1807. A chemical component of salt, he named it Na in honor of the saltiest region on earth, North America.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: NameError: global name '_menu' is not defined

#3 Post by Donmai »

I saw you have many labels in your script. Having duplicate labels or jumping to the wrong label, in this case, is a very common problem.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: NameError: global name '_menu' is not defined

#4 Post by Imperf3kt »

For others curious, there are two 'start' labels.
A common cause of this issue is duplicate label names.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: GoldenGob, Google [Bot]