UltimateSonic Posted August 21, 2006 Report Share Posted August 21, 2006 Hi I was wondering how I can change this expression to how it would save to a seperate folder in the Applications directory in MMF: Appdir$ + "SaveFile" + Str$( File Number ) + ".sav" I'm trying to save the array of my game into a seperate folder, in the applications directory. Can anone show me how to do this? Thanks Link to comment Share on other sites More sharing options...
LarkSS Posted August 21, 2006 Report Share Posted August 21, 2006 Here's what you should be doing instead: ".\SaveFile" + Str$( Value( "File Number" ) ) + ".sav" By adding '.\', you're saying to use the directory of the application. It does the same as what you put. Now here's something you could do to access a subfolder in the application directory: ".\Saves\File" + Str$( Value( "File Number" ) ) + ".sav" As you can see, I simply put the name of the folder and added a '\' to seperate the file name. Make sure the slash is in that direction. Also, you can continue to list the names of folders to access a file in a sub-subdirectory and stuff like that. Link to comment Share on other sites More sharing options...
UltimateSonic Posted August 22, 2006 Author Report Share Posted August 22, 2006 Hmmm... when I put that in I get a syntax error... Appdir$ + "SaveFile" + Str$( File Number ) + ".sav" Creates a file named SaveFile.sav in the game's directory. Link to comment Share on other sites More sharing options...
LarkSS Posted August 23, 2006 Report Share Posted August 23, 2006 Try this? Appdrive$ + Appdir$ + "Savings\SaveFile" + Str$( File Number ) + ".sav" Make sure a folder called 'Savings' is made in the game's directory. Also, I included 'Appdrive$' since you want to make sure it's saved in the correct drive. Link to comment Share on other sites More sharing options...
UltimateSonic Posted August 23, 2006 Author Report Share Posted August 23, 2006 Strange... now it isn't saving at all.... Link to comment Share on other sites More sharing options...
LarkSS Posted August 23, 2006 Report Share Posted August 23, 2006 o.o I don't see why not. That always works for me... Link to comment Share on other sites More sharing options...
UltimateSonic Posted August 24, 2006 Author Report Share Posted August 24, 2006 Hmmm... yup, no luck Link to comment Share on other sites More sharing options...
FredrikTheEvil Posted August 24, 2006 Report Share Posted August 24, 2006 Create a text object, and set the alterable string to check what it says. You may need to add a slash or so. I'm not sure, I dont know how MMF handles it, but often, like in the GNU C library, getcwd returns the path without the last slash appended. So as a example, the above would result in: C:\GamedirSavings\Savefile000.sav Link to comment Share on other sites More sharing options...
Andrew Posted August 25, 2006 Report Share Posted August 25, 2006 Yeah, I've found it's always safer to add two slashes rather than hope it works and create lots of needless files because C:\Savedir\\Savefile.sav and C:\Savedir\Savefile.sav are the same in Windows. Link to comment Share on other sites More sharing options...
Recommended Posts