Quote from: SSH on Tue 20/09/2005 10:44:42
A savegame with screenshots module/GUE that has a list of game titles and a single screenshot displayed, rather than my one that shows multiple screenshots at a time
Well since my game uses one of those, I decided to convert it into a module. I had a look at the guidelines for modules and tried to follow what I understood, hope I didn't do anything wrong. Instructions and more detailed info included inside.
(http://i6.photobucket.com/albums/y237/supsuper/AGS/saveslist.png)
v2.0 (
Only for AGS v3.0 and later)
- New version for AGS v3.0
Download here (http://supsuper.wurmz.net/stuff/savelist20.zip)
v1.2 (
Only for AGS v2.72 and earlier)
- Added support for AGS v2.72 (v2.71 should still work)
Download here (http://supsuper.wurmz.net/stuff/savelist12.zip)
v1.11- Now you can also show/hide the GUI by changing the gSavelist.Visible, though I don't condone this :P
Download here (http://www.2dadventure.com/ags/savelist111.zip)
Mirror (http://www.rudolphuebe.com/ags/MODULE%20Saves%20List%20with%20Screens%20GUI%20v1.11.zip) (Thanks Candle!)
v1.1- Now you can overwrite existing saved games by selecting them
- The game now checks for the 20-savegame-limit
- No more problems with forgetting to turn on "Save screenshots in savegames"
Download here (http://www.freefileupload.net/file.php?file=files/200706/1153353744/savelist11.zip)
v1.0Download here (http://www.freefileupload.net/file.php?file=files/250506/1148597065/savelist.zip)
Mirror (http://www.2dadventure.com/ags/savelist100.zip) (Thanks Neole!)
Sounds great, I'll add it to my site tomorrow.
Well done, other-super-person ;)
I don't know if I'm doing something wrong here...I plugged in the module and GUI, changed key and top menu responses to SaveList.Show();, they work beautifully except when I attempt to select a game off the saved list. Then I get the following error:
Error: run_text_script1: error -6 running function "lstGames_Selection_Changed":
Error: Null pointer referenced
in Saves List with Screens GUI (line 72)
from Global script (line 158)
Line 158 is just:
#sectionstart lstGames_SelectionChanged // DO NOT EDIT OR REMOVE THIS LINE
function lstGames_SelectionChanged(GUIControl *control) {
SaveList.Select(); // This line is 158
}
#sectionend lstGames_SelectionChanged // DO NOT EDIT OR REMOVE THIS LINE
Did I screw something up? :)
Did you turn on "Save screenshots in save games" in the game's General Settings?
*smacks palm into face*
I can't believe I'd even forget that... :) No, I didn't, and I'll be trying it just as soon as I get home. I'll let you know how it turns out, and try to get the egg off my face now. :)
EDIT: Ha! Yep, that did the trick. It works fine now, thanks a bunch! :)
Mayeb the module should turn this on in its game_start function?
Quote from: SSH on Wed 12/07/2006 14:04:23
Mayeb the module should turn this on in its game_start function?
Umm, I don't know how to do that.
Ok, new version. This one should display an error if you try to exceed the savegame limit, and it also allows you to overwrite existing games by selecting them (you'll create a new savegame if none are selected). To unselect, just close and reopen the dialog.
Quote from: SupSuper on Wed 19/07/2006 16:35:56Umm, I don't know how to do that.
Check out the SetGameOption function (http://www.adventuregamestudio.co.uk/manual/SetGameOption.htm).
i am using the newest version of ags and i imported the module and the gui and wanted to test it but if i click on the "save" or "cancel" button i get these errors:
QuoteAn internal error has occured. Please not down the following information.
If the problem persists, contact Chris Jones.
(ACI version 2.72.920)
Error: run_text_script1: error -6 running function 'btnSave_Click':
Error: Null pointer referenced
in Saves List with Screens GUI (line 74)
from Save List with Screens GUI (line 100)
from Global script (line 168)
QuoteAn internal error has occured. Please not down the following information.
If the problem persists, contact Chris Jones.
(ACI version 2.72.920)
Error: run_text_script1: error -6 running function 'btnCancel_Click':
Error: Null pointer referenced
in Saves List with Screens GUI (line 74)
from Global script (line 176)
screenie.Delete(); (line 74)
SaveList.Hide(); (line 100)
SaveList.Save(); (line 168)
SaveList.Hide(); (line 176)
Actually all i did was to import the module. when i hit the "save" or "cancel" button the game immediately crashes so that i can't see whether there is a screenshot or not.
here are the functions:
function btnSave_Click(GUIControl *control, MouseButton button) {
SaveList.Save();
}
function btnCancel_Click(GUIControl *control, MouseButton button) {
SaveList.Hide();
}
I had somewhat the same error... I believe it came from me calling the GUI like
gSaveGui.Visible = true;
When I changed that to SaveList.Show() it worked correctly...
I also double clicked each button to make sure the script was there... that fixed any sort of problems...
so try both of those and see if it fixes it for you.
i called the GUI with gSaveGui.Visible = true; too and SaveList.Show() did the trick. :D
works for me now. thanks!
Perhaps SupSuper coudl add to the module:
bool guistatus;
function repeatedly_execute() {
if (gSaveGui.Visible && !guistatus) {
// Do whatever extra stuff Savelist.Show does, or maybe just call it
}
guistatus=gSaveGui.Visible ;
}
So that either way works...?
So you're telling me I went to the trouble of writing instructions so in the end I have to do more work for people that don't read them? ::)
Anyways, I don't really understand how the above would work. Wouldn't it keep running said function while the GUI is/isn't visible?
No...it wouldn't keep running.
That's why he put the bool "guistatus" in there.
The first loop that gSaveGui is visible, guistatus is set to false (it is initialized to false (0)), so the function would be run. After that, guistatus is set to true because gSaveGui.Visible still equals true. When the user turns gSaveGui off (gSaveGui.Visible = false) then the function won't be run, and guistatus will be set to false.
Well that still creates another problem. See, if you bring up the GUI "manually", you'll end up with the GUI splattered over the screenshot, since everything else has to be done AFTERwards.
The built-in Show() function does all that BEFORE showing the GUI, to prevent this problem.
So you'll just have to learn to read the instructions. :P
Maybe the special code coudl turn the GUI off again, wait 1 cycle for the screen to update, then call Show() :P
The customer is always right!
You could just put:
if (gSaveGui.Visible && !guistatus) {
gSaveGui.Visible = false;
SaveList.Show();
}
That would solve the problem.
[EDIT:]
SHUT UP SSH! I WAS POSTING FIRST!
:= :D Just kidding. ;) You beat me fair and square. :)
Oh come on people, I like being lazy, let me live my dream. :'(
Fine fine, it's done, though at the price of a 1-gameloop-delay. If something bad comes out of this, I'll blame you guys. :P
Oh, and I couldn't change the version in the module info because I screwed up and ended up locking myself out of it.
Quote from: SupSuper on Wed 02/08/2006 17:27:11Oh, and I couldn't change the version in the module info because I screwed up and ended up locking myself out of it.
You could just create a new module and copy the whole code in there.
Or get a hex editor and hack the protection byte.
Out of curiosity, did you adjust this to account for the 50 samegame limit of 2.72?
Quote from: strazer on Fri 04/08/2006 12:33:04
Quote from: SupSuper on Wed 02/08/2006 17:27:11Oh, and I couldn't change the version in the module info because I screwed up and ended up locking myself out of it.
You could just create a new module and copy the whole code in there.
Haven't you been reading? I'm laaaaaaaaazy. :P
I'll do it next time if I need to change something.
Quote from: Alynn on Fri 04/08/2006 12:55:05
Out of curiosity, did you adjust this to account for the 50 samegame limit of 2.72?
Not really, since it's an AGS 2.71 module. You can just change line 101 in the module:
if (lstGames.ItemCount == 20 && lstGames.SelectedIndex == -1) {
To:
if (lstGames.ItemCount == 50 && lstGames.SelectedIndex == -1) {
Put up two new versions:
v1.2: Updated for AGS 2.72 (and I completely forgot to post back in 2007 :-[)
v2.0: Updated for AGS 3.0
Please do not mix v1.x with v2.x, only use the one for your version of AGS! If you've got an old version, I recommend removing it (script and GUI) before importing the new one to prevent conflicts. (function calls are still the same).
Great, I've been using that module a lot... :D