need help with menu

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
josh
Newbie
Posts: 22
Joined: Fri Dec 07, 2007 3:57 pm
Completed: Threed's Heroes and Happy Happy Halloween
Projects: Yotsuba&! Kinetic Novel, Other Projects.
Location: Birmingham
Contact:

need help with menu

#1 Post by josh »

Need some help with menu errors
I get:
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


On line 94 of /home/joshua/Yotsuba&!_Ep1/game/script.rpy: choice menuitem expects a non-empty block.
"Episode One.":
^

On line 110 of /home/joshua/Yotsuba&!_Ep1/game/script.rpy: expected ':' not found.
label one
^

On line 112 of /home/joshua/Yotsuba&!_Ep1/game/script.rpy: expected ':' not found.
label two
^

On line 114 of /home/joshua/Yotsuba&!_Ep1/game/script.rpy: expected ':' not found.
label three
^

On line 116 of /home/joshua/Yotsuba&!_Ep1/game/script.rpy: expected ':' not found.
label four
^

Ren'Py Version: Ren'Py 6.6.1c

Here is the Code:

Code: Select all

init:
    # Declare images below this line, using the image statement.
    # eg. image eileen happy = "eileen_happy.png"
    image static = anim.SMAnimation("a",
        anim.State("a", "noise1.png"),
        anim.State("b", "noise2.png"),
        anim.State("c", "noise3.png"),
        anim.State("d", "noise4.png"),
        anim.State("e", "noise5.png"),

        anim.Edge("a", .2, "b", trans=Dissolve(.2, alpha=True)),
        anim.Edge("b", .2, "a", trans=Dissolve(.2, alpha=True)),
        anim.Edge("a", .2, "c", trans=Dissolve(.2, alpha=True)),
        anim.Edge("c", .2, "a", trans=Dissolve(.2, alpha=True)),
        anim.Edge("a", .2, "d", trans=Dissolve(.2, alpha=True)),
        anim.Edge("d", .2, "a", trans=Dissolve(.2, alpha=True)),
        anim.Edge("a", .2, "e", trans=Dissolve(.2, alpha=True)),
        anim.Edge("e", .2, "a", trans=Dissolve(.2, alpha=True)),

        anim.Edge("b", .2, "c", trans=Dissolve(.2, alpha=True)),
        anim.Edge("c", .2, "b", trans=Dissolve(.2, alpha=True)),
        anim.Edge("b", .2, "d", trans=Dissolve(.2, alpha=True)),
        anim.Edge("d", .2, "b", trans=Dissolve(.2, alpha=True)),
        anim.Edge("b", .2, "e", trans=Dissolve(.2, alpha=True)),
        anim.Edge("e", .2, "b", trans=Dissolve(.2, alpha=True)),

        anim.Edge("c", .2, "d", trans=Dissolve(.2, alpha=True)),
        anim.Edge("d", .2, "c", trans=Dissolve(.2, alpha=True)),
        anim.Edge("c", .2, "e", trans=Dissolve(.2, alpha=True)),
        anim.Edge("e", .2, "c", trans=Dissolve(.2, alpha=True)),

        anim.Edge("d", .2, "e", trans=Dissolve(.2, alpha=True)),
        anim.Edge("e", .2, "d", trans=Dissolve(.2, alpha=True)),
        )

    image bg_entrance    = "zoo.jpg"
    # Declare characters used by this game.
    $ y = Character('Yotsuba Kowai', color="#c8ffc8")
    $ j = Character('Jumbo', color="#c8ffc8")
    $ k = Character('Dad', color="#c8ffc8")
    $ a = Character('Asagi Ayase', color="#c8ffc8")
    $ f = Character('Fuka Ayase', color="#c8ffc8")
    $ e = Character('Ena Ayase', color="#c8ffc8")
    $ ms = Character('Mrs. Ayase', color="#c8ffc8")
    $ mr = Character('Mr. Ayase', color="#c8ffc8")
    $ m = Character('Miura Hayasaka ', color="#c8ffc8")
    $ ya = Character('Yanda ', color="#c8ffc8")
    $ h = Character('Hiwatari ', color="#c8ffc")
# Image on the Side
    $ yside = Character('Yotsuba',
    color="#c8ffc8",
    window_left_padding=160,
    show_side_image=Image("yotsidemad.png", xalign=0.0, yalign=1.0))
    
    # Image on the Side
    $ dside = Character('Cardbo',
    color="#c8ffc8",
    window_left_padding=160,
    show_side_image=Image("danbon.png", xalign=0.0, yalign=1.0))
    
    # Image on the Side
    $ ky = Character('Yotsuba',
    color="#c8ffc8",
    window_left_padding=160,
    show_side_image=Image("koala.png", xalign=0.0, yalign=1.0))
    
    # Image on the Side
    $ milk = Character('Yotsuba',
    color="#c8ffc8",
    window_left_padding=160,
    show_side_image=Image("ymilk.png", xalign=0.0, yalign=1.0))\
    
    # Image on the Side
    $ poke = Character('Yotsuba',
    color="#c8ffc8",
    window_left_padding=160,
    show_side_image=Image("poke.png", xalign=0.0, yalign=1.0))
    
# The game starts here.
label start:
    #Unemplemented opening to Episode 1 - Josh
    #centered "Grue Productions Presents:"
    #centered "In Association with /azu/ of Wakachan.org and Chiyochan.org"
    #centered "Yotsuba&! Adventures"
    #centered "Episode One:"
    #play music "zoo.mp3" fadeout 1.0
    #centered "Day at the Zoo"
    #scene bg_entrance
    
