Finally and at last, I have taken my Savegames with screenshots tutorial and made it into a super-duper OO module.
as used in the AGS-Award-winning games Prodigal and Stargate Adventure
Download here (http://ssh.me.uk/modules/ScreenshotsSaveLoad.zip) (Requires AGS v2.71!)
The old zip file (http://ssh.me.uk/modules/ScreenshotsSaveLoad_old.zip) contains a game template which is basically the default game with the screenshots stuff added. The new zip file contains just the modules and GUIs necessary to add the GUI to an existing game:
There are actually two GUE/SCM (Individual GUI import file and Script module file) pairs. The first is YesNo, which is just a quick dialog to allow the question "Do you wish to overwrite this save game" to be asked with an OK and Cancel button. The YesNo module actually allows any Question to be asked here, by changing the GUI label.
The main one is the Saveload GUI and script module. The module must be listed after YesNo in the module list, as it uses it. Full instructions can be found in the README or in the top of the Saveload module's script header.
This module and GUI are released under the LGPL.
I got Darth to update the tutorial on his site to have a link to this thread, so that people pick up this instead of the old version there, which doesn't work with AGS 2.7.
Download site updated 29/03/06 due to Iqu's server dying
Thank you SSH! This was excellent!
You really made my day.
Good work, SSH :)
I imported the modules in the right order and also imported the guis. When i want to test my game I get this error:
Quote
'In: savegames with screenshots"
error (line 80): local variable cannot have the same name as an import
static function sgs_i::reget_slots()
{
int i=0;
Label *li; //line 80
string temp;
How can i fix this?
Edit:
Thanks, I really had a variable called "li", but now it works perfectly.
Hmm, interesting. This sort of name collision could happen if you had your own module listed before "Savegames with screenshots" one and which exports a "li" variable. Change its name to something else.
Great work with the module :)
Hi
As I released my new game, Stargate Adventure, some people reported back that they have problems with saving games (and loading too) - custom savegame module with pictures from SSH, and it gives them an error:
Quote
(ACI version 2.70.864)
Error: run_text_script1: error -6 running function 'goSaveLoadOK_Click':
Error: Error retrieving pointer: invalid handle 586
in Savegames with screenshots (line 89)
from Savegames with screenshots (line 105)
from Savegames with screenshots (line 116)
from Savegames with screenshots (line 243)
from Global script (line 3142)
It's not always the same error though. ???
--------------------------
And while reporting errors :) here is another one, but it is different:
Quote
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x05C8849E ; program pointer is +1004, ACI version 2.70.864, gtags (1361,332)
(...)
in Room 1 script (line 13)
As I checked script line 13 says PlayVideo("Intro.avi"), so ist it something wrong with media player or something?
Only one user reported this one.
The "offending" line the savegames module is:
sgs_dspr[i] = DynamicSprite.CreateFromSaveGame(i+sgi.offset, sgi.ss_width, sgi.ss_height);
which looks to me like it must be an AGS error
Has anyone else managed to produce an error like this?
("Error retrieving pointer: invalid handle XXX")
I'm trying to follow the stack trace but it doesn't make sense -- I presume you're using an older version of the module?
SSH, have you ever had this error while using or testing your module?
It must be some sort of AGS bug because a scripting error shouldn't be able to generate an error like this.
Finally, can you supply more details? Does the error happen when it's trying to display the save game window, or when it actually does a save/load? Or some other time completely?
Yes, the latest download has been upgraded to use the new Strings, and the dialog says 2.70 so he must be using an older one. I'm not sure if I have the old module, still. Maybe Rui has the old version on his resource site?
I look at the module, it says version 0.1
Maybe I should update.!
Well, upload the module that you used, first, so we can work out why AGS crashed!
Another error:
Quote
(ACI version 2.70.864)
Error: run_text_script1: error -6 running function 'goSaveLoadCancel_Click':
Error: Error retrieving pointer: invalid handle 583
in Savegames with screenshots (line 89)
from Global script (line 3149)
Here is your old module: http://www.golden-tomb.org/sector/oldsavegamescr.ZIP
As mentioned before, I think this issue is with AGS rather than the module, and thus you'll have to upgrade to get the fix anyway ...
Ok, thankx. Well a lot of peoples did not experiance any error while saving/loading, neither did I, while testing the game, so could it be Windows 98 or XP (sp,sp2) related !??
I haven't managed to crash it yet either.
Is there any pattern to it? Did the problem happen when saving, or when loading, or both? Was it just after they started the game, or did it just happen randomly after they'd been playing for a while?
As far as i know, one had problems while saving and the loading, but next time worked fine. I dont know what they did in the save/load menu, could it be that the SAVE name was typed with unknown letters (like German "U"...) ? I know that if I use one of my slovenian letter whole text moves 1 line lower..
Can you try this with 2.71 RC 4 and see if it helps at all?
All I can say is that your Module made game development rewarding and fun.
May God bless you and increase your knowledge for the good of your fellow man.
Amen.
Im having trouble establishing the maximum slot number for the savegames.
I've tried defining it by using:
#define SGS_MAX_SLOT
but i get that it's already defined, i cant seem to find it in the script. How do i go about changing the number of slots?
It's in the script header
Quote from: Pumaman on Wed 23/11/2005 23:35:38
Can you try this with 2.71 RC 4 and see if it helps at all?
So did this version actually fix the problem?
The changelog of AGS v2.71 RC 4 says
* Fixed Restore Game occasionally corrupting the managed object pool.
but I want to make sure it's related to this problem before I delete the bug reports.
SSH -
Okay... trying to get this to work with AGS Ver 3.2.1 and it won't import any of the GUI files. I did a search and this seemed to be the most current "Save Game Module" I *assume* I could manually create the GUI's but a little help would be greatly appreciated.
- Cogliostro
Try downloading an older version of AGS, then import the GUI files, run the project with the new AGS and export GUI files. It's a bit complicated, but it should work. ;)