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,513
Reaction score
3,202
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,513
Reaction score
3,202
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,513
Reaction score
3,202
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
40,098
Reaction score
13,704
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

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top