Page 1 of 1

Error Issue: NameError: name '_' is not defined

Posted: Mon Aug 01, 2011 12:56 am
by fatalblue
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/park.rpy", line 8, in script
if desk == "tae":
File "game/park.rpy", line 8, in python
if desk == "tae":
NameError: name 'desk' is not defined
This is an error I constantly see myself running into as i work on my game (something I've only been doing for like 2 or 3 week only so far, yes I am a super novice^^;;) I searched the forums extensively as well as reread the tutorial, wiki, ect, played w/ the indentation & tried various other things to see if I could figure what I'm doing wrong myself but I just haven't been able to so now I wish to ask you all, the experts what I'm I doing wrong? why I'm i getting this type of error?

Code: Select all

            u "hello?"
            $ desk = "tae"
            u "i'll just take it to the front desk" 
            jump mmenu

Code: Select all

if desk == "tae":
        u "*could the phone from the library be his?*"
        u "why don't you try the library?"
        t "huh? why?"
            "I saw it":
                u "What does your phone look like?"
                t "It's a white samsung"
                u "I found a phone like that while at the libaray a while ago. I gave it to the front desk"
                t "The library! of course! come w/ me!"
                u "hay...wait....uwahh!!!"
                jump taem_date2
            "It's a hunch":
                u "It's just a hunch..."
                t "ah...okay I'll try that"
                if dress == "tm":
                    t "ah...okay I'll try that, thank you for helping me"
                    u "Hope he finds it..."
                jump mmenu
        t "*sigh* I'm sorry again, excuse me"
        u "poor dude..."
        u "maybe I should do something else"
        jump mmenu
ps: this isn't the only place I'm getting this name error exactly it's just this is the most recent one to pop up & I'm kinda at wits end. I figure if someone can clarify what I'm doing wrong here with just this one I can figure out how to work out the rest myself ^^;;

thanks in advance for any help

Re: Error Issue: NameError: name '_' is not defined

Posted: Mon Aug 01, 2011 1:02 am
by 10kNing
The variable "desk" is only defined if you pick "no," so put a "$ desk =" something in the part after the "yes" option~ It has to have been defined at least once before the thing can check if it's equivalent to anything!