Error in script.rpy I can't seem to figure out. [Answered]

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
Dizzydude
Regular
Posts: 58
Joined: Mon May 26, 2014 8:40 pm
Projects: 「To Be Announced」
Location: U.S.A
Contact:

Error in script.rpy I can't seem to figure out. [Answered]

#1 Post by Dizzydude »

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 993, in script
    "\"What's your name?\"" if annabelle3 == False:
SyntaxError: unexpected EOF while parsing (game/script.rpy, line 1011)

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 993, in script
    "\"What's your name?\"" if annabelle3 == False:
  File "C:\Documents and Settings\----\My Documents\ren'py\renpy-6.17.5-sdk\renpy\ast.py", line 1363, in execute
    choice = renpy.exports.menu(choices, self.set)
  File "C:\Documents and Settings\----\My Documents\ren'py\renpy-6.17.5-sdk\renpy\exports.py", line 622, in menu
    if renpy.python.py_eval(condition) ]
  File "C:\Documents and Settings\----\My Documents\ren'py\renpy-6.17.5-sdk\renpy\python.py", line 1416, in py_eval
    return eval(py_compile(source, 'eval'), globals, locals)
  File "C:\Documents and Settings\----\My Documents\ren'py\renpy-6.17.5-sdk\renpy\python.py", line 477, in py_compile
    raise e
SyntaxError: unexpected EOF while parsing (game/script.rpy, line 1011)

Windows-XP-5.1.2600-SP3
Ren'Py 6.17.5.492
Trapped In 0.1


That's the traceback.
This is the entire section in question:

Code: Select all

 label annabelle1: # Annabelle Corridor Conversation {size=-4}{/size}
        $ annabelle1 = True
        $ talk1 += 1
        
        hide d
        hide h
        show a neutral at center
        
        m "Hey."
        
        a "{size=-4}Hi.{/size}"
        
        menu:
            
            "\"Why are you helping Jason?\"" if annabelle2 == False:
                jump annabelle2
            
            
            "\"What's your name?\"" if annabelle3 == False:
                jump annabelle3
            
            
            "\"Why do you speak so quietly?\"" if annabelle4 == False:
                jump annabelle4
            
            
            "\"What do you think about Jason's plan?\"" if annabelle5 == False:
                jump annabelle5
                
                
            "\"You seem pretty shy.\"" if annabelle6 False:
                jump annabelle6
                
                
            "\"I'm not interested in talking to you.\"":
                jump annabelle7
                
                
                
    label annabelle2:
        
        
    
    label annabelle3:
        
        
    
    label annabelle4:
        
        
    
    label annabelle5:
        
        
        
    label annabelle6:
    
    
    
    label annabelle7:
        m "I'm not interested in talking to you."
        
        show a sad
        
        a "{size=-4}Oh.. alright.{/size}"
        
        if talk1 >= 3:
            jump cont2
            
        else:
            jump talk1
        
        
        
    label annabelle_end:
        
        if talk1 >= 3:
            jump cont2
            
        else:
            jump talk1

I thought it might be because I didn't fill in the labels, but I'm not sure. As you can see, I'm not done. From the traceback, it looks as if it has to do with the python if statement, but I didn't see a problem with it.
Last edited by Dizzydude on Sat Jun 21, 2014 11:36 am, edited 1 time in total.

User avatar
korova
Veteran
Posts: 217
Joined: Sat Jun 27, 2009 5:15 pm
Completed: Ivy, Chocolate, Time, Clair Obscur
Projects: Writing exercises, The House [Nano18]
Tumblr: korova08
itch: korova
Location: Normandie, France
Contact:

Re: SyntaxError in script.rpy I can't seem to figure out.

#2 Post by korova »

You can try to use the "pause" statement inside your empty labels (that basically does nothing until you interact...), while you have not written your story yet, and see what happens.

Valmoer
Regular
Posts: 53
Joined: Sat Feb 04, 2012 9:46 pm
Contact:

Re: SyntaxError in script.rpy I can't seem to figure out.

#3 Post by Valmoer »

Hello Dizzydude,
File "game/script.rpy", line 993, in script
"\"What's your name?\"" if annabelle3 == False:
SyntaxError: unexpected EOF while parsing (game/script.rpy, line 1011)
Don't be fooled by the obvious line where the game crashed, the line where the error happened is hidden downwards.

And in your menu, 18 lines down your menu (1011 - 993), you indeed do have the menu choice

Code: Select all

"\"You seem pretty shy.\"" if annabelle6 False:
     jump annabelle6
where you lack a comparaison operator

Code: Select all

"\"You seem pretty shy.\"" if annabelle6 == False:
     jump annabelle6
throwing your whole menu parsing in disarray.

Tested the correction, and it works (see the attached file).
Attachments
Debugging.png

User avatar
Dizzydude
Regular
Posts: 58
Joined: Mon May 26, 2014 8:40 pm
Projects: 「To Be Announced」
Location: U.S.A
Contact:

Re: SyntaxError in script.rpy I can't seem to figure out.

#4 Post by Dizzydude »

Oh, wow. I can't believe I missed that! Thank you both!

Post Reply

Who is online

Users browsing this forum: fufuffiero, Google [Bot]