menu:

    dside "Which Episode would you like to play?"

    "Episode One.":

    jump one

    "Episode Two.":

    jump two
    
    "Episode Three."
    
    jump three
    
    "Episode Four."
    
    jump four
    #All of the Sayings on here are placeholders for full chapters lol.
label one
    yside "Oh, Yay! The Zoo!"
label two
    dside "Test Test, Domo Arigato"
label three
    ky "daddy... help..."
label four
    milk "Yum, I Like Milk!"
THANKS IN ADVANCE
"My Name is Ozymandias, King of Kings: Look On My Works Ye Mighty And Despair!"

User avatar
akemicchi
Veteran
Posts: 465
Joined: Mon Dec 31, 2007 11:22 pm
Projects: Magicians of Delphine, Panaderia: Ensaimada, SweetTooth!, XOXO Droplets
Deviantart: littlebabyshoes
Contact:

Re: need help with menu

#2 Post by akemicchi »

"Episode One.":

When it says:
choice menuitem expects a non-empty block
... they're telling you that you can't leave it that block empty. ^^ But, since you have a jump statement in that block, I think the main problem is because the labels you jumped to didn't have any colons.

Sooo... Instead of:
label one
label two
label three

add colon's at the end. Like:
label one:
label two:
label three:

... Then it should work correctly. :D

EvilDragon
Veteran
Posts: 284
Joined: Fri Dec 28, 2007 5:47 am
Location: Where the Dragons rule!
Contact:

Re: need help with menu

#3 Post by EvilDragon »

Ah, so you like my tv-static cookbok recipe? Nice, nice :D

And yeah, you forgot the colons there ^^
Angels of paradise, angels of sacrifice
Please let me be under your wings...

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: need help with menu

#4 Post by PyTom »

You also need to indent the jump lines. Those are what causes the empty block error.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

josh
Newbie
Posts: 22
Joined: Fri Dec 07, 2007 3:57 pm
Completed: Threed's Heroes and Happy Happy Halloween
Projects: Yotsuba&! Kinetic Novel, Other Projects.
Location: Birmingham
Contact:

Re: need help with menu

#5 Post by josh »

Pardon me for Asking, but...
I added the Colons, but i still get the error:
On line 94 of /home/joshua/Yotsuba&!_Ep1/game/script.rpy: choice menuitem expects a non-empty block.
"Episode One.":
^

How do i Fix that? How do I indent the jump lines?
"My Name is Ozymandias, King of Kings: Look On My Works Ye Mighty And Despair!"

User avatar
akemicchi
Veteran
Posts: 465
Joined: Mon Dec 31, 2007 11:22 pm
Projects: Magicians of Delphine, Panaderia: Ensaimada, SweetTooth!, XOXO Droplets
Deviantart: littlebabyshoes
Contact:

Re: need help with menu

#6 Post by akemicchi »

Oh, I didn't notice the lines were misaligned. xD;

Code: Select all

    "Episode One.":

        jump one

    "Episode Two.":

         jump two
   
    "Episode Three.":
   
         jump three
   
    "Episode Four.":
   
        jump four
That should work. The indentations are really important; each indentation is 4 spaces. You can read more about it here.

josh
Newbie
Posts: 22
Joined: Fri Dec 07, 2007 3:57 pm
Completed: Threed's Heroes and Happy Happy Halloween
Projects: Yotsuba&! Kinetic Novel, Other Projects.
Location: Birmingham
Contact:

Re: need help with menu

#7 Post by josh »

Oh yay! it works! Thanks so much!
"My Name is Ozymandias, King of Kings: Look On My Works Ye Mighty And Despair!"

honoreixix
Regular
Posts: 115
Joined: Wed Apr 16, 2008 10:36 am
Contact:

Re: need help with menu

#8 Post by honoreixix »

i'll put this question here since it's about the main menu...

is it possible for me to add extra menu button whenever an event has been finished?

example, after playing the game once, there will be a new menu button labeled prologue; or after completing the routes/endings, there is another button that will appear which will then start a continuation of the main route(kind of like Clannad's after story...
I'm hidden and no one expects much of me... I just hope I don't disappoint anyone...
I'd rather fail doing something I love than succeed doing something I hate...
Image

EvilDragon
Veteran
Posts: 284
Joined: Fri Dec 28, 2007 5:47 am
Location: Where the Dragons rule!
Contact:

Re: need help with menu

#9 Post by EvilDragon »

I already suggested PyTom this idea, it will be implemented in the new Ren'py release. Basically, a new tuple component will be added in config.main_menu and config.game_menu (maybe), that will be practically the same as the 3rd one (that one decides if the button will be selectable or insensitive), except that this new tuple component will check if the expression is true, and if it is, a new button will show up.

Theoretically, you can do something like this with ui widgets and persistent variables, but it's whole lotta work.
Angels of paradise, angels of sacrifice
Please let me be under your wings...

000
Regular
Posts: 94
Joined: Mon Dec 24, 2007 11:09 am
Projects: Ren'Py Russian distributive
Location: Уфа, РБ, Россия
Contact:

Re: need help with menu

#10 Post by 000 »

mmm, maybe, if you would create two different main menus, do a custom main menu and under that execute by usual means one of that two depending on persistent variables results, that would do the trick.
<feels sowwy for his Engrish>

Post Reply

Who is online

Users browsing this forum: No registered users