Game's Save File Location

Status
Not open for further replies.

Kuro Neko

Veteran
Veteran
Joined
Sep 26, 2013
Messages
173
Reaction score
15
First Language
English
Primarily Uses
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.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,477
Reaction score
3,077
First Language
Binary
Primarily Uses
RMMZ
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.
 

Kuro Neko

Veteran
Veteran
Joined
Sep 26, 2013
Messages
173
Reaction score
15
First Language
English
Primarily Uses
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?
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,477
Reaction score
3,077
First Language
Binary
Primarily Uses
RMMZ
probably best to put it into the module and have it run as soon as the game runs.
 

Kuro Neko

Veteran
Veteran
Joined
Sep 26, 2013
Messages
173
Reaction score
15
First Language
English
Primarily Uses
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
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,477
Reaction score
3,077
First Language
Binary
Primarily Uses
RMMZ
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
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,969
Reaction score
13,603
First Language
English
Primarily Uses
RMMV
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.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

A new VA has joined the "Beyond the Mirror" team... I can't wait to start working on battle voices in the engine now.
Well bad reviews r making me rather annoyed today.
Ami
--- F.Mage Cooking Part 2 ---

F.Knight: Chef isn't here at this moment,he goes back into his Hometown to celebrating the Halloween with them.
F.Fighter: That too bad. I can't taste his dish until 3-5 days.
F.Mage: Then Leave it to me,i can make a Special Dishes for our Team in Halloween! (Rushes Into The Kitchen)
F.Knight & F.Fighter: (Screaming) YAMEROOO!!!
Stream will be live shortly with a session of the Interactive Text Adventure! Feel free to drop by!
aero the acrobat 2 on sega had some absolute bangers on the ost... why Meeting Dr. Dis was just for a cutscene and not a boss makes me sad lol

Forum statistics

Threads
104,627
Messages
1,007,678
Members
136,108
Latest member
dandeli
Top