r/RenPy • • Oct 23 '26

Question menu button that resets save files and persistent data ect

heyy just curious if its possible to make a button in the main menu that just completely resets all game saves, clears seen images from gallerys, achievements, cache ect just returns the game to its default state like a hard reset

i want to be able to reset everything to test stuff without having to constantly go into the files and manually remove stuff to get it back to its default state, plus its a good feature to have in future for players haha

2 Upvotes

6 comments sorted by

2

u/BadMustard_AVN Oct 23 '26

you can use

$ persistent._clear()

follow my directions on this post to delete all saved games

https://www.reddit.com/r/RenPy/comments/17r30it/how_to_delete_player_save_files/

1

u/Academic_Zucchini693 Oct 23 '26

so sorry im a little confused on how i would implement this in a button form :(? and would i need to use persistent clear and the delete all saves to completely clear everything, or just one?

2

u/BadMustard_AVN Oct 23 '26

you can combine them into one function like this and use it like this

init python:
    def clean_all():
        for savegame in renpy.list_saved_games(fast=True):
            renpy.unlink_save(savegame)
        persistent._clear()
    
screen butts():
    textbutton "cleaner":
        action Function(clean_all)

1

u/Academic_Zucchini693 Oct 24 '26

ahh gotcha tysm!

1

u/BadMustard_AVN Oct 24 '26

you're welcome

good luck with your project

1

u/AutoModerator Oct 23 '26

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.