I'm making a save GUI. I need to know how I can check if a certain agssave-file already exists. For example, let's say I want to check if "agssave.001"-file exists. What kind of scripting should I use for this?
This is because I want to make sure my save GUI doesn't save over any agssave file if it already exists in the compiled folder.
I hope you know what I mean. Thanks. :)
File *thefile = File.Open("agssave.001", eFileRead);
if (thefile == null) {
Display("Error opening file."); // i.e. file probably doesn't exist
}
else {
// do stuff
thefile.Close();
}
Ah yes, I thought it would be done in a similiar way with File.Open. I just didn't know how exactly this could be done, but apparently it's very simple. Thanks for the quick answer.
No prob. :)
Or you could use the even simpler method that the manual suggests:
Quote
GetSaveSlotDescription
(Formerly known as global function GetSaveSlotDescription, which is now obsolete)
static String Game.GetSaveSlotDescription(int slot)
Gets the text description of save game slot SLOT.
If the slot number provided does not exist, returns null.