How do you make a button not do anything?

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
AHAKuo
Regular
Posts: 41
Joined: Tue Feb 06, 2018 11:10 am
Projects: SoUnd Is ToxIc
Organization: AHAKuo
Tumblr: ahakuo
Deviantart: ahakuo
Contact:

How do you make a button not do anything?

#1 Post by AHAKuo »

I had this part in my game where I wanted the choices to not do anything. Kind of like to convey how unsure the character is about her decision. And I wanted the choices to move on their own with a timer, but I already did that.

I just want to know how I can make a menu choice not do anything when pressed.
Working on:

Image

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: How do you make a button not do anything?

#2 Post by irredeemable »

Code: Select all

menu:
    "Do nothing.":
        pass
    "Do more nothing.":
        pass

User avatar
Andredron
Miko-Class Veteran
Posts: 718
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: How do you make a button not do anything?

#3 Post by Andredron »

Code: Select all

menu:
    "1)do nothing":
        pass
    "2) yes":
        jump metka

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: How do you make a button not do anything?

#4 Post by xavimat »

With the answers above the button still will do something (dismiss the menu).

If you want the buttons to actually do nothing (so, the player will click the button and it won't do anything, it won't disappear, it simply will look at them like a fish), you'll need to create your own screen. In that screen you can:

- Put buttons with "action None". They will be visible but disabled (greyed out, hovering not doing anything).
- Put buttons with "action NullAction()". They will be visible and active, hovering over them will work, but clicking on them will do nothing.

But remember, in that screen there should be some way to dismiss the screen (otherwise, the game will be stuck). Maybe with a timer?
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
AHAKuo
Regular
Posts: 41
Joined: Tue Feb 06, 2018 11:10 am
Projects: SoUnd Is ToxIc
Organization: AHAKuo
Tumblr: ahakuo
Deviantart: ahakuo
Contact:

Re: How do you make a button not do anything?

#5 Post by AHAKuo »

    xavimat wrote: Tue Feb 27, 2018 4:12 pm With the answers above the button still will do something (dismiss the menu).

    If you want the buttons to actually do nothing (so, the player will click the button and it won't do anything, it won't disappear, it simply will look at them like a fish), you'll need to create your own screen. In that screen you can:

    - Put buttons with "action None". They will be visible but disabled (greyed out, hovering not doing anything).
    - Put buttons with "action NullAction()". They will be visible and active, hovering over them will work, but clicking on them will do nothing.

    But remember, in that screen there should be some way to dismiss the screen (otherwise, the game will be stuck). Maybe with a timer?
    Yes it does dismiss the menu. Which isn’t what I want. Hmm, showing a screen could help. Thank you for the response :D
    Working on:

    Image

    User avatar
    Lord Hisu
    Regular
    Posts: 58
    Joined: Sun Feb 11, 2018 2:31 am
    Contact:

    Re: How do you make a button not do anything?

    #6 Post by Lord Hisu »

    There's a simpler but less elegant way to do what you want.
    You can create a label right before the menu and then make the buttons check for a timer and jump to the label or continue with the decision.

    User avatar
    IrinaLazareva
    Veteran
    Posts: 399
    Joined: Wed Jun 08, 2016 1:49 pm
    Projects: Legacy
    Organization: SunShI
    Location: St.Petersburg, Russia
    Contact:

    Re: How do you make a button not do anything?

    #7 Post by IrinaLazareva »

    Lord Hisu wrote: Wed Feb 28, 2018 11:18 am There's a simpler but less elegant way to do what you want.
    You can create a label right before the menu and then make the buttons check for a timer and jump to the label or continue with the decision.
    There is no need to create a label before menu. Menu statement has own label:

    Code: Select all

        menu my_label:
            "Do nothing":
                jump my_label
            "Next":
                pass
    https://www.renpy.org/doc/html/menus.ht ... drink_menu

    User avatar
    Lord Hisu
    Regular
    Posts: 58
    Joined: Sun Feb 11, 2018 2:31 am
    Contact:

    Re: How do you make a button not do anything?

    #8 Post by Lord Hisu »

    IrinaLazareva wrote: Wed Feb 28, 2018 12:10 pm There is no need to create a label before menu. Menu statement has own label:

    Code: Select all

        menu my_label:
            "Do nothing":
                jump my_label
            "Next":
                pass
    https://www.renpy.org/doc/html/menus.ht ... drink_menu
    Oh, thank you for pointing that. It's not that bad then, probably better than create a screen.

    User avatar
    AHAKuo
    Regular
    Posts: 41
    Joined: Tue Feb 06, 2018 11:10 am
    Projects: SoUnd Is ToxIc
    Organization: AHAKuo
    Tumblr: ahakuo
    Deviantart: ahakuo
    Contact:

    Re: How do you make a button not do anything?

    #9 Post by AHAKuo »

    Lord Hisu wrote: Wed Feb 28, 2018 11:18 am There's a simpler but less elegant way to do what you want.
    You can create a label right before the menu and then make the buttons check for a timer and jump to the label or continue with the decision.
    Right. That's a better way to go about it. Thank you <3
    Working on:

    Image

    Post Reply

    Who is online

    Users browsing this forum: Ahrefs [Bot]