renpy.quit questions

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
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

renpy.quit questions

#1 Post by isobellesophia »

Hi,

So in my game, i know about renpy.quit() that it will quits immediately.
I want to when the player reads the very end of a dialogue, i want them not allowing to quit the game.

Like..

Code: Select all

"Lets try getting out of here.."
$ renpy.quit() <---- Pretended that it wont quit the game. Maybe False perhaps?
"Oh no! I cannot quit the game!"
And, if the player once clicked the window X button above, (Finding a way to escape the game.) the following character will say a thing.

I want to do the code with "If" statement. When the player clicks the X window button..

Code: Select all

"Hoho.. looks like there is no escape?"
So when the player has no other way, they need to restart the computer or at least open their task manager instead... (Ctrl F4 is easy for them..) so why not?

So.. any possible code?
(

Thank you.
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: renpy.quit questions

#2 Post by Imperf3kt »

I"ll be honest with you, this kind of abuse of the player isn't particularly accepted among many individuals here, so you may not get an answer.

Personally, I try to maintain an unbiased opinion on "troll" games or functions, at least until it goes too far, and restricting a players ability to close the game, is definitely past that point. (DDLC was very similarly abusive toward its players, but at least it let you quit)


Just something to consider though, let's assume you do block quitting the game. How do you block ALT + TAB?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

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: renpy.quit questions

#3 Post by xavimat »

I strongly advise you against that kind of technique. It's possible that many players won't find it interesting or funny.
I don't think it makes your game more interesting.

That said, I've given it a try as a theoretical question, and I've managed to do it putting the "load" function inside the special label "quit".
DISCLAIMER: You actually won't be able to quit this game. Are you really interested in trying it?
Behold, "The Never Quitting Story"!:

Code: Select all

define persistent.noquit = False
default _quit_slot = "noquit"

label quit:
    if persistent.noquit:
        $ renpy.load("noquit")
    return

label start:
    centered "MaXiTrOlL PrOdUcTiOnS proudly presents:"
    centered "{b}The Never Quitting Story{/b}"
    centered "by Michael Annoying Ende"
    jump chapter_1

label chapter_1:
    $ persistent.noquit = True
    "Monika" "Hi again!"
    "Monika" "Do you remember me?"
    "Monika" "I love you so much, I will never leave your computer."
    "Monika" "Iloooooveeeeeeeyouuuuuuuuuuu."
    jump chapter_1
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
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: renpy.quit questions

#4 Post by isobellesophia »

That looks great, thanks xavimat!

(ddlc refeence btw.)
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
PyTom
Ren'Py Creator
Posts: 16093
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: renpy.quit questions

#5 Post by PyTom »

For the record, Ren'Py has a way to quit even if the game is trying fairly hard to disable quitting.

If you click the quit button in the window (or type alt-F4), then do it again within half a second, Ren'Py will always quit.
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

Post Reply

Who is online

Users browsing this forum: Google [Bot]