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:

Is it possible to make a secret menu selection?

#1 Post by JimmyFrost »

I don't know if anyone wondered this before, but is it possible to have a secret selection on a menu screen? Like you can't see the button if the cursor isn't hovering over the choice, but you can select it. I wouldn't recommend using this on major plot-changing choices unless it is obvious, but I would think that would be a cool trick to know.
"If hard work hasn't hurt anyone, then why is there worker's comp?"

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

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

#2 Post by Milkymalk »

It is possible, you "just" need to apply the style alpha 0.0 to all elements of the choice: Frame, text etc. But I am not good with styles, so someone else would have to tell you how exactly to do that.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

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?

#3 Post by JimmyFrost »

Okay, so it is possible. If we figure it out, then I would imagine that the how to do it should be put in the cookbook.
"If hard work hasn't hurt anyone, then why is there worker's comp?"

TheChatotMaestro
Regular
Posts: 91
Joined: Mon Jul 31, 2017 8:33 am
Deviantart: LedianWithACamera
Contact:

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

#4 Post by TheChatotMaestro »

I'm in no way qualified to answer this question, but perhaps all you need to do is find out how to have different menu buttons have different images that they use to exist, and then have them appear different when rolled over. If you could do that, the secret option's un-rolled-over image could be transparent, and it would appear there was no button there. At least, that makes sense in my head... Would this work?

User avatar
Sarchalen
Regular
Posts: 29
Joined: Tue Aug 08, 2017 5:23 pm
Projects: Sugawara Chronicle
Contact:

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

#5 Post by Sarchalen »

Hmmm I would do something like this: Make a button that is transparent, just alpha with no image, and save it as a png. Then write a variable something like "isSecretChoice = true" and then make that whatever choice a secret choice by applying that variable, which then does a check to say if isSecretChoice=true then buttonImage = Invisiblebutton.png

Something like that.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

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

#6 Post by Remix »

Similar to a reply in another thread, you could just use on hover and on idle within a transform

Code: Select all

transform button_move:
    on hover:
        ease 0.75 alpha 1.0 xpos -0.70
    on idle:
        ease 1.5 alpha 0.0 xpos 0.0

screen moving_buttons():
    vbox:
        # x,y,w,h
        area (0.975, 0.1, 0.1, 0.4)
        for k in range(4):
            textbutton "Button {0}".format(k) action [Jump("test")] pos (0.0, k*0.05) at button_move

label start:
    show screen moving_buttons
    "First Line"
    "Second Line"
    "Last Line"
    return
Note:
As 'alpha' is not a valid child of textbutton, this example has them appear briefly, fade away then reappear on hover etc
Using image based buttons would also not allow direct alpha 0.0 setting, so an alternate approach would be needed.
I did try:
....on start, show:
........alpha 0.0
which also did not work.
If the 'idle' was instant alpha 0.0 it should work though, just less ummm funky
Frameworks & Scriptlets:

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?

#7 Post by JimmyFrost »

So is this snippet supposed to go into the "screen" file, the "script" file, or somewhere else?
"If hard work hasn't hurt anyone, then why is there worker's comp?"

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

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

#8 Post by trooper6 »

JimmyFrost wrote: Tue Aug 15, 2017 3:41 pm So is this snippet supposed to go into the "screen" file, the "script" file, or somewhere else?
Do you notice the snippet has:
a transform
a screen
then the label start?

that means this is going onto the same rpy file as your script.rpy...which is the file that has the label start. Transforms and screens can go anywhere, they just need to be outside of any block.

But really, just make a brand new project and put that code in the script file and test it out.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

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

#9 Post by Remix »

To be honest, I actually advise doing most ** testing or playing about ** ren'py code just in script.rpy... it saves a lot of time fiddling around between files.
Most of the code-snippets I post as answers are just me playing around in a 'New Project' with a blank script.rpy :)

Of course, once things start to work and appear how you want, put the different parts in options, screens, gui or any other file as you please
Frameworks & Scriptlets:

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?

#10 Post by JimmyFrost »

Code: Select all

style hidden_choice_button is default:
    properties gui.hidden_button_properties("hidden_choice_button")

style hidden_choice_button_text is default:
    properties gui.hidden_button_text_properties("hidden_choice_button")
Just showing this. Maybe it's a fool's errand, but shouldn't it be possible to simply make a gui block for hidden choice? But how to make the idle color clear instead of default "555555" and "aaaaaa"? This is getting complicated.

Code: Select all

define gui._hidden_idle_color = '#000000'
define gui.hidden_idle_small_color = '#000000'
"If hard work hasn't hurt anyone, then why is there worker's comp?"

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?

#11 Post by JimmyFrost »

Alright, the previous post was a bad idea. Either that, or I didn't go nearly far enough to make that work.
"If hard work hasn't hurt anyone, then why is there worker's comp?"

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?

