I need to block the users ability to continue.

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
Lutka
Newbie
Posts: 23
Joined: Mon Apr 24, 2017 11:13 am
Contact:

I need to block the users ability to continue.

#1 Post by Lutka »

Hey.

I have two questions actually and I'd like if you guys could answer either one.

The main one and the more important one is that question in the title.
I've got this setup where two to three textbuttons show up and I want the user to have to press one of the textbuttons before they can continue. Problem is, right now they can just ignore the buttons and press somewhere away from the buttons and the script.rpy will just continue past the textbuttons and they'll just stay there while the game continues.

I was thinking something like making a jump command right after the textbuttons to where, if you pressed somewhere other than the textbuttons you would be taken to back to the textbuttons, but I was wondering if there was a more sophisticated way of doing it.


That's the first and most important question. But I figured since I'm here I might as well ask this as well since I'm having trouble.

I have these two or three textbuttons right, they're in an hbox, in fact nvm let me show you

Here's what I have in script.rpy

Code: Select all

i "Hey, sorry I'm late, I had to take Elly to the gym"
    window hide
    
label buttons1:
show screen twochoices("Forgive her", "Don't forgive her", "forgive", "dforgive")
pause
jump buttons1
label forgive:
good stuff yes and here's what I have it says in screens.rpy

Code: Select all

screen twochoices(choice1, choice2, label1, label2):
    frame:
        xpadding 10
        ypadding 10
        xalign 0.4
        yalign 0.9

        hbox:
            null height 10
            textbutton choice1 action (Hide("twochoices"), Jump(label1)):
                xpadding 40
            textbutton choice2 action (Hide("twochoices"), Jump(label2)):
                xpadding 40
This should essentially work like a choice menu, however with textbuttons.
Now the issue is that it looks like this
Image

I want there to be a pause between the two buttons (hence the xpadding that didn't work).

Is that feasible?
Thank you

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: I need to block the users ability to continue.

#2 Post by Divona »

Still not quite sure what you meant by "pause" between the two buttons. You mean each text button has that blue background thing on it own? At the moment it looks like something from "frame".

Code: Select all

screen twochoices(choice1, choice2, label1, label2):
    modal True

    frame:
        background None
        xpadding 10
        ypadding 10
        xalign 0.4
        yalign 0.9

        hbox:
            spacing 40

            textbutton choice1 style "frame" padding (20, 20, 20, 20) action Jump(label1)
            textbutton choice2 style "frame" padding (20, 20, 20, 20) action Jump(label2)

Code: Select all

    i "Hey, sorry I'm late, I had to take Elly to the gym"
    window hide
    call screen twochoices("Forgive her", "Don't forgive her", "forgive", "dforgive")
    
label forgive:
Last edited by Divona on Thu May 25, 2017 1:41 pm, edited 1 time in total.
Completed:
Image

Lutka
Newbie
Posts: 23
Joined: Mon Apr 24, 2017 11:13 am
Contact:

Re: I need to block the users ability to continue.

#3 Post by Lutka »

Oh man I'm such an idiot

Code: Select all

screen twochoices(choice1, choice2, label1, label2):
    hbox:
        xalign 0.5
        yalign 0.9
    
        frame:
            xpadding 10
            ypadding 10
            xalign 0.4
            yalign 0.9

            hbox:
                null height 10
                textbutton choice1 action (Hide("twochoices"), Jump(label1)):
                    xpadding 40
        frame:
            xpadding 10
            ypadding 10
            xalign 0.4
            yalign 0.9

            hbox:
                    
                textbutton choice2 action (Hide("twochoices"), Jump(label2)):
                    xpadding 40
Thanks Divona, that solves that

Post Reply

Who is online

Users browsing this forum: fufuffiero, W3C [Validator]