Delete save files on event?

Hey!
I want the players save files to get deleted upon a universe-restarting event. Any easy ways to do this?

Thanks!
Try this:
JavaScript:
for (let id = DataManager.maxSavefiles(); id >= 0; id--) {
  StorageManager.remove(DataManager.makeSavename(id));
}
DataManager.removeInvalidGlobalInfo();

Edit - made several corrections:
  • Typo: it should be makeSavename, not makeSaveName;
  • Changed loop condition to include save ID 0 (autosave);
  • Added removeInvalidGlobalInfo call to remove this session's deleted save records.
Try this:
JavaScript:
for (let id = DataManager.maxSavefiles(); id > 0; id--) {
  StorageManager.remove(DataManager.makeSaveName(id));
}
Sorry for the late reply, im gonna be honest i was too stressed to remember i posted this. Back on track now, if i did this correctly i made a script thingy inside the event where it happens and pasted it in, and now when it happens it just says "Datamanager.makeSaveName" is not a function
did i do something wrong?
This is in the pinned script call reference up top.
https://forums.rpgmakerweb.com/index.php?threads/rpg-maker-mv-mz-script-call-list.46456/
A simple script call where it loops to delete 20 save files:

var i;
for (i = 0; i < 20; i++) {
StorageManager.remove(i);
}
Whoops, sorry! It should be makeSavename, not makeSaveName. I corrected my earlier post and made a couple of other changes.

The script call @NaosoX suggested is for RPG Maker MV, in case that helps~
Whoops, sorry! It should be makeSavename, not makeSaveName. I corrected my earlier post and made a couple of other changes.

The script call @NaosoX suggested is for RPG Maker MV, in case that helps~
thanks, that worked! it didnt delete the autosave though
it didnt delete the autosave though
I'm guessing you only replaced the typo and didn't actually check my edit:
JavaScript:
for (let id = DataManager.maxSavefiles(); id >= 0; id--) {
  StorageManager.remove(DataManager.makeSavename(id));
}
DataManager.removeInvalidGlobalInfo();
I'm guessing you only replaced the typo and didn't actually check my edit:
works perfectly, thank you so much 😀

Original thread: https://forums.rpgmakerweb.com/threads/delete-save-files-on-event.140900/