Game authors and players, please read this thread!

Author Topic: GUI & MODULE: Simple Save & Load 1.0  (Read 4771 times)  Share 

Pablo

  • Connected appelsi
GUI & MODULE: Simple Save & Load 1.0
« on: 28 Dec 2006, 14:06 »
Many AGS developers like the way the default Save and Restore GUIs work. They just dislike the way they look. I know I do. That boring gray color... ugh. ;) And since many find it difficult to make Save and Load GUIs themselves they usually just leave the default GUIs in their games.

So here I present you Simple Save & Load GUIs. They pretty much work exactly the way the AGS default GUIs work. But now you have the chance to change their graphical outfit! I also have added a savegame deleting feature for both GUIs.

Download Simple Save & Load 1.0 here!
Mirror (Thanks Neole!)

Just import all the GUIs and the module into the AGS editor and put the following codes where you want to open the GUIs. (ie. inside on_key_press):
[code]
SaveLoad.OpenSaveGUI();
SaveLoad.OpenRestoreGUI();
[/code]

I think I've gotten rid of all the major bugs, but please report here if you find any. :)
« Last Edit: 15 Feb 2007, 12:55 by strazer »
"God is a man who has one beard and the gostos to agitate poles in dogs" -Rolf
"I'm trying to be as manly as I can when I'm shaving my legs." -Grundislav

Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #1 on: 28 Dec 2006, 19:56 »
Good!
But what about an All-together SAVE-RESTORE-DELETE game dialog??

CMK2901

    • I can help with backgrounds
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #2 on: 31 Dec 2006, 05:56 »
One GUI to do it all!?  WHOA!

It would be pretty easy, though, to copy some buttons and move some code to put everything on one GUI, if that's what you need. 
Science Fiction
Currently writing and developing technology/techniques
Story/Puzzles: 48%
Graphics: 5%
Overall: 5%

Rui 'Trovatore' Pires

  • Lunge da lei per me non v'ha diletto!
    • I can help with AGS tutoring
    •  
    • I can help with play testing
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #3 on: 31 Dec 2006, 10:42 »
One GUI to do it all, indeed. I reccommend anyone interested in THAT to check out Xmas Quest 2 - http://www.bigbluecup.com/games.php?category=101&action=download&game=824.

One GUI to do it all, and absolutely lovely.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pablo

  • Connected appelsi
Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #4 on: 31 Dec 2006, 12:54 »
It's not difficult to make one GUI contain all of the Save and Load stuff. It's just that I wanted this to be exactly like the default AGS interface but modifyable. :)
"God is a man who has one beard and the gostos to agitate poles in dogs" -Rolf
"I'm trying to be as manly as I can when I'm shaving my legs." -Grundislav

Dualnames

  • Local Moderator
  • Dualnames worked on a game that was nominated for an AGS Award!
Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #5 on: 06 Feb 2007, 20:01 »
I made a game called Shoot My Valentine. Well I used your module in it.  Then someone who played the game send me this message:

Unfortunately, I can't restore a game. Also, my single savegame appears several times with the same name in the file selection box. When I restore, the game simply crashes. I should have played through it...

I only did those things:
 changed the background images.
 added those lines at the key press.

I thought you should be aware of this. Check it out and let me know of the solution of this problem.
« Last Edit: 06 Feb 2007, 23:06 by strazer »

Pablo

  • Connected appelsi
Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #6 on: 08 Feb 2007, 15:51 »
As you see from Dualnames' post (thanks for the report!), it's very buggy at the moment so I suggest you not to use it before I update it. I probably should recode the whole thing to remove (hopefully) all the bugs. At the moment the script is pretty confusing.

I promise I'll do it... someday... sooner or later. Probably later. ¬¬
« Last Edit: 15 Feb 2007, 12:53 by strazer »
"God is a man who has one beard and the gostos to agitate poles in dogs" -Rolf
"I'm trying to be as manly as I can when I'm shaving my legs." -Grundislav

Dualnames

  • Local Moderator
  • Dualnames worked on a game that was nominated for an AGS Award!
Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #7 on: 13 Feb 2007, 21:10 »
Well I beta tested my game with your GUI many times loading saving. Well it seems that the guy who had a problem was an exception your GUI works just fine.

Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #8 on: 06 Nov 2007, 01:53 »
Hi I'm having a little bit of a problem when I try to use this module!

The problem is that  when I try testing my game it says there is a script error
and I tried putting the functions on there too and that didn't work either.
Victory is my destiny

Pablo

  • Connected appelsi
Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #9 on: 06 Nov 2007, 13:19 »
Could you elaborate a bit? What kind of a script error? Could you maybe copy+paste the whole error message here. Have you imported all the GUIs and the module too? What exactly did you write in the script file and where? Are you using AGS 2.72? With the little information you've provided so far I can't really solve the problem.
"God is a man who has one beard and the gostos to agitate poles in dogs" -Rolf
"I'm trying to be as manly as I can when I'm shaving my legs." -Grundislav

Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #10 on: 07 Nov 2007, 02:38 »
This is the exact error message I got

Compile error

There was an error compiling your script.
problem was in:`Simple Save & Load'

Error (line 1): Variable `SaveLoad' is already defined

Do you want fix script now?(Your game has not been saved.

The version I'm using is 2.71 Not sure if I imported all GUIs  and I wrote
SaveLoad.OpenRestoreGUI();
SaveLoad.OpenSaveGUI(); in the script. Oh and by the way sorry. It wasn't  a script error it was a compile error. My bad!
« Last Edit: 07 Nov 2007, 02:45 by seraphimdreamer777 »
Victory is my destiny

Pablo

  • Connected appelsi
Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #11 on: 07 Nov 2007, 15:34 »
I need you to be more specific. Where exactly did you write the script commands? Could you paste part of the script here so I can see where you put them. You're supposed to run the OpenRestoreGUI and OpenSaveGUI commands from some main function that controls an action in the game, for example from inside on_key_press.
"God is a man who has one beard and the gostos to agitate poles in dogs" -Rolf
"I'm trying to be as manly as I can when I'm shaving my legs." -Grundislav

Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #12 on: 10 Nov 2007, 19:33 »
Sorry I took so long my computer needed a new operating system so I couldn't access my game for a while but heres part of my script

function SaveLoad.OpenRestoreGUI();
function SaveLoad.OpenSaveGUI();
// Main script for module 'Save & Load'

int exMouse;
export exMouse;

int deletedSave;
export deletedSave;

function game_start() {
  //Remove the following lines if you wish not to center all the GUIs.
  gSave.Centre();
  gRestore.Centre();
  gDeleteconfirm.Centre();
  ////////////////////////////////////////////////////////////////////
}

function repeatedly_execute() {
 
  if (lstRestoreList.ItemCount > lstRestoreList.RowCount) {
    if (lstRestoreList.TopItem ==  0) {
      btnRestoreUp.Visible = false;
      btnRestoreDown.Visible = true;
    }
    else if (lstRestoreList.TopItem == lstRestoreList.ItemCount-lstRestoreList.RowCount) {
      btnRestoreDown.Visible = false;
      btnRestoreUp.Visible = true;
Victory is my destiny

Pablo

  • Connected appelsi
Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #13 on: 10 Nov 2007, 20:12 »
Okay. That's not how you do it. Remove those two lines from the top of the script.

First of all, if you write "function" in the beginning of a line, it means you are declaring a function, which is not what you want to do. I suggest you read about functions and how they work in the manual and also try and learn the basics of how scripting works.

You also don't need to open the module or modify it in any way. What you do need to do is replace every SaveGameDialog-function you may have in your global script with "SaveLoad.OpenSaveGUI();". The same thing with RestoreGameDialog, except of course then you will have to write "SaveLoad.OpenRestoreGUI();".

So for example if your on_key_press looks like this:
[code]
function on_key_press(int keycode) {
  // called when a key is pressed. keycode holds the key's ASCII code
  if (keycode==363) SaveGameDialog();   // F5
  if (keycode==365) RestoreGameDialog();  // F7
}
[/code]

You will want to modify it like this:
[code]
function on_key_press(int keycode) {
  // called when a key is pressed. keycode holds the key's ASCII code
  if (keycode==363) SaveLoad.OpenSaveGUI();   // F5
  if (keycode==365) SaveLoad.OpenRestoreGUI();  // F7
}
[/code]

This will run the functions declared in the Simple Save&Load -module, instead of running the default functions of AGS.

I hope this is clear enough. If you have any further questions, don't hesitate to ask. :)
"God is a man who has one beard and the gostos to agitate poles in dogs" -Rolf
"I'm trying to be as manly as I can when I'm shaving my legs." -Grundislav

Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #14 on: 11 Nov 2007, 00:32 »
Thank you for the help now I have just one more thing to ask ags basicly gave me messages to delete a lot of script of which I already did and I have no problems with my game yet when I test it but did I do the right thing deleting the script it asked me to delete I mean was I soppose to delete what I deleted thanx again for all your help
Victory is my destiny

Pablo

  • Connected appelsi
Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #15 on: 11 Nov 2007, 15:38 »
I'm sorry but I seriously can't understand what you're asking. You're telling me AGS told you to delete some script. Which script? You can't expect me to read your mind.
"God is a man who has one beard and the gostos to agitate poles in dogs" -Rolf
"I'm trying to be as manly as I can when I'm shaving my legs." -Grundislav

Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #16 on: 11 Nov 2007, 23:15 »
I forget exactly what it told me to delete but a lot of it had to do with saves and loads but from what you wrote it sounds like I wasn't soppose to delete anything but in test mode the game still saves and loads fine but thats all I can tell you cause whats gone is gone but thanx for all the help if I need anything else I'll let you know
Victory is my destiny

Ghostlady

  • Last night I dreamt I went to Manderley again...
Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #17 on: 29 Oct 2010, 02:28 »
Can you tell me where the saves go?  I am using this module, and BTW it is great, but I can't find the saves.  Also, do you know the max number of saves this will allow?
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Buckethead

  • No m8...
Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #18 on: 29 Oct 2010, 10:14 »
For me they go in C:\Users\"username"\Documents\SavedGames

I think it was 99 saveslots. From what I remember when I used it.

Ghostlady

  • Last night I dreamt I went to Manderley again...
Re: GUI & MODULE: Simple Save & Load 1.0
« Reply #19 on: 30 Oct 2010, 03:48 »
And there they were.  Thank you!
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse