Is it possible to make a secret menu selection?

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.
Message
Author
JimmyFrost
Regular
Posts: 30
Joined: Fri May 01, 2015 9:46 am
Projects: TOWER
Location: United States
Contact:

Re: Is it possible to make a secret menu selection?

#16 Post by JimmyFrost »

Here is the traceback. . .

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/gui.rpy", line 191, in <module>
    define gui.button_hidden_text_selected_alpha = gui.hidden_selected_alpha
AttributeError: 'StoreModule' object has no attribute 'hidden_selected_alpha'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "C:\Users\PAT\Desktop\Creation Kit\renpy-6.99.12.4-sdk\renpy\bootstrap.py", line 295, in bootstrap
    renpy.main.main()
  File "C:\Users\PAT\Desktop\Creation Kit\renpy-6.99.12.4-sdk\renpy\main.py", line 419, in main
    game.context().run(node)
  File "lib/windows-i686/gui.rpyc", line 191, in script
  File "C:\Users\PAT\Desktop\Creation Kit\renpy-6.99.12.4-sdk\renpy\ast.py", line 1816, in execute
    value = renpy.python.py_eval_bytecode(self.code.bytecode)
  File "C:\Users\PAT\Desktop\Creation Kit\renpy-6.99.12.4-sdk\renpy\python.py", line 1743, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "game/gui.rpy", line 191, in <module>
    define gui.button_hidden_text_selected_alpha = gui.hidden_selected_alpha
AttributeError: 'StoreModule' object has no attribute 'hidden_selected_alpha'

Windows-8-6.2.9200
Ren'Py 6.99.12.4.2187 
If anyone can help me figure this out it would be greatly appreciated.
"If hard work hasn't hurt anyone, then why is there worker's comp?"

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Is it possible to make a secret menu selection?

#17 Post by philat »

Ignore the gui for custom settings if you're a beginner -- it works in a particular way, and if you don't understand it, best to leave it alone and just use regular screen language and styles.

Code: Select all

screen choice(items):
    style_prefix "choice"

    vbox:
        for i in items:
            if " (secret)" in i.caption:
                button:
                    action i.action
                    style "menu_choice_secret_button"
                    text i.caption.replace(" (secret)", "") style "menu_choice_secret_text"

            else:
                textbutton i.caption action i.action

style menu_choice_secret_button is choice_button:
    idle_background None

style menu_choice_secret_text is choice_text:
    idle_color "#0000" # the fourth number is alpha - setting it to 0 makes it transparent. #000F is identical to #000.
    
    
label start:
    menu:
    
        "Choice 1 (secret)":
    
            pass
    
        "Choice 2":
    
            pass

JimmyFrost
Regular
Posts: 30
Joined: Fri May 01, 2015 9:46 am
Projects: TOWER
Location: United States
Contact:

Re: Is it possible to make a secret menu selection?

#18 Post by JimmyFrost »

Alright, so it works fantastically! Thank you philat. Now the only thing left is the text alignment. For some strange reason, it really likes the left side a lot. . .
"If hard work hasn't hurt anyone, then why is there worker's comp?"

Post Reply

Who is online

Users browsing this forum: Ocelot