About Exit Confirmation (X button / Alt F4) [Solved]

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
kawahara
Newbie
Posts: 2
Joined: Tue Mar 13, 2018 8:30 am
Contact:

About Exit Confirmation (X button / Alt F4) [Solved]

#1 Post by kawahara »

Hii, I'm someone just start learn to use renpy to code and creating a game, so I might be asking something very simple but I just can't figure it out, so I need a little help.

I'm trying to make a game that contain timed menu choice, like Walking Dead.

The problem is when the time is ticking, players will able to just simply right click or press Esc into menu screen and slowly think about the choice, which make the system kinda pointless, so I turned it off, but there's still exit option (X button and Alt F4) that will pop out "sure you wanna quit" thing and stop the count down completely.

I searched for topic about it for a while, I did find something similar viewtopic.php?t=12450 but I can't find the option they said to turn it off (I don't know the reason, maybe the topic too old or I'm just dumb).

So, is there anyway I can make the game at least quit directly when you press the X button without that message popping out? or anyway that can prevent players from taking it as advantage? If there's one could you please show me step by step?

Thanks.
Last edited by kawahara on Wed Mar 14, 2018 4:21 am, edited 1 time in total.

DannX
Regular
Posts: 99
Joined: Mon Mar 12, 2018 11:15 am
Contact:

Re: About Exit Confirmation (X button / Alt F4)

#2 Post by DannX »

You could use the_confirm_quit variable.

Code: Select all

label start:

    "At this point the game asks for confirmation normally."

    "Now let's disable it and call the screen."

    $ _confirm_quit = False #Temporarily disable confirmation

    #Here you would show your timed choices

    $ _confirm_quit = True #Re-enable after choices are shown.

    "Now the game will ask for confirmation again" 

    return
Also I think it would be a good idea to let the player know what the game will do beforehand so they know they don't accidentally lose progress.

kawahara
Newbie
Posts: 2
Joined: Tue Mar 13, 2018 8:30 am
Contact:

Re: About Exit Confirmation (X button / Alt F4)

#3 Post by kawahara »

Thanks a lot!

That's just what I needed! :)

Post Reply

Who is online

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