Game's Save File Location

● ARCHIVED · READ-ONLY
Started by Kuro Neko 7 posts View original ↗
  1. The default game save is: Game's Name/savexx.rvdata2. I want to change the save location to: Game's Name/Save/savexx.rvdata2. So, i've changed this part in game's script: DataManager

    #-------------------------------------------------------------------------- # * Determine Existence of Save File #-------------------------------------------------------------------------- def self.save_file_exists? !Dir.glob('Save*.rvdata2').empty? end #-------------------------------------------------------------------------- # * Maximum Number of Save Files #-------------------------------------------------------------------------- def self.savefile_max return 16 end #-------------------------------------------------------------------------- # * Create Filename # index : File Index #-------------------------------------------------------------------------- def self.make_filename(index) sprintf("Save%02d.rvdata2", index + 1) endTo this:

    #-------------------------------------------------------------------------- # * Determine Existence of Save File #-------------------------------------------------------------------------- def self.save_file_exists? !Dir.glob('Save/Save*.rvdata2').empty? end #-------------------------------------------------------------------------- # * Maximum Number of Save Files #-------------------------------------------------------------------------- def self.savefile_max return 16 end #-------------------------------------------------------------------------- # * Create Filename # index : File Index #-------------------------------------------------------------------------- def self.make_filename(index) sprintf("Save/Save%02d.rvdata2", index + 1) endAnd, it's work, the save will be located in Save folder instead of right in the game's folder. But, the problem is, i've to create a save folder before, so the game will be saved in that save folder. If there isn't any save folder, the game won't be saved. All i want is, the game will check either there is a game folder or not and if not, create one and save in that.
  2. FOLDER_NAME = "NAME"Dir.mkdir(FOLDER_NAME) unless Dir.exist?(FOLDER_NAME)
    Not at my comp right now so this may not be 100% accurate. Its something like that though.
  3. Dekita said:
    FOLDER_NAME = "NAME"Dir.mkdir(FOLDER_NAME) unless Dir.exist?(FOLDER_NAME)Not at my comp right now so this may not be 100% accurate. Its something like that though.
    Oh, Dekita :D

    Where should i put that line?
  4. probably best to put it into the module and have it run as soon as the game runs.
  5. Dekita said:
    probably best to put it into the module and have it run as soon as the game runs.
    Oh, it's work. Thank you :D

    You know, you like a hero appeared everytime i need LOL :D
  6. ahh good, it worked.

    I feared that the syntax may have been

    Dir.mk_dir(FOLDER_NAME)(with an underscore ' _ ')

    Havent used the Dir class since I done my own save data script :p
  7. 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.