[Solved] Disabling the quick menu momentarily

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
SethRiley
Regular
Posts: 35
Joined: Sat Mar 18, 2017 3:27 pm
Contact:

[Solved] Disabling the quick menu momentarily

#1 Post by SethRiley » Mon Mar 20, 2017 8:41 pm

Good day to all (^_^)/

At certain moments during game play I would like to have the quick menu disappear briefly, to simulate the feeling of a short cut scene as it were.

By default, pressing 'H' on the keyboard hides the interface. I am looking for a similar effect, though it should be triggered at some points in the script, so that when the player reaches that part of the story, the quick menu disappears, until it is triggered to come back again.

I found this post at the forum where basically the same question has been asked before:viewtopic.php?f=8&t=12229
PyTom replied:
The quick menu is included as part of the screen, rather than its own screen.

Generally, you don't want dialogue in your splashscreen - that's not what it's for. However, if you do want dialogue in the splashscreen, you can always change the say screen to read:

Code:
if quick_menu:
use quick_menu


Then you can update the quick_menu variable to control when the quick menu is shown.
I've added that bit of code to the say screen, but I'm not sure what to do next.

I've tried defining "quick_menu" as a boolean which is set to either False or True at certain points during the story like so:

Code: Select all

$ quick_menu = False
...though this seems ineffective and is most likely completely wrong.

Could some one please explain further how to implement the method as described by PyTom?
Last edited by SethRiley on Tue Mar 21, 2017 1:14 am, edited 1 time in total.

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Disabling the quick menu momentarily

#2 Post by indoneko » Mon Mar 20, 2017 8:56 pm

I would just add showif inside the quickmenu screen to hide the hbox which wraps all of those textbuttons.
Then set a variable in script.rpy to tell the quickmenu to show or hide it.
My avatar is courtesy of Mellanthe

User avatar
SethRiley
Regular
Posts: 35
Joined: Sat Mar 18, 2017 3:27 pm
Contact:

Re: Disabling the quick menu momentarily

#3 Post by SethRiley » Mon Mar 20, 2017 9:09 pm

Thank you indoneko. Please forgive the noobish nature of my reply, I am new to Ren'Py.

I've tried putting "define persistent.showquickmenu = True" in the script, and using "$ persistent.showquickmenu = False" to flip the value during the story. My quick screen doesn't have an hbox, just some image buttons:

Code: Select all

screen quick_menu():

    zorder 100

    showif persistent.showquickmenu = True:
    
        imagebutton idle "gui/gui_1.png" xpos 0 ypos 0 action ShowMenu('save')
        imagebutton idle "gui/gui_2.png" xpos 1115 ypos 0 action ShowMenu('preferences')
        imagebutton idle "gui/gui_3.png" xpos 0 ypos 70 action Rollback()

init python:
    config.overlay_screens.append("quick_menu")
This, as may be expected, does not work :oops:
Could you please elaborate indoneko?

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Disabling the quick menu momentarily

#4 Post by indoneko » Mon Mar 20, 2017 9:27 pm

There's a mistake in your code. Instead of :
showif persistent.showquickmenu = True:

It should be :
showif persistent.showquickmenu:

Btw, why do you need to use persistent variable?
My avatar is courtesy of Mellanthe

User avatar
SethRiley
Regular
Posts: 35
Joined: Sat Mar 18, 2017 3:27 pm
Contact:

Re: Disabling the quick menu momentarily

#5 Post by SethRiley » Mon Mar 20, 2017 9:37 pm

Thanks a lot indoneko, now it works indeed.

That is a very clear and concise way of showing and hiding the quick menu, by making use of "showif". I did not know the command.

And indeed, there is no need for a persistent variable. It works both ways, but I've removed the "persistent." bit.

Thanks ever so much (^_^)

Post Reply

Who is online

Users browsing this forum: No registered users