Author Topic: MODULE: A.S.S - Another Savegames with Screenshots module [updated to v1.5]  (Read 4281 times)  Share 

hedgefield

  • Oh snap!
    • I can help with play testing
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
  • hedgefield worked on a game that was nominated for an AGS Award!
A.S.S. - Another Savegames with Screenshots module - v1.5 released 04.11.2011
Original code by Spyros. Enhanced and ported to AGS 3+ code by hedgefield
---------------------------------------------------------------------------------------------------------

v1.5 changelog:
- fixed a bug where pressing F5 or F7 repeatedly opened new instances of the save and load GUI respectively
- added the option to save and display the date and time the savegame was made. see readme for instructions

v1.4 changelog:
- turned the script into a module now that I know how to do that :)
- resized the GUIs back down to their original size and removed all graphics from them
- the module should now enable the "save screenshots in savegames" option for you if you hadn't already

v1.3 changelog:
- fixed a bug where the load GUI would crash when trying to load with no savegame selected

v1.2 changelog:
- fixed a bug where the load GUI would not recognize the first new savegame after deleting all the existing savegames

V1.1 changelog:
- added a delete button!
- fixed a bug where the game would crash when trying to load when no savegames existed yet
- added the ability to deselect a slot by clicking outside the listbox
- increased the walking speed of the character to make moving around less tiresome
- updated the readme with usage instructions

---

ANOTHER savegames with screenshots template you say? Indeed. It remains a much-requested feature, so why not?

This template is a port -or perhaps "mutation" is more accurate- of Spyros' old savegames with screenshots tutorial. When I upgraded to AGS v3 I had to rewrite his code to work with the new object-oriented scripting language, and made a few modifications in the process. So here it is for you to enjoy aswell!

MAKE YOUR CLICKS HERE FOR DOWNLOADING TIMES (download here)



To install:
- import ASS.scm into the Scripts library in AGS (right-click on it, choose 'import script')
- import gSave.guf and gLoad.guf the same way under the GUI library
- open ASScode.txt, copy the whole thing and paste it at the bottom of your global script

To use: When you want to open the save GUI, all you have to do is call: sl_save();
And to open the load gui - you guessed it: sl_load();

new! If you want to store the date and time the screenshot was made, put SL_DATETIME = true; under function game_start() in your Global Script.

Comes with predefined keyboard shortcuts (F5 and F7, can be edited)


Requires AGS v3.0+. Tested with AGS 3.2.1. Keyboard shortcuts are still in ASCII code for additional backwards compatibility.
« Last Edit: 04 Nov 2011, 16:04 by hedgefield »

NEON-GAMES

    • I can help with AGS tutoring
    •  
    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
Really good template. Thanks. :D

Mehrdad

    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Hi
I can not download.I think site is filtering for my country.can you give me mirror link?
My artworks  http://pershaland.com/

hedgefield

  • Oh snap!
    • I can help with play testing
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
  • hedgefield worked on a game that was nominated for an AGS Award!
Hmm that's weird. Well, I don't have another place to upload it, but if anyone else feels like hosting a mirror, I won't object. Or just PM me your email adress and I'll send it to you.

aventurero

  • How appropiate. You fight like a cow.
    • I can help with play testing
    •  
    • I can help with story design
    •  
    • I can help with translating
    •  
You could just upload it to mediafire. Just for the bastards who doesn't live in the USA. :P
[code]function iToxicWaste_Talk()
{
Display ("You eat the toxic waste. Obviously, you die.");
QuitGame (0);}
[/code]

Looks useful, aside the unfortunate acronym. (Sorry, couldn't help myself).
"Life's too short for all this nonsense.:
  -Joseph Brophy

hedgefield

  • Oh snap!
    • I can help with play testing
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
  • hedgefield worked on a game that was nominated for an AGS Award!
Oh that was intentional. ;)


hedgefield

  • Oh snap!
    • I can help with play testing
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
  • hedgefield worked on a game that was nominated for an AGS Award!
You have a good point, I didn't realize you can still load a saveslot if there are no saves yet. To fix this, change:

[code]
// Load GUI
function btnLoadOK_OnClick(GUIControl *control, MouseButton button) {
  saveslot = lstLoadGames.SelectedIndex;                        // Gets the selected slot
  gLoad.Visible = false;
  mouse.Mode = eModeWalkto;
  if (screenshot != null) {
    screenshot.Delete();
    btnLoadScreen.NormalGraphic = SL_EMPTY_SPRITE;              // Resets the screenshot
  }
  RestoreGameSlot(lstLoadGames.SaveGameSlots[saveslot]);        // Restores the selected slot
}
[/code]

