Page 1 of 1

name not defined

Posted: Wed Mar 19, 2014 8:27 pm
by Destiny
Error I get:
NameError: name 'park_1_done' is not defined

Place where the error happens:
if park_1_done == True:

Ergo what would be the initiallizing one to that?
$ park_1_done = False
at the beginning under Label start?
Something else?

(I swear, this all worked before Ren'Py updated?! xD")

Re: name not defined

Posted: Wed Mar 19, 2014 8:59 pm
by SundownKid
More like:

Code: Select all

init:
    $ park_1_done = False

Re: name not defined

Posted: Thu Mar 20, 2014 7:07 am
by Destiny
Ok, worked, even though I have a big different problem right now .__.

The game now still doesn't like the variable, but instead of asking for a definition, it gives a error, then makes the game loop infinitely, followed by ignoring all input (I have a image map, but suddenly, all buttons go only to one spot):
Click for video (the loop is shown, not the "all buttons go to the same place")

The traceback of the error seen in the video is this:
traceback.txt
(965 Bytes) Downloaded 9 times
The exact spots of the code are:
536 till 555

Code: Select all

label example:
    
    call screen example_imagemap
    
    $ result = _return
    
    if result == "park":
        call park
    elif result == "untere_etage":
        call untere_etage
    elif result == "schwimmbad":
        call schwimmbad
    elif result == "dach":
        call dach
    elif result == "obere_etage":
        call obere_etage
    elif result == "sporthalle":
        call sporthalle
    elif result == "dereks_zimmer":
        call dereks_zimmer
and

label schule_3:

936 till 951

Code: Select all

scene bg zimmer abend
play music "Music/a - Mary - PeerGynt_Lobogris_-_You_Make_Me_Crazy__Jam_.mp3"
show m l
if sporthalle_2_done = True: 
        m b "It makes me so nervous to run."
        r s "I thought you were used to it?"
        m b "No, I\'m not used to being watched running by two good looking guys."
        r c s "................................"
        show r b
        extend "\nYou\'re talking garbage again."
        m l "Waah, you got bright red! \nCuuuuuuuuute!"
        r b "Ah, keep your mouth shut!"
        m l "Ok, ok."
        jump gespräch_2
My guess would be the following:
I have the image map 6 times (all sending to a different label, there are no problems at those spots as far as I can tell) and - upon returning - the supporting character (the female) reacts depending on where the character had been.
She will also react depending on if he had been there before or not (she will make a different notion, if it is park_done_2 = True then when it is park_done_1 = True)
My guess is, that the game is unable to cope with the fact, that "park_done_1 = True" appears six times in the script (as she can react to it six times)? o_o
Could that be a possible reason? If yes, what would be good to do to avoid this repeating session ._.

Re: name not defined

Posted: Thu Mar 20, 2014 7:52 am
by xela
You post is too long and a bit confusing.

Code: Select all

if sporthalle_2_done = True:
This code is invalid, you also don't have to compare values to booleans in Python/Ren'Py script.

Code: Select all

if sporthalle_2_done:
or

Code: Select all

if not sporthalle_2_done: # If False
will do nicely.