"Are you sure you want to overwrite your save?" Window Disabling

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
tv-ghost
Newbie
Posts: 11
Joined: Mon Jul 23, 2018 3:47 am
Contact:

"Are you sure you want to overwrite your save?" Window Disabling

#1 Post by tv-ghost »

I've seen only one thing cover this window prompt, which is this: https://www.renpy.org/doc/html/screen_s ... write_save
However, I'm not sure how to use this command, or if this would work for completely skipping over this overwrite confirmation window. I've tried implementing it (define gui.overwrite_save = False) inside of gui.rpy, but to no avail. Using it causes no effect on the game, and the window prompt is shown with the same default text.

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: "Are you sure you want to overwrite your save?" Window Disabling

#2 Post by Per K Grok »

From what I can see 'gui.overwrite_save' just holds the string that is shown.

What you want to do is to set 'confirm' to 'False' for this action. I don't know if there is anything like

overwrite_save.confirm = False

but that would be the sort of thing you would need.

Sorry I don't have anything more concrete to give on this subject.

User avatar
MaydohMaydoh
Regular
Posts: 165
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: "Are you sure you want to overwrite your save?" Window Disabling

#3 Post by MaydohMaydoh »

Only way I can see how to do it is to change the file slots screen and change the button action to FileLoad and FileSave instead of FileAction.
So instead of

Code: Select all

button:
	action FileAction(slot)
use

Code: Select all

button:
	if renpy.current_screen().screen_name[0] == "load":
		action FileLoad(slot)
	else:
		action FileSave(slot, confirm=False)
You can pass the confirm argument to FileAction if you want but that also disables the load confirm message.

tv-ghost
Newbie
Posts: 11
Joined: Mon Jul 23, 2018 3:47 am
Contact:

Re: "Are you sure you want to overwrite your save?" Window Disabling

#4 Post by tv-ghost »

MaydohMaydoh wrote: Sun Jul 29, 2018 4:44 am Only way I can see how to do it is to change the file slots screen and change the button action to FileLoad and FileSave instead of FileAction.
So instead of

Code: Select all

button:
	action FileAction(slot)
use

Code: Select all

button:
	if renpy.current_screen().screen_name[0] == "load":
		action FileLoad(slot)
	else:
		action FileSave(slot, confirm=False)
You can pass the confirm argument to FileAction if you want but that also disables the load confirm message.
Alternative method of using a confirm argument for FileAction works fine. For the first one, however, I get this error message:
screens.rpy, line 654: Tab characters are not allowed in Ren'Py scripts.


EDIT: tried it again, and a different error pops up. File "game/screens.rpy", line 664: The has statement may not be given after a child has been supplied.
has-> vbox
Last edited by tv-ghost on Sun Jul 29, 2018 5:26 am, edited 1 time in total.

tv-ghost
Newbie
Posts: 11
Joined: Mon Jul 23, 2018 3:47 am
Contact:

Re: "Are you sure you want to overwrite your save?" Window Disabling

#5 Post by tv-ghost »

Per K Grok wrote: Sun Jul 29, 2018 1:26 am From what I can see 'gui.overwrite_save' just holds the string that is shown.

What you want to do is to set 'confirm' to 'False' for this action. I don't know if there is anything like

overwrite_save.confirm = False

but that would be the sort of thing you would need.

Sorry I don't have anything more concrete to give on this subject.
Exactly my first instinct, and I've tried variations of that same type of command line, both for gui.rpy and screens.rpy, but I got no successful results.

User avatar
MaydohMaydoh
Regular
Posts: 165
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: "Are you sure you want to overwrite your save?" Window Disabling

#6 Post by MaydohMaydoh »

Oh sorry, the tab error is because I used tab while typing it out here instead of using space. To used to having tab converted to spaces.
As for the second error, try moving the statement to the bottom of the button, after the has statement.
I never use the has statement so I'm not entirely sure but the documentation says "Keyword arguments to the parent displayable are not allowed after the has statement."

User avatar
MaydohMaydoh
Regular
Posts: 165
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: "Are you sure you want to overwrite your save?" Window Disabling

#7 Post by MaydohMaydoh »

Alternatively if you can't get it to work, I guess you could remake the FileAction function and put it where ever you define your python statements rather than editing the main renpy files.

Code: Select all

def FileAction(name, page=None, **kwargs):
      if renpy.current_screen().screen_name[0] == "load":
            return FileLoad(name, page=page, **kwargs)
      else:
            return FileSave(name, confirm=False, page=page, **kwargs)

Post Reply

Who is online

Users browsing this forum: Kocker