Deleting a save data

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
Keinart
Regular
Posts: 133
Joined: Sun May 13, 2012 8:28 pm
Completed: One Thousand Lies
Projects: Lotus Reverie
Organization: Keinart Lobre
Tumblr: keinart
itch: keinart
Location: Spain
Contact:

Deleting a save data

#1 Post by Keinart » Wed Jan 22, 2014 1:37 am

This should be pretty easy but for some reason I can't find a way

1. I can't delete a save data, I've read that pressing delete over a save slot should be enough for that but it doesn't seem to work for me. I can't really figure how to do it. It also happens for the "toggle music" when pressing "m". It doesn't work at all.

2. I would like to know how to add into my save menu a small delete save slot button. I've already read about the renpy.unlink_save(filename) function but I don't really know how to implement that into a imagemap.

I know it's not really neccesary to delete saves since you can just overwrite, but it should help if you wanna keep it tidy.

Thank you :o

DeletedUser160413

Re: Deleting a save data

#2 Post by DeletedUser160413 » Wed Jan 22, 2014 2:00 am

following this post because I'd like to know too :)

User avatar
Haze
Veteran
Posts: 277
Joined: Sun Sep 30, 2012 4:24 pm
Completed: Monster Uses CPU 2, White Fog, Times Like These, bond
Projects: Secret long term project!
Soundcloud: The_Storysinger
Contact:

Re: Deleting a save data

#3 Post by Haze » Fri Jan 24, 2014 10:12 am

1. To make pressing "delete" on the keyboard delete a save file, put this under screen load_save_slot in your screens.rpy:

Code: Select all

key "save_delete" action FileDelete(number)
I'm not sure about the music part, but you'll probably have to make a keymap to have m toggle the music

2. If you wanted to have a button on the save slots delete a file using imagemaps, maybe

Code: Select all

hotspot (#,#,#,#) clicked FileDelete(number)
would work, if you put this for each save slot, replacing "#" with your hotspot coordinates and "number" with the save slot numbers. Haven't tested this out, though.
My first completed visual novel, which is at 1.3, it's final version(woo hoo!): Monster Uses CPU 2
Finally at version 1.0: White Fog
Image

Image

I make one song every week, all for free download! This weeks song: Synthis- The Mirror(Eliana Remix)[Preview]

You might ask yourself: If I could only save one paragraph of the work I'm writing, which one would I save?
Which one would I let go first?

-from Understanding Rhetoric: A Graphic Guide to Writing by Elizabeth Losh, Johnathan Alexander, Kevin Cannon, and Zander Cannon

User avatar
Keinart
Regular
Posts: 133
Joined: Sun May 13, 2012 8:28 pm
Completed: One Thousand Lies
Projects: Lotus Reverie
Organization: Keinart Lobre
Tumblr: keinart
itch: keinart
Location: Spain
Contact:

Re: Deleting a save data

#4 Post by Keinart » Fri Jan 24, 2014 4:42 pm

It works perfectly. I really really really really thank you Haze, it couldn't work better.

The only thing I'm still missing is the key to toggle the music, I tried I couple of things but nothing yet, although I think I may be close to something. It's not a priority for me right now so I'll leave it for later.

Thank you again.

Crazy Li
Regular
Posts: 113
Joined: Fri Jan 03, 2014 3:35 pm
Contact:

Re: Deleting a save data

#5 Post by Crazy Li » Fri Jan 24, 2014 5:48 pm

Keinart wrote:It works perfectly. I really really really really thank you Haze, it couldn't work better.

The only thing I'm still missing is the key to toggle the music, I tried I couple of things but nothing yet, although I think I may be close to something. It's not a priority for me right now so I'll leave it for later.

Thank you again.
Is your Ren'py the latest version? It's possible that the toggle key didn't exist in older versions. I know 'm' does nothing in my version (6.13). Though oddly enough, the delete key still worked fine without any need for additional code.

User avatar
Keinart
Regular
Posts: 133
Joined: Sun May 13, 2012 8:28 pm
Completed: One Thousand Lies
Projects: Lotus Reverie
Organization: Keinart Lobre
Tumblr: keinart
itch: keinart
Location: Spain
Contact:

Re: Deleting a save data

#6 Post by Keinart » Fri Jan 24, 2014 6:32 pm

Crazy Li wrote:Is your Ren'py the latest version? It's possible that the toggle key didn't exist in older versions. I know 'm' does nothing in my version (6.13). Though oddly enough, the delete key still worked fine without any need for additional code.
Yes, it is the latest (6.14). Maybe something was changed from there to now and that's why it needs the extra code :?

Crazy Li
Regular
Posts: 113
Joined: Fri Jan 03, 2014 3:35 pm
Contact:

Re: Deleting a save data

#7 Post by Crazy Li » Fri Jan 24, 2014 6:59 pm

Keinart wrote:
Crazy Li wrote:Is your Ren'py the latest version? It's possible that the toggle key didn't exist in older versions. I know 'm' does nothing in my version (6.13). Though oddly enough, the delete key still worked fine without any need for additional code.
Yes, it is the latest (6.14). Maybe something was changed from there to now and that's why it needs the extra code :?
6.14 is NOT the latest.

User avatar
Keinart
Regular
Posts: 133
Joined: Sun May 13, 2012 8:28 pm
Completed: One Thousand Lies
Projects: Lotus Reverie
Organization: Keinart Lobre
Tumblr: keinart
itch: keinart
Location: Spain
Contact:

Re: Deleting a save data

#8 Post by Keinart » Fri Jan 24, 2014 11:56 pm

Crazy Li wrote:
Keinart wrote:
Crazy Li wrote:Is your Ren'py the latest version? It's possible that the toggle key didn't exist in older versions. I know 'm' does nothing in my version (6.13). Though oddly enough, the delete key still worked fine without any need for additional code.
Yes, it is the latest (6.14). Maybe something was changed from there to now and that's why it needs the extra code :?
6.14 is NOT the latest.
Sorry 6.16, I just said it withouth thinking. But yeah I updated it recently

Post Reply

Who is online

Users browsing this forum: Google [Bot]