Greyed out previously chosen menu options? [solved! :D]

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
Deji
Cheer Idol; Not Great at Secret Identities
Posts: 1592
Joined: Sat Oct 20, 2007 7:38 pm
Projects: http://bit.ly/2lieZsA
Organization: Sakevisual, Apple Cider, Mystery Parfait
Tumblr: DejiNyucu
Deviantart: DejiNyucu
Location: Chile
Contact:

Greyed out previously chosen menu options? [solved! :D]

#1 Post by Deji »

I've seen this before, that when you play for the second/nth time, when a menu shows up, the menu option(s) you've picked on previous playthrough(s) appears greyed-out or on a duller color, making it easier for ending/variation scenes hunting.

My logic tells me I'd have to establish persistent variables for every menu choice in the game and check their value, like what people do with the CG galleries.

Code: Select all

menu: 
    "choice1":
        $persistent.d1m1_choice1 = True
        jump choice1_stuff
    "choice2":
        $persistent.d1m1_choice2 = True
        jump choice2_stuff
    "choice3":
        $persistent.d1m1_choice3 = True
        jump choice3_stuff
...But then I have no idea how to make an if for the menu button appearance/style, using that persistent variable data.

Is there a way to do this?
Last edited by Deji on Fri Nov 11, 2011 6:12 pm, edited 1 time in total.
Image
Tumblr | Twitter
Forever busy :')
When drawing something, anything, USE REFERENCES!! Use your Google-fu!
Don't trust your memory, and don't blindly trust what others teach you either.
Research, observation, analysis, experimentation and practice are the key! (:

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Greyed out menu options picked on previous playthroughs?

#2 Post by PyTom »

Style menu_choice_chosen and menu_choice_chosen_button. There's no need to maintain the persistent variables yourself - Ren'Py does it for you.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Deji
Cheer Idol; Not Great at Secret Identities
Posts: 1592
Joined: Sat Oct 20, 2007 7:38 pm
Projects: http://bit.ly/2lieZsA
Organization: Sakevisual, Apple Cider, Mystery Parfait
Tumblr: DejiNyucu
Deviantart: DejiNyucu
Location: Chile
Contact:

Re: Greyed out menu options picked on previous playthroughs?

#3 Post by Deji »

Awesome! Thank you, I'll give it a try <3
Image
Tumblr | Twitter
Forever busy :')
When drawing something, anything, USE REFERENCES!! Use your Google-fu!
Don't trust your memory, and don't blindly trust what others teach you either.
Research, observation, analysis, experimentation and practice are the key! (:

User avatar
Deji
Cheer Idol; Not Great at Secret Identities
Posts: 1592
Joined: Sat Oct 20, 2007 7:38 pm
Projects: http://bit.ly/2lieZsA
Organization: Sakevisual, Apple Cider, Mystery Parfait
Tumblr: DejiNyucu
Deviantart: DejiNyucu
Location: Chile
Contact:

Re: Greyed out menu options picked on previous playthroughs?

#4 Post by Deji »

So...
I styled the chosen menus as you said, like this:

Code: Select all

    style.menu_choice_button.background = "#33271C"
    style.menu_choice_button.hover_background =  "#ECE7C4"
    style.menu_choice_chosen_button.background = "#333"
    style.menu_choice_chosen_button.hover_background =  "#888"
        
    ##Modifies the Menu Choice's Text
    style.menu_choice.color = "#B99D83"
    style.menu_choice_chosen.color = "#000"
But nothing happened =/

I went to investigate the choice screen then. For some reason, it stroke me as if it wasn't really considering the "chosen" part, or at least there was no condition that would instruct it to change the style if the button was chosen. I didn't really know how would that work, though, so I couldn't figure out how to put that myself.

Then I exercised search and research-fu for a couple of hours and found out that I was right, that the choice screen had to be modified.

I hope this helps other people that want to do the same as well, and save them some time too! ^^
Image
Tumblr | Twitter
Forever busy :')
When drawing something, anything, USE REFERENCES!! Use your Google-fu!
Don't trust your memory, and don't blindly trust what others teach you either.
Research, observation, analysis, experimentation and practice are the key! (:

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot]