Use quick_menu causing errors on new game

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
jacobjumper
Regular
Posts: 44
Joined: Tue Jan 07, 2014 9:45 pm
Projects: Familiarity
Organization: Airheart
Location: Houston
Contact:

Use quick_menu causing errors on new game

#1 Post by jacobjumper »

So, using the "use quick_menu" code on my say screen doesn't want to work, causes the error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 24, in script
    "I haven’t been sleeping well lately."
  File "renpy/common/00action_data.rpy", line 50, in get_selected
    return getattr(self.object, self.field) == self.value
AttributeError: 'StoreModule' object has no attribute 'yvalue'
Here's the code:

Code: Select all

# Quick Menu
#
# A screen that's included by the default say screen, and adds quick access to
# several useful functions.
screen quick_menu:

    # Add an in-game quick menu.
    hbox:
        style_group "quick"

        xalign 0.5
        yalign 1.003

        textbutton _( 'Log') action [SetVariable("yvalue", 1.0), ShowMenu('text_history')]
        textbutton _("Quick Save") action QuickSave()
        textbutton _("Quick Load") action QuickLoad()
        textbutton _("Skip") action Skip()
        textbutton _("Auto") action Preference("auto-forward", "toggle")

init -2 python:
    style.quick_button.set_parent('default')
    style.quick_button.background = None
    style.quick_button.xpadding = 5

    style.quick_button_text.set_parent('default')
    style.quick_button_text.size = 15
    style.quick_button_text.idle_color = "#B3B6B7" 
    style.quick_button_text.hover_color = "FFFFFF"
    style.quick_button_text.selected_idle_color = "#B3B6B7"
    style.quick_button_text.selected_hover_color = "#FFFFFF"
    style.quick_button_text.insensitive_color = "#B6B6B4"
   

Code: Select all

screen say(who, what):
    style_prefix "say"

    window:
        id "window"

        if who is not None:

            window:
                style "namebox"
                text who id "who"

        text what id "what"
        
    ## If there's a side image, display it above the text. Do not display on the
    ## phone variant - there's no room.
    if not renpy.variant("small"):
        add SideImage() xalign 0.0 yalign 1.0

        use quick_menu
style window is default
style say_label is default
style say_dialogue is default
style say_thought is say_dialogue

style namebox is default
style namebox_label is say_label
I'm running it in 6.99.12.4

Any thoughts? Thanks.

User avatar
Belgerum
Regular
Posts: 110
Joined: Thu Nov 06, 2014 12:24 am
Skype: belgerum09
Soundcloud: Belgerum
itch: Belgerum
Contact:

Re: Use quick_menu causing errors on new game

#2 Post by Belgerum »

try unindenting the "use quick_menu" line once (delete four spaces). right now, the indentation puts it inside the window within the say screen, not just placed on top of the base screen.

User avatar
jacobjumper
Regular
Posts: 44
Joined: Tue Jan 07, 2014 9:45 pm
Projects: Familiarity
Organization: Airheart
Location: Houston
Contact:

Re: Use quick_menu causing errors on new game

#3 Post by jacobjumper »

Now I get this error when loading or starting a new game

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 16, in script
    "I haven’t been sleeping well lately."
  File "renpy/common/00action_data.rpy", line 50, in get_selected
    return getattr(self.object, self.field) == self.value
AttributeError: 'StoreModule' object has no attribute 'yvalue'

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

Re: Use quick_menu causing errors on new game

#4 Post by Imperf3kt »

What are the lines directly preceding that and the lines directly after it?

Looks like you have indentation errors elsewhere.
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

User avatar
Belgerum
Regular
Posts: 110
Joined: Thu Nov 06, 2014 12:24 am
Skype: belgerum09
Soundcloud: Belgerum
itch: Belgerum
Contact:

Re: Use quick_menu causing errors on new game

#5 Post by Belgerum »

From what I can tell, the problem is the variable "yvalue" which is set to be modified by the "Log" button on the quick menu. I'd check your code over for that variable, and make sure it's defined somewhere, probably in an init block.

User avatar
jacobjumper
Regular
Posts: 44
Joined: Tue Jan 07, 2014 9:45 pm
Projects: Familiarity
Organization: Airheart
Location: Houston
Contact:

Re: Use quick_menu causing errors on new game

#6 Post by jacobjumper »

Code: Select all

label start:
$ _game_menu_screen = "game_menu"
stop music fadeout 1
#Scene 1: Ground/Zero ####################
label GroundZero:
with slowfade 
window show
scene openingCG at Position(xpos=0.0, xanchor=0.0, ypos=0.0, yanchor=0.0)
with fade
play music "music/Act1/01-01-01 Ambient3.ogg" fadeout 1.0
play ambience1 "music/sfx/act 1/scene 1/01.01.01 - Light wind rustling."
"I haven’t been sleeping well lately."
"I’m not really sure why. Of course I’ve thought about it, but nothing comes to mind; there’s nothing in my life that I can point my finger at and say \"stop doing that\" or \"start doing this.\" "

User avatar
jacobjumper
Regular
Posts: 44
Joined: Tue Jan 07, 2014 9:45 pm
Projects: Familiarity
Organization: Airheart
Location: Houston
Contact:

Re: Use quick_menu causing errors on new game

#7 Post by jacobjumper »

You were right in that for some reason, my readback.rpy was missing. But it still isn't showing, even though the use quick_menu line is now right after the say screen start.

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

Re: Use quick_menu causing errors on new game

#8 Post by Imperf3kt »

play ambience1 "music/sfx/act 1/scene 1/01.01.01 - Light wind rustling."

Should this hqve an extension? .ogg maybe?
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

User avatar
Belgerum
Regular
Posts: 110
Joined: Thu Nov 06, 2014 12:24 am
Skype: belgerum09
Soundcloud: Belgerum
itch: Belgerum
Contact:

Re: Use quick_menu causing errors on new game

#9 Post by Belgerum »

if the "use quick menu" code is the first thing after the start of the say screen, it will happen below everything else on the say screen. It may just be hidden under the textbox window.

User avatar
jacobjumper
Regular
Posts: 44
Joined: Tue Jan 07, 2014 9:45 pm
Projects: Familiarity
Organization: Airheart
Location: Houston
Contact:

Re: Use quick_menu causing errors on new game

#10 Post by jacobjumper »

No, I have it set to where it fills the 'ogg' in, to save time.

I used a different, newer version of the quick menu, and it works, even if none of my styles work.

Post Reply

Who is online

Users browsing this forum: No registered users