ERROR; Expected Statment

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
TigerAlpaca
Regular
Posts: 38
Joined: Tue Apr 03, 2018 4:19 am
Contact:

ERROR; Expected Statment

#1 Post by TigerAlpaca »

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/script.rpy", line 1043: expected statement.
    renpy.full_restart(transition=False, label='_invoke_main_menu', target='_main_menu'):
                                                                                        ^

Ren'Py Version: Ren'Py 7.0.0.196
Sun Aug 12 11:07:11 2018
This is the code it occurs in (it comes right after a jumpscare) -

Code: Select all

text "Bad ending"
        
        text "Maybe you should try agian."
        
        renpy.full_restart(transition=False, label='_invoke_main_menu', target='_main_menu')
        
        label falsepath4:
            
        "I kissed him back as I wrapped my arms around him."

User avatar
MaydohMaydoh
Regular
Posts: 165
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: ERROR; Expected Statment

#2 Post by MaydohMaydoh »

renpy.full_restart is a python statement so you need to put the $ in front of it

Code: Select all

$ renpy.full_restart(transition=False, label='_invoke_main_menu', target='_main_menu')

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

Re: ERROR; Expected Statment

#3 Post by Imperf3kt »

renpy.full_restart will take a player back to the main menu, but why aren't you just using a return?
Also, labels should be indented all the way left, with no spaces.
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

TigerAlpaca
Regular
Posts: 38
Joined: Tue Apr 03, 2018 4:19 am
Contact:

Re: ERROR; Expected Statment

#4 Post by TigerAlpaca »

Thanks for the help- I'm using restart as I want to give the jumpscares a more kind of spooky feel to them.

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

Re: ERROR; Expected Statment

#5 Post by Imperf3kt »

Yes, I can see what you're trying to achieve, and a return will do exactly the same thing.
There's no harm in using it, but that full restart function is meant for other uses, like fully restarting Ren'py, without needing to close and relaunch the game, resetting any game state and returning a player to the very top of the call stack.
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: Ahrefs [Bot], Semrush [Bot]