Delete Save File Automatically

● ARCHIVED · READ-ONLY
Started by Mehrab 5 posts View original ↗
  1. Hey guys, so I am building a game that uses a check point system, and I need a way to delete all the save files automatically if the player starts a new game.
  2. The script call to delete a single save file:
    Code:
    StorageManager.remove(index);

    A simple script call where it loops to delete 20 save files:
    Code:
    var i;
    for (i = 0; i < 20; i++) {
    StorageManager.remove(i);
    }

    I'm can't check if there's another way to do this but this is the easiest one I can think of at the top of my head.

    You can also try adding this to StoreManager:
    Code:
    StorageManager.removeAllStorage = function() {
        for (var i = 0; i < 20; i++) {
            this.remove(i);
        }
    };

    and script call will be:
    Code:
    StorageManager.removeAllStorage();
  3. Thanks alot guys, that solved my problem
  4. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.