[Solved] config.menu_include_disabled only in some parts?

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
Adrian_DVL
Regular
Posts: 141
Joined: Fri Mar 15, 2019 8:46 am
Completed: Clockwork Poison
Projects: Melodic Dates, Clockwork Poison: Salvation
Contact:

[Solved] config.menu_include_disabled only in some parts?

#1 Post by Adrian_DVL »

Hi mates!
Do you know if I can set the config.menu_include_disabled to True BUT keeping it False in some part of the games, like, for instance, a couple menus?
Thanks!
Last edited by Adrian_DVL on Tue May 07, 2019 4:07 pm, edited 1 time in total.

User avatar
nature1996
Regular
Posts: 62
Joined: Wed Jun 21, 2017 10:35 am
Contact:

Re: config.menu_include_disabled only in some parts?

#2 Post by nature1996 »

I'm not sure, but I think you can bypass this by using the sensitive key word instead of an if statement as such:

Code: Select all

button:
	sensitive (#sensitive if True, else greyed out)
	action (#what you want the button to do)
That will show the button in all condition, but you will only be able to interact with it if it is sensitive.

I'm not sure if that solve your problem, or is even related. If anything else, you can change the config variable on the go, but it might have unexpected result. The best way is to test it.
Je parle aussi français

Adrian_DVL
Regular
Posts: 141
Joined: Fri Mar 15, 2019 8:46 am
Completed: Clockwork Poison
Projects: Melodic Dates, Clockwork Poison: Salvation
Contact:

Re: config.menu_include_disabled only in some parts?

#3 Post by Adrian_DVL »

nature1996 wrote: Tue May 07, 2019 2:50 pm I'm not sure, but I think you can bypass this by using the sensitive key word instead of an if statement as such:

Code: Select all

button:
	sensitive (#sensitive if True, else greyed out)
	action (#what you want the button to do)
That will show the button in all condition, but you will only be able to interact with it if it is sensitive.

I'm not sure if that solve your problem, or is even related. If anything else, you can change the config variable on the go, but it might have unexpected result. The best way is to test it.
Nope, what you're suggesting just gives me control to choose if the player is able to press the button or not, independent of other conditions, but it's not what I'm trying to do.

My game, by default, has the config.menu_include_disabled on True, so that player can see all the options in a menu, greyed out or not depending if they can click it or not. Specifically, what I'm trying to make is a music room, which has buttons. Those buttons are greyed out if the player haven't listen to a track yet, due to the config variable. I want to make those buttons invisible until the player listens to the track at least once, but keeping the other menus and buttons greyed out when they have to be greyed out.

User avatar
nature1996
Regular
Posts: 62
Joined: Wed Jun 21, 2017 10:35 am
Contact:

Re: config.menu_include_disabled only in some parts?

#4 Post by nature1996 »

You could put config.menu_include_disabled on False and change all if cause to sensitive key word... or add this to your screen, it might work:

Code: Select all

screen Screen():
    on "show" action SetVariable("config.menu_include_disabled", False)
    on "hide" action SetVariable("config.menu_include_disabled", True)
Edit: you could also create a sub list with only the song that have been played, then use that one to print the button
Je parle aussi français

Adrian_DVL
Regular
Posts: 141
Joined: Fri Mar 15, 2019 8:46 am
Completed: Clockwork Poison
Projects: Melodic Dates, Clockwork Poison: Salvation
Contact:

Re: config.menu_include_disabled only in some parts?

#5 Post by Adrian_DVL »

nature1996 wrote: Tue May 07, 2019 3:38 pm You could put config.menu_include_disabled on False and change all if cause to sensitive key word... or add this to your screen, it might work:

Code: Select all

screen Screen():
    on "show" action SetVariable("config.menu_include_disabled", False)
    on "hide" action SetVariable("config.menu_include_disabled", True)
Edit: you could also create a sub list with only the song that have been played, then use that one to print the button
Setting those actions to the screen didn't work.
But you gave me an idea and I've managed to make buttons invisible if player haven't listened to a track by conditioning the buttons to an if renpy.seen_audio(), without having to set the config variable on False.
So thank you! This is solved!

Post Reply

Who is online

Users browsing this forum: DewyNebula