Invalid Syntax [SOLVED]

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
RayDizzle
Regular
Posts: 25
Joined: Tue Jul 28, 2015 9:49 pm
Deviantart: Gem2012
Location: New Zealand
Contact:

Invalid Syntax [SOLVED]

#1 Post by RayDizzle »

So I'm fairly new here. I've been using Ren'Py for about a month now and everything was going really well...and then it wasn't. I'm trying to make a really simple Dating Sim and I've got one issue. Here's the code:

Code: Select all

default alright = ""
default chose = ""

[Some text]

label movie:
    show dylan
    menu:
        "Talk":
            
            if hp >= 1:
                $ hp -= 1
                if dylan_relationship = 0:
                    d "Oh hey, how's it going?"
                    menu:
                        "Err...":
                            $ alright = False
                            p "Uh....uh...um..."
                            d "You alright? You seem a little...off..."
                            jump movie
                        "Alright.":
                            $ alright = True
                            p "I'm alright. How about you?"
                            d "Yeah, I'm pretty good. Nothing spectacular but not bad either. Thanks."
                            if charisma >= 20:
                                $ dylan_relationship += 5
                            else:
                                $ dylan_relationship += 1
                            jump movie
                   

                
                elif alright == True:
                    d "Hey, it's you again! Sorry, I never caught your name before."
                    menu:
                        "Tell him your name":
                            $ chose = "name"
                            p "Oh, sorry. My name's [player_name]."
                            d "[player_name], I like that."
                            if charisma >= 20:
                                $ dylan_relationship += 5
                            else:
                                $ dylan_relationship += 1
                            jump movie
                        "Refuse to tell him":
                            p "Why should I tell you?"
                            hide dylan
                            show dylanangry
                            d "Whoa! No need to get defensive. I was just asking."
                            hide dylanangry
                            jump movie
And this is what I keep getting:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 102, in script
    menu:
SyntaxError: invalid syntax (script.rpy, line 102)
If anyone could give me some advice that would be amazing! :D
Last edited by RayDizzle on Sun Aug 30, 2015 2:52 am, edited 1 time in total.

User avatar
chocojax
Miko-Class Veteran
Posts: 705
Joined: Sun Oct 25, 2009 11:27 am
Projects: Umbra, Familiarity, Maleficent Justice
Tumblr: chocojax
Location: California
Contact:

Re: Invalid Syntax

#2 Post by chocojax »

Error message is telling you the line of the syntax error (line 102), so which line is that? (I'd just look myself, but I'm on mobile right now.)

User avatar
RayDizzle
Regular
Posts: 25
Joined: Tue Jul 28, 2015 9:49 pm
Deviantart: Gem2012
Location: New Zealand
Contact:

Re: Invalid Syntax

#3 Post by RayDizzle »

Code: Select all

 if dylan_relationship = 0:

User avatar
chocojax
Miko-Class Veteran
Posts: 705
Joined: Sun Oct 25, 2009 11:27 am
Projects: Umbra, Familiarity, Maleficent Justice
Tumblr: chocojax
Location: California
Contact:

Re: Invalid Syntax

#4 Post by chocojax »

It should be

Code: Select all

if dylan_relationship == 0:

User avatar
RayDizzle
Regular
Posts: 25
Joined: Tue Jul 28, 2015 9:49 pm
Deviantart: Gem2012
Location: New Zealand
Contact:

Re: Invalid Syntax

#5 Post by RayDizzle »

Thank you, that's solved one issue. Now the entire game ends if you choose "Talk". I'm completely stumped as to what to do. Actually, if I chose any of the options the game ends.

User avatar
RayDizzle
Regular
Posts: 25
Joined: Tue Jul 28, 2015 9:49 pm
Deviantart: Gem2012
Location: New Zealand
Contact:

Re: Invalid Syntax

#6 Post by RayDizzle »

Nevermind! I've managed to fix it and get everything up and running again! Thank you so much for your help! :)

Post Reply

Who is online

Users browsing this forum: Google [Bot]