Menu Error(FIXED)

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
JoeyAlex
Newbie
Posts: 9
Joined: Tue May 29, 2018 12:26 pm
Completed: None yet.
Projects: I am working on Tears, a depressive novel.
Organization: Coder?
Contact:

Menu Error(FIXED)

#1 Post by JoeyAlex » Tue May 29, 2018 1:22 pm

Ok so... I was making a game and then this popped up, after copying the text from the tutorials.

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 55: expected menuitem
    label choice1_yes:
    ^

Ren'Py Version: Ren'Py 6.99.14.3.3347
Tue May 29 18:17:49 2018
So then I just rewrite the code. This is the code:

Code: Select all

menu:

    "Yes.":
        jump choice1_yes

    "No.":
        jump choice1_no

    label choice1_yes:

        $ menu_flag = True

        b "Hey! You OK? You ran off when he shoited at you."

        a "Yeah Im OK now. A bit shaken up, but better."

        b "Sounds like you have been crying. You good?"

        a "Yeah. Really I am. Can I have some time by myself?"

        b "Sure."

        jump choice1_done

    label choice1_no:

        $ menu_flag = False

        "I dont want to talk with anyone right now."

        jump choice1_done:

    label choice1_done:

        "The call ends."
        
What have I done wrong? (BTW The code is separated, its just how it copied it out!)
Last edited by JoeyAlex on Wed May 30, 2018 6:00 am, edited 2 times in total.
Joey Alex, Gay

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Menu Error

#2 Post by kivik » Tue May 29, 2018 1:28 pm

Can you wrap your code in a [code] block so we can see your indentation?

JoeyAlex
Newbie
Posts: 9
Joined: Tue May 29, 2018 12:26 pm
Completed: None yet.
Projects: I am working on Tears, a depressive novel.
Organization: Coder?
Contact:

Re: Menu Error

#3 Post by JoeyAlex » Tue May 29, 2018 1:42 pm

I've wrapped it. :)
Joey Alex, Gay

User avatar
thebackup
Veteran
Posts: 317
Joined: Fri Mar 27, 2009 7:36 pm
Completed: Final Week, CardioQuiz, Cafe Memoria, All I Want for Christmas is a Girlfriend, Dating Sim! Re:Mastered
Projects: Memoria (on hiatus), Cafe Memoria Deux
Organization: PixaelSoft
Location: Southern CA
Contact:

Re: Menu Error

#4 Post by thebackup » Tue May 29, 2018 1:53 pm

Seems indentation is wrong from "label choice1_yes" on:

Code: Select all

menu:

    "Yes.":
        jump choice1_yes

    "No.":
        jump choice1_no

label choice1_yes:

    $ menu_flag = True

    b "Hey! You OK? You ran off when he shoited at you."

    a "Yeah Im OK now. A bit shaken up, but better."

    b "Sounds like you have been crying. You good?"

    a "Yeah. Really I am. Can I have some time by myself?"

    b "Sure."

    jump choice1_done

label choice1_no:

    $ menu_flag = False

    "I dont want to talk with anyone right now."

    jump choice1_done:

label choice1_done:

    "The call ends."

JoeyAlex
Newbie
Posts: 9
Joined: Tue May 29, 2018 12:26 pm
Completed: None yet.
Projects: I am working on Tears, a depressive novel.
Organization: Coder?
Contact:

Re: Menu Error

#5 Post by JoeyAlex » Tue May 29, 2018 2:07 pm

I don't really understand what this means. If you can, could you please give me the fixed version? Or is that the fixed version? Thanks!
Joey Alex, Gay

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Menu Error

#6 Post by kivik » Tue May 29, 2018 2:19 pm

That is the fixed version. Note how far right the code is from this line onwards between yours and thebackup's

Code: Select all

label choice1_yes:

JoeyAlex
Newbie
Posts: 9
Joined: Tue May 29, 2018 12:26 pm
Completed: None yet.
Projects: I am working on Tears, a depressive novel.
Organization: Coder?
Contact:

Re: Menu Error

#7 Post by JoeyAlex » Tue May 29, 2018 2:33 pm

Ah OK thank you so much!
Joey Alex, Gay

JoeyAlex
Newbie
Posts: 9
Joined: Tue May 29, 2018 12:26 pm
Completed: None yet.
Projects: I am working on Tears, a depressive novel.
Organization: Coder?
Contact:

Re: Menu Error

#8 Post by JoeyAlex » Tue May 29, 2018 2:40 pm

..I have another problem. I'm stupid.

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 77: end of line expected.
    jump choice1_done:
                     ^

Ren'Py Version: Ren'Py 6.99.14.3.3347
Tue May 29 19:38:20 2018
Here is the original code:

Code: Select all

label choice1_no:

        $ menu_flag = False

        "I don't want to talk to anyone right now."

        jump choice1_done:

label choice1_done:
    "The call ends."

    "You start to cry, just to let out your sadness. You receive another call. From Jackson, once again."
Help please?
Joey Alex, Gay

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Menu Error

#9 Post by kivik » Tue May 29, 2018 2:43 pm

You don't need the colon at the end of the line:

Code: Select all

jump choice1_done
Not

Code: Select all

jump choice1_done:
Syntax are really important in any programming language, so when you see an error like that, check the line (sometimes before and after) and rethink if it's the way it should be written. If you practice that you'll learn to be able to fix your code more easily in the future :)

JoeyAlex
Newbie
Posts: 9
Joined: Tue May 29, 2018 12:26 pm
Completed: None yet.
Projects: I am working on Tears, a depressive novel.
Organization: Coder?
Contact:

Re: Menu Error

#10 Post by JoeyAlex » Tue May 29, 2018 2:45 pm

Right, thank you so much! Your amazing! :)
Joey Alex, Gay

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

Re: Menu Error

#11 Post by Imperf3kt » Tue May 29, 2018 3:51 pm

thebackup wrote:
Tue May 29, 2018 1:53 pm
Seems indentation is wrong from "label choice1_yes" on:

Code: Select all

menu:

    "Yes.":
        jump choice1_yes

    "No.":
        jump choice1_no

label choice1_yes:

    $ menu_flag = True

    b "Hey! You OK? You ran off when he shoited at you."
Why is a menu outside a label?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]