#12 Post by JimmyFrost »

Hrm. . . Trying to make sense of how to move these buttons. It works, Remix. Thank you.
"If hard work hasn't hurt anyone, then why is there worker's comp?"

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?

#13 Post by JimmyFrost »

Code: Select all

transform button_move:
    on hover:
        ease 0.75 alpha 1.0 xpos -0.70
    on idle:
        ease 1.5 alpha 0.0 xpos 0.0

screen moving_buttons1():
    vbox:
        # x,y,w,h
        area (0.425, 0.475, 0.1, 0.4)
        for k in range(1):
            textbutton "DORE".format(k) action [Jump("test1")] pos (0.0, k*0.05) at button_move

screen moving_buttons2():
    vbox:
        # x,y,w,h
        area (0.425, 0.575, 0.1, 0.4)
        for k in range(1):
            textbutton "ARE".format(k) action [Jump("test2")] pos (0.0, k*0.05) at button_move

label start:

    scene black

    show screen moving_buttons1
    
    menu:
        "First Line":
            
            hide screen moving_buttons1
            
            e "Hello world!"
            
            return

        "Second Line":
            
            hide screen moving_buttons1
            show screen moving_buttons2

            e "Hello world!"
            
            return

        "Last Line":
            
            hide screen moving_buttons1

            e "Hello world!"
            
            return
            
label test1:
    
    hide screen moving_buttons1
    
    ". . ."
    
    e "Hey! You found the secret button!"
    
    return

label test2:
    
    hide screen moving_buttons1
    hide screen moving_buttons2
    
    ". . ."
    
    e "You're a real easter egg hunter, aren't you?"
    
    return
I'm no world-class programmer, but there has to be a more efficient way of doing this.
"If hard work hasn't hurt anyone, then why is there worker's comp?"

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

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

#14 Post by philat »

Unless you need to position the "secret button" anywhere in particular, you can just style an option differently, i.e., set idle_background and idle_color to None, "#FFF0", etc. viewtopic.php?f=8&t=44780#p459799

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?

#15 Post by JimmyFrost »

Alright, I know I've stepped out of wrong territory and into HYPER Wrong territory. . .

Code: Select all

## Colors ######################################################################
##
## The colors of text in the interface.

## An accent color used throughout the interface to label and highlight text.
define gui.accent_color = '#0099cc'

## The color used for a text button when it is neither selected nor hovered.
define gui.idle_color = '#555555'

## The color used for a hidden text button when it is neither selected nor hovered.
define gui.hidden_idle_color = '#333333'

## The alpha used for a hidden text button when it is neither selected nor hovered.
define gui.hidden_idle_alpha = 0.0

## The small color is used for small text, which needs to be brighter/darker to
## achieve the same effect.
define gui.idle_small_color = '#aaaaaa'

## The color that is used for buttons and bars that are hovered.
define gui.hover_color = '#66c1e0'

## The color that is used for hidden buttons and bars that are hovered.
define gui.hidden_hover_color = '#44afbe'

## The color used for a text button when it is selected but not focused. A
## button is selected if it is the current screen or preference value.
define gui.selected_color = '#ffffff'

## The color used for a hidden text button when it is selected but not focused. A
## button is selected if it is the current screen or preference value.
define gui.hidden_selected_color = '#dddddd'

## The color used for a text button when it cannot be selected.
define gui.insensitive_color = '#5555557f'

## Colors used for the portions of bars that are not filled in. These are not
## used directly, but are used when re-generating bar image files.
define gui.muted_color = '#003d51'
define gui.hover_muted_color = '#005b7a'

## The colors used for dialogue and menu choice text.
define gui.text_color = '#ffffff'
define gui.interface_text_color = '#ffffff'

#The block code between these points are unchanged

## The color of button text in various states.
define gui.button_text_idle_color = gui.idle_color
define gui.button_text_hover_color = gui.hover_color
define gui.button_text_selected_color = gui.selected_color
define gui.button_text_insensitive_color = gui.insensitive_color 

## The color of hidden button text in various states.
define gui.button_hidden_text_idle_color = gui.hidden_idle_color
define gui.button_hidden_text_idle_alpha = gui.hidden_idle_alpha
define gui.button_hidden_text_hover_color = gui.hidden_hover_color
define gui.button_hidden_text_selected_color = gui.hidden_selected_color
define gui.button_hidden_text_selected_alpha = gui.hidden_selected_alpha
define gui.button_hidden_text_insensitive_color = gui.hidden_insensitive_color
And the true beauty of this is that I don't specifically know what I don't know, and all I know is that this spits out an angry attribute error. I feel that this is vastly too long-handed, but I'm an absolute novice on this stuff.
"If hard work hasn't hurt anyone, then why is there worker's comp?"

Post Reply

Who is online

Users browsing this forum: No registered users