Hello,
Perhaps I'm being an idiot, but deleting and overwriting save games doesn't seem to work on win 7. I imagine it must be a permissions issue with the windows save game folder. Deleting save games simply does nothing, but overwiting creates a file named this: agssave.-01 (This is the new save game, not the old one.)
I couldn't find if this is a known issue, is there a way around it?
- Al
I'm not really sure about this but did you try to "run as administrator"?
Did your problem get resolved? How did you get it done?
I assumed "Run as Administrator" would fix the problem, but I don't think player should have to run the game as an administrator. Especially since there will be no clear sign this problem exists, it will just look like the game is broken.
It would be particularly annoying if you reached the maximum of 50 save games, because it would become impossible to keep saving after that without running as an administrator or deleting save games, neither of which the player should have to do.
Has any one else had this problem? Can anyone suggest an AGS-side solution?
Try using Game.SetSaveGameDirectory("Saves"); (http://www.adventuregamestudio.co.uk/manual/Game.SetSaveGameDirectory.htm).
That will create a folder called "Saves" in the game's dir and put savegames there. I haven't tested it myself, but hopefully there shouldn't be any restrictions that way.
I will try that, but I'm not sure it's ideal.
If the game happened to be installed in Program Files, wouldn't that folder be protected in the same way? It would also prevent the game from being played on two accounts (not that this is a terribly likely scenario!).
You can only write to the documents and the appdata folder. The program files directory is indeed not writable by an application.
That's what I thought. But if the Save Games folder is protected how do other games overwrite and delete saves?
Which AGS version are you using? I think there were some changes with the early 3.x versions.
Quote from: JJS on Sat 14/07/2012 12:17:12
You can only write to the documents and the appdata folder. The program files directory is indeed not writable by an application.
Hmm, does not AGS 3.0+ writes there by default?
Quote from: cat on Sat 14/07/2012 16:30:35
Which AGS version are you using? I think there were some changes with the early 3.x versions.
Build 3.2.1.111, which I think was the most recent official release. Right?
Check you've got a "Save games folder name" set in the General Settings? I think this is set by default to the name of your game in AGS 3.2, but if you've updated your game from an older version it might be missing?
In Windows Vista and 7 applications aren't allowed to write to the Program Files or Program Files (x86) folders unless they are started with the 'run as administrator' option. Older versions of AGS (2.x and maybe early 3.x?) used to just put save files in whatever folder you ran the game from, but when Windows introduced this feature this became a problem. AGS changed to create a folder in the user's profile (C:\Users\<username>\Saved Games) with subfolders for each game. I'm guessing if you don't specify a folder name, AGS just tries to put the files in the same folder as the .exe, which as you say causes problem when you're running it from Program Files or another protected location.
I changed to a new Save Game folder, just to test. The problem still occurs. I when I try to overwrite agssave.001, it creates a file called agssave.-01 instead.
Is this only happening to me?
Hmm, okay, I assume this is your game? How do you save the game exactly (script-wise)? Unlikely, but could there be anything wrong with it?
Also does it happen on other systems/computers?
I can't reproduce the problem. If I save it creates a new file (C:\Users\<my username>\Saved Games\<my game name>\agssave.001). If I save again it overwrites fine. If I change the file permissions on the agssave.001 file so that I don't have rights to edit the file, AGS crashes out when I try and save.
Are you using the built in save game dialogue SaveGameDialog();
and does it make a difference if you do?
Two more things that comes to mind at the moment:
1) Do you have anything entered in the "Save game file extension" in the general settings (even a space?)
2) If you right-click and choose properties on the game's .exe file is there anything ticked on the Compatibility tab?
You know, I could reproduce this if I save slot number -1... don't know if that's anyway related to your problem.
That has to be it; assuming AGS adds zeros to get three characters, 1 ends up as 001 and -1 as -01.
Ah! That makes sense... it's definitely my script that's at fault.
But I haven't got it working right yet... I may need to ask for more help soon. Thanks for clearing this up for me!
EDIT: I have it working. What confused me was the fact that the save games appeared in reverse order in the save game list, so the numbers didn't correspond with the save slot numbers. I seem to be able to find the right slot by doing: SaveList.ItemCount - SaveList.SelectedIndex.
Thanks for the help, and for putting up with my theories about folder permissions.