How to make menu choice disabled?

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
Inky Pillow
Newbie
Posts: 15
Joined: Mon Aug 24, 2015 9:46 am
Contact:

How to make menu choice disabled?

#1 Post by Inky Pillow »

Hi,
I want to make one of the choices in a menu to be disabled, so the user is unable to select it, but I still want the choice to appear. This is because the choice hasn't been written because otherwise the wordcount will be too high, but I still want to show the example. (long story, but this is a school assignment).
I've tried using the 'if' statement, but when I do, the choice just disappears all together.
I am using the latest version of renpy 6.99.12.

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: How to make menu choice disabled?

#2 Post by Remix »

The action of a button should define its sensitivity...

action If( "sometest > somevar", Jump('working'), None)

I say 'should' as I have not tried it, just read the docs
Frameworks & Scriptlets:

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: How to make menu choice disabled?

#3 Post by Remix »

Oops, tested and the condition is unquoted...

action If( sometest >= somevalue, [Real actions], None)

This does not seem to alter the Hover/Idle though, so appears just the same as using NullAction...
Hopefully someone else knows how to do it without resorting to if: else: bloocks
Frameworks & Scriptlets:

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: How to make menu choice disabled?

#4 Post by Remix »

Ah...

action If( sometest >= somevalue, [Real actions], None) sensitive sometest >= somevalue
Frameworks & Scriptlets:

Inky Pillow
Newbie
Posts: 15
Joined: Mon Aug 24, 2015 9:46 am
Contact:

Re: How to make menu choice disabled?

#5 Post by Inky Pillow »

Sorry, but I'm pretty terrible at coding and i cant get it to work '-_-.

My code:

Code: Select all

menu:
        "Mannerless Idiot": 
            show mal pout1
            extend " the mannerless idiot."
            $ prince1route += 1
            #disablethisone
        "Clueless Idiot":
            show mal pout2
            extend " the clueless idiot."
            $ prince2route += 1
I tried to do this:

Code: Select all

menu:
        "Mannerless Idiot": 
            action If(prince1route >= 1, jump afterchoosing, None)
            show mal pout1
            extend " the mannerless idiot."
            $ prince1route += 1
            #disable
    		
this:

Code: Select all

menu:
        "Mannerless Idiot":  action If(prince1route = 1, jump afterchoosing, None)
            show mal pout1
            extend " the mannerless idiot."
            $ prince1route += 1
            #disable
        "Clueless Idiot":
            show mal pout2
            extend " the clueless idiot."
            $ prince2route += 1
            
And a couple of more variations, but I havent been able to get it right.
The error I usually get is that theres an expected statement after If.
Thanks again!

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

Re: How to make menu choice disabled?

#6 Post by TheChatotMaestro »

Have the menu choice jump back to the menu?
Text directly before it invisibly jumps to a label, and the label is just the menu. The choice you want to disable... just jumps back to the menu! So it looks like you clicked it and it did nothing!
In theory, anyways. Would that work?

Inky Pillow
Newbie
Posts: 15
Joined: Mon Aug 24, 2015 9:46 am
Contact:

Re: How to make menu choice disabled?

#7 Post by Inky Pillow »

That... will work! Thanks!! Great idea :D

User avatar
AnnieTiamat
Regular
Posts: 53
Joined: Tue Dec 01, 2015 3:24 pm
Location: Seattle
Contact:

Re: How to make menu choice disabled?

#8 Post by AnnieTiamat »

Legit that is 100% how I made disabled menu choices work.
The sad part is how long I banged my head against it before I was like WAIT I CAN JUST MAKE IT LOOP OH MY GOD I AM SO LAME
It's a great fix, though. Basically seamless ;)

Post Reply

Who is online

Users browsing this forum: Alex, Bing [Bot], decocloud