Delete Save Game while in game

Discussion in 'RGSS2 Script Requests' started by Project CROSS, Dec 6, 2014.

  1. Project CROSS

    Project CROSS RGSS2 User Veteran

    Messages:
    202
    Likes Received:
    152
    Location:
    Potato Land
    First Language:
    English
    Primarily Uses:
    RMVX
    This is what I wanna happen.....

    1.) I'll call a "script" with the use of event

    2.) Forces the game to delete all existing save data.

    3.) Hahahaha!  BD

    Nier spoiler down here:

    -MORE LIKE "Nier; Gestalt" 4th ending, Sacrifice-

    Seriously, I need a script like this. To be more specific, the script is for RGSS2.
     
    Last edited by a moderator: Dec 14, 2014
    #1
    Marsigne and EternalShadow like this.
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,579
    Likes Received:
    11,296
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Way to make someone delete your game ;)
     
    #2
    Project CROSS, Zeriab, Susan and 2 others like this.
  3. Zarby

    Zarby Veteran Veteran

    Messages:
    42
    Likes Received:
    25
    Location:
    Quebec, Canada
    First Language:
    French
    for i in 1..4


    if FileTest.exist?("Save"+i.to_s+".rvdata")


    File.delete("Save"+i.to_s+".rvdata")


    end


    end
     
    #3
    Project CROSS likes this.
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,579
    Likes Received:
    11,296
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    That would delete ALL save files. Not just the "save data" for the current game. And what if the current game was in save file 10?
     
    Last edited by a moderator: Dec 11, 2014
    #4
  5. Zarby

    Zarby Veteran Veteran

    Messages:
    42
    Likes Received:
    25
    Location:
    Quebec, Canada
    First Language:
    French
    Rpg Maker VX have only 4 save slot no ? i'm using vx ace so i don't really remember but it what i saw

    just return to titlescreen after calling that script you are forced to start a new game

    else if it was only for the current game just need to clear just start a new game over the one already existing and it gonna set everything back to default

    just use the script in the titlescreen create_game_objects

    $game_temp = Game_Temp.new$game_message = Game_Message.new$game_system = Game_System.new$game_switches = Game_Switches.new$game_variables = Game_Variables.new$game_self_switches = Game_SelfSwitches.new$game_actors = Game_Actors.new$game_party = Game_Party.new$game_troop = Game_Troop.new$game_party.setup_starting_members()just call it from event and it should erase everything (except map) and it put back initial party members in the party
     
    #5
    Project CROSS likes this.
  6. Shaz

    Shaz Veteran Veteran

    Messages:
    37,579
    Likes Received:
    11,296
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    It may only have 4 (I don't have it with me now), but if that's the case, there would have very quickly been scripts written to overcome that limitation.
     
    #6
    Project CROSS likes this.
  7. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    11,905
    Likes Received:
    12,025
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    I think 16's the default, it only shows 4 on the screen at a time though.
     
    #7
  8. Project CROSS

    Project CROSS RGSS2 User Veteran

    Messages:
    202
    Likes Received:
    152
    Location:
    Potato Land
    First Language:
    English
    Primarily Uses:
    RMVX
    I have more than 30 save slots with the help of Neo Save System VI by Wortana.
    I want all existing save data to be deleted when I call the script.  ;)
     
    #8
  9. Project CROSS

    Project CROSS RGSS2 User Veteran

    Messages:
    202
    Likes Received:
    152
    Location:
    Potato Land
    First Language:
    English
    Primarily Uses:
    RMVX
    Doesn't work, it just resets the game's variables. The save files are still there.

    This is more like NEW GAME script call.
     
    #9
  10. Zarby

    Zarby Veteran Veteran

    Messages:
    42
    Likes Received:
    25
    Location:
    Quebec, Canada
    First Language:
    French
    for i in 1..30 if FileTest.exist?("Save"+i.to_s+".rvdata") File.delete("Save"+i.to_s+".rvdata") endendthis sould work if you don't have changed the config "SAVE_FILE_NAME" or "SAVE_PATH" of Neo Save Script
     
    #10
  11. Milena

    Milena The woman of many questions Veteran

    Messages:
    1,282
    Likes Received:
    106
    Location:
    Ireland
    First Language:
    Irish
    Primarily Uses:
    N/A
    class Game_Interpreter def delete_saved_game for i in 1..30 if FileTest.exist?("Save"+i.to_s+".rvdata") File.delete("Save"+i.to_s+".rvdata") end end endendscript call:

    Code:
    delete_saved_game
     
    #11
  12. cremnophobia

    cremnophobia Veteran Veteran

    Messages:
    194
    Likes Received:
    80
    Dir.[] or Dir.glob can be called to get a list of filenames:

    Code:
    Dir['Save*.rvdata'].each { |f| File.delete(f) }
     
    #12

Share This Page