Menu code breaking? Please help!

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
Groundbird
Newbie
Posts: 10
Joined: Fri Jul 03, 2015 6:17 am
Tumblr: dallasgenoard
Skype: touhruadachi
Contact:

Menu code breaking? Please help!

#1 Post by Groundbird » Sat Jul 04, 2015 11:45 am

(I will be making a lot of topics here in the next few days, sorry about that. Learning processes!)

I like to keep previous dialogue on the screen when I give the player choices to pick from. Although I code things exactly the same way within my scripts for these menus, for whatever reason--there are strange instances when my narration box will completely disappear, and the text that should stay within a narration box ends up going into the menu box:
Screenshot_1.png
Alright, so far, so good.
Screenshot_2.png
Hold up--
and then there are other times where everything stays where it belongs:
Screenshot_3.png
Lookin' good.
( It actually seemed initially to stay put if it was previously said by a character and not a narrator. But I ended up discovering that sometimes, that isn't the case ...
Screenshot_4.png
Where are you going, text?
)

I'm really not sure what's going on here.

Here's the menu customization code I'm using:

Code: Select all

screen choice(items):
    window:
        style "menu_window"
        xalign 0.3
        yalign 0.6
        xsize 0.8
        background "images/misc/fcchoice1.png"
        left_padding 22
        right_padding 0
        top_padding 132
        bottom_padding 0
        
        vbox:
            style "menu"
            spacing 2

            for caption, action, chosen in items:
                if action:
                    button:
                        action action
                        style "menu_choice_button"
                        xsize 1.0 
                        idle_background None
                        hover_background "#ec437a"
                        top_padding 6
                        bottom_padding 0
                        left_padding 10
                        right_padding 10

                        text caption:
                            style "menu_choice"
                            color "#ec437a"
                            hover_color "#fff" 
                            text_align 0.0

                else:
                    text caption style "menu_caption"

    add "choice_protag"

init:
    image choice_protag:
        Image("images/misc/fcchoice2.png", xsize=512, ysize=256) 
And then here's a few instances of script:

Working in-game:

Code: Select all

    j "Oh. Are, uh... are you guys heading back to the dorm right now?"

    menu:
        j "Oh. Are, uh... are you guys heading back to the dorm right now? {fast}"
        "\"Yeah.\"":
            show junpei aww with dissolve
            j "Dang. I was hoping to get some help from Yuka-tan with studying for the
               finals, or something."
            j "I'm so screwed."

            show junpei wow with dissolve
            j "You guys up for a group study session back at the dorm?"

        "\"After we stop somewhere.\"":
            show yukari uh with dissolve
            y "Huh?"

            show junpei aww with dissolve
            j "Dang. I was hoping to get some help from Yuka-tan with studying for the
               finals, or something."
            j "I'm so screwed."

            show junpei wow with dissolve
            j "You guys up for a group study session back at the dorm?"

            y "Well..." 

Code: Select all

    show yukari uh
    y "He might be a pain in the ass, but if something's wrong..."

    menu:
        y "He might be a pain in the ass, but if something's wrong... {fast}"

        "\"Leave it to me.\"":
            show yukari grin with dissolve
            y "I knew I could count on you."

        "\"Don't worry about it.\"":
            show yukari uh with dissolve
            y "If you say so..." 

Not working in-game:

Code: Select all

    "\> How will you spend the evening?"

    menu selection:
        "\> How will you spend the evening? {fast}"
        "\> Talk with the girls":
            jump gconvo

        "\> Talk with the guys":
            jump bconvo

        "\> Go to bed early":
            jump sleep

Code: Select all

    "\> Akihiko seems to be a bit self-conscious..."
    
    menu:
        "\> Akihiko seems to be a bit self-conscious... {fast}"
        
        "\"It's great.\"":
            show aki smile with dissolve
            a "You think so...?"
            a "I'm glad. Try to eat as much as you can. You'll need it."
        
        "\"This is too much food...\"":
            show aki wince with dissolve
            a "Oh... well, you don't have to finish it or anything."
            "\> Akihiko is frowning..." 
Anyone have any ideas on what might fix this?

User avatar
SinnyROM
Regular
Posts: 166
Joined: Mon Jul 08, 2013 12:25 am
Projects: Blue Birth
Organization: Cosmic Static Games
Contact:

Re: Menu code causing some issues sometimes?

#2 Post by SinnyROM » Sat Jul 04, 2015 8:15 pm

That's a strange issue. I tried to reproduce it but couldn't. Two things I can think of to try and figure the source of the problem:

Try and remove the caption only line in the choice screen.

Code: Select all

# comment this out
                else:
                    text caption style "menu_caption" color "#000"
I noticed that the lines with the > symbol seemed to cause the issue. Does it still happen if you remove them?

Code: Select all

# remove either or both > symbols
   "How will you spend the evening?"

    menu selection:
        "How will you spend the evening? {fast}"

Groundbird
Newbie
Posts: 10
Joined: Fri Jul 03, 2015 6:17 am
Tumblr: dallasgenoard
Skype: touhruadachi
Contact:

Re: Menu code causing some issues sometimes?

#3 Post by Groundbird » Sat Jul 04, 2015 11:07 pm

SinnyROM wrote:That's a strange issue. I tried to reproduce it but couldn't. Two things I can think of to try and figure the source of the problem:

Try and remove the caption only line in the choice screen.

Code: Select all

# comment this out
                else:
                    text caption style "menu_caption" color "#000"
I noticed that the lines with the > symbol seemed to cause the issue. Does it still happen if you remove them?

Code: Select all

# remove either or both > symbols
   "How will you spend the evening?"

    menu selection:
        "How will you spend the evening? {fast}"
Commenting out the else bit got rid of the caption entirely, so that was something. However, I could see how that could be annoying if someone is skipping or hits space too fast to read what was said before a choice menu pops up.

I took out the > and that just put it up at the top again, but without a >.
This is really strange.

Post Reply

Who is online

Users browsing this forum: Ocelot