To:

[code]
// Load GUI
function btnLoadOK_OnClick(GUIControl *control, MouseButton button) {
  if (totalsaves>0) {
    saveslot = lstLoadGames.SelectedIndex;                        // Gets the selected slot
    gLoad.Visible = false;
    mouse.Mode = eModeWalkto;
    if (screenshot != null) {
      screenshot.Delete();
      btnLoadScreen.NormalGraphic = SL_EMPTY_SPRITE;              // Resets the screenshot
    }
    RestoreGameSlot(lstLoadGames.SaveGameSlots[saveslot]);        // Restores the selected slot
  }
}
[/code]


As for not being able to save - did you remember to also copy all the custom functions defined at the top of the global script? The system won't work without those.

NEON-GAMES

    • I can help with AGS tutoring
    •  
    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
Quote
As for not being able to save - did you remember to also copy all the custom functions defined at the top of the global script? The system won't work without those.

hedgefield

  • Oh snap!
    • I can help with play testing
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
  • hedgefield worked on a game that was nominated for an AGS Award!
Hmm, I'll need some further information on what exactly you're doing in order to pinpoint what is causing this bug. Or, if you want, you can send me your project files and I can take a look at them directly, which would make it much easier for me to see what is happening.

NEON-GAMES

    • I can help with AGS tutoring
    •  
    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  

hedgefield

  • Oh snap!
    • I can help with play testing
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
  • hedgefield worked on a game that was nominated for an AGS Award!
Through my correspondance with NEON I've managed to fix the bug he mentioned, as well as figure out how to make a delete button! I always wanted to include one in the template but I never took the time to figure out how to actually make one. Turned out it was fairly easy too, so I've released an updated template with this spiffy new function :) See first post for details.
« Last Edit: 31 Jan 2010, 00:06 by largopredator »

Hey largopredator I have found another bug.  If you have one saved game and not select and press load.  It crashes and brings up the following message.

Here are two screenshots to show you visually.


As you can see I haven't selected any save game, and then I press load.


And here is the error message.

I hope this helps.

hedgefield

  • Oh snap!
    • I can help with play testing
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
  • hedgefield worked on a game that was nominated for an AGS Award!
Argh, another little oversight on my part! Thanks for bringing this to my attention.

Luckily the fix is quite simple (because admittedly, the error is quite dumb...) - replace the whole btnLoadOK_OnClick function with the following code:

[code]
function btnLoadOK_OnClick(GUIControl *control, MouseButton button) {
  if (lstLoadGames.SelectedIndex >= 0) {
    saveslot = lstLoadGames.SelectedIndex;                      // Gets the selected slot
    gLoad.Visible = false;
    mouse.Mode = eModeWalkto;
    if (screenshot != null) {
      screenshot.Delete();
      btnLoadScreen.NormalGraphic = SL_EMPTY_SPRITE;            // Resets the screenshot
    }
    RestoreGameSlot(lstLoadGames.SaveGameSlots[saveslot]);      // Restores the selected slot
  }
  else if (totalsaves>0) Display("Please select a savegame.");
  else Display("There are no savegames yet!");
}
[/code]


What it did before was make sure there were at least actual savegames to load. However, if you don't select any of those savegames before you press load, obviously it will crash! :) The script above now checks whether you actually selected a saveslot before trying to load anything. That oughta fix it.

Wow that was truly quick largopredator, thanks for the fantastic fix.

hedgefield

  • Oh snap!
    • I can help with play testing
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
  • hedgefield worked on a game that was nominated for an AGS Award!
After I finally got around to figuring out how to create modules, I thought it might be a good idea to convert this template into one. So now you don't have to start a project from scratch (or do a lot of awkward copy-pasting) to be able to use it!

See the first post for updated download link and installation instructions, and let me know if you spot any bugs.

Mehrdad

    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
sorry for this post .but if can you give any mirror link?this link is block in my country.can you upload in mediafire?

thanks a lot :)
My artworks  http://pershaland.com/


Mehrdad

    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Oh.Thanks at milllions for mirror ;D
My artworks  http://pershaland.com/