Custom save/load game with hours

Started by Jakerpot, Sun 07/06/2009 02:05:33

Previous topic - Next topic

Jakerpot

Hello there! I wanted to add a custom save/load game GUI in my game. Ok, but i wanted that the gui showed a screenshot of the game in the top of the screen and below it how many time the player spent on the game.
you know:

-----------------------------------------------------------------------
--------------000000000000000000000000-------------------
--------------000000000000000000000000-------------------
--------------000000000000000000000000-------------------
--------------000000000000000000000000-------------------
--------- 0:30:40 seconds GameFile Name here -------------
-----------------------------------------------------------------------
-----------------Slot 1: GameFile Name Here-------------------
-----------------Slot 2: GameFile Name Here-------------------
-----------AND CONTINUE WITH MORE AND MORE SLOTS---

0's are to be the game screenshot
understood?

by the way, how many save slots can an AGS game have?
thank you.



Wonkyth

I'm not sure about the first question, but logically, the most save slots you can have is 998.
That is probably sooo wrong. ;D
"But with a ninja on your face, you live longer!"

Gilbert

I'm just lazy. The screenshot part can be done with using the savegame with screenshot option and then use scripting to grab it and display it in the GUI. Just search for the few threads about.
For the time part. One way of doing this is to concatenate the play time into the savegame's name String, and in the GUI's script just split the String.

GuyAwesome

I'll second Gilbet's suggestion about adding the time to the savegame description, otherwise you're probably into the File functions and storing it in a separate list...

I don't know what the upper limit on save games is. I know you CAN save to slots over 1000 but accessing slots 50+ takes an extra level of scripting (of course, you'll be doing a lot of that anyway), and slot 999 is reserved as a temp save while the game is running so you can't save to that.

What've got for this so far, or are you just scouting for ideas? I guess you need: Time system; adding/removing time from save description; savegame screenshots. Oh, and : custom save/load GUI to handle slots >50.

JpSoft

Well, the custom module we created for GBF stores the saved games with date and time included (just adding it at the beggining of the name and deleting it when read). You need create a custom GUI. AFAIK, the problem to manage 998 games is the listboxes, actually limited to 50 items (i think so) so you will need many listboxes to manage with that. If you really need use that amounf of saved games, is better if you create your own listbox system.
Screenshots is very complex, and you will need some advanced script. If you are just starting with AGS is not the best idea. Anyway, you need activate the option "save screenshots in saved games" in the general settings,then read the image to a dynamyc sprite (sprite = DynamycSprite.CreateFromScreenShot) and use it in your own GUI.

When i solve the current trouble i have with this same issue (posted some days ago), i could give you the complete code.

Jp

GuyAwesome

Listboxes are limited to 200 items, as far as I can tell. Didn't know that.
The 50 limit is if you're using the ListBox.FillSaveGameList method, to go beyond that you'll need to write your own script for adding savegames to the ListBox. And if you're doing that, you can probably script custom scrolling so that items are deleted/added to the listbox as needed so the 200 limit isn't exceeded. (I.e. you're at item 200, scroll down. The top (item 0) slot is deleted and a new one added at the end. Scroll back up and the bottom (item 199) is deleted and an earlier one inserted at item 0.)

JpSoft, what is the problem you've got? It looks like your question is waiting on more details...

Jakerpot

Thank you everyone! 50 save game slots is just what i need, i dont need more than this. I think i will only add the screenshot option, i don't even know how to do a custom save/load gui (not because i suck at scripting, but because i never tryed to make one), i think i can do it by my own. Thank you for all these replies! Everything i need i wil post here.



SMF spam blocked by CleanTalk