Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How to delete a (save)file?

You should use the Dir library. I could explain how in more details, but i´m tired to do so, and need to test what i´m thinking on doing ^^

EDIT: Misconception! You may use File.delete(<filename>) to delete any file, just be sure to check if the file exists with FileTest.exist?(<filename>) before trying to delete.
 
Probably the best way if you want compatability...

Code:
filename = Scene_File.new('').make_filename(file_index)

If you aren't using many scripts, you can just use

Code:
filename = "Save#{file_index + 1}.rxdata"

From there, add
Code:
File.delete(filename)

That should do the trick.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top