Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Ponch on Thu 13/01/2005 04:20:23

Title: Is there a way to Auto-Save? (SOLVED)
Post by: Ponch on Thu 13/01/2005 04:20:23
Hello all,

My next game features a pair of arcade sequences and I'm looking for a way to provide the player with an Auto-Save that will back the game up for them shortly before they stumble into a life or death situation. (BTW, there will be an Arcade Lite feature available to strip out the arcade sequences altogether for those who prefer their adventure without action.)

I would like to handle this is a fashion similar to "Prisoner of Ice" and it's "TroubleJoker" feature that saved a game before throwing you into the middle of the action. That way, if you die, you can just load the autosave slot and won't be penalized for not saving your game every ten minutes.

I've tried room enter functions (both before and after fade in) and walk onto region functions. I try to save the game in a slot the player would not normally have access to but when the game is reloaded, it seems locked up. No cursor, no GUI, nothing.

I've tried several flavors of code but have had no luck. Has anyone ever implemented this and if so, could anyone please post some of their awesome scripting to help me out? I will build a small shrine to you on top of my monitor.

Thanks,

Ponch.
Title: Re: Is there a way to Auto-Save?
Post by: Barbarian on Thu 13/01/2005 04:34:38
Found another thread that may be helpful for you:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=16352.0

  You could probably change thier script idea around so that it would automatically save upon entering a room rather than needing the player to make a key-press.

   So, get busy on building that shrine dedicated to me  ;D ( Just joking ).
Title: Re: Is there a way to Auto-Save?
Post by: Scorpiorus on Thu 13/01/2005 15:10:01
QuoteI've tried room enter functions (both before and after fade in) and walk onto region functions. I try to save the game in a slot the player would not normally have access to but when the game is reloaded, it seems locked up. No cursor, no GUI, nothing.
Hmm, seems strange. If you put something like...

SaveGameSlot (99, "autosave");

...on player enters room (after fade-in)

and then later do...

RestoreGameSlot (99);

...it should work.
Title: Re: Is there a way to Auto-Save?
Post by: Ponch on Fri 14/01/2005 04:02:27
Solved!

I am forced to confront my own shocking stupidity and admit that I had been saving the game before the "cutscene" was finished playing. That accounts for the lock up, I think.

I've been beating my head against the wall for two days due to my inability to RTFM. I am tremendously ashamed. I will have to shave my head and go on a pilgrimage or something.

Scorpiorus, I'll craft a paper mache shrine to you and sacrifice a delicious breakfast pastry to it every morning before work.

Barbarian, thanks for the link. There was some useful info there and I may be able to use if for an upcoming game. I shall build a smaller shrine to you and sacrifice a length of dental floss (mint flavored) to it every night before bed.

Thank you both.

-Ponch
Title: Re: Is there a way to Auto-Save? (SOLVED)
Post by: Rui 'Trovatore' Pires on Fri 14/01/2005 08:25:47
Someone remind me to be the next guy to solve Ponch's problems. I mean, Mint-Flavored Dental Floss? How cool is that?! :=
Title: Re: Is there a way to Auto-Save? (SOLVED)
Post by: Barbarian on Fri 14/01/2005 10:19:00
*In Homer Simpson voice* "Mmmmm... Minty!*

   Well, good to know you got things resolved and I was able to be of some small help.   BTW, I like the waxed-floss better... easier on my gums.  ;D
Title: Re: Is there a way to Auto-Save? (SOLVED)
Post by: Scorpiorus on Fri 14/01/2005 18:19:49
Hehe, you're welcome Ponch :)


Anyway, if saving the game state during a cutscene is not supported then maybe SaveGameSlot could check for it to display an appropriate error message?
Title: Re: Is there a way to Auto-Save? (SOLVED)
Post by: Pumaman on Fri 14/01/2005 20:21:08
This issue is conveniently bypassed by 2.7, since SaveGameSlot doesn't actually save until the script finishes running. ;)
Title: Re: Is there a way to Auto-Save? (SOLVED)
Post by: Scorpiorus on Fri 14/01/2005 21:06:10
But maybe the error message should still be displayed, just in case there is some sort of a crazy cutscene where EndCutscene's placed within another event function, are such cutscenes officially supported, by the way?Ã,  :=
Title: Re: Is there a way to Auto-Save? (SOLVED)
Post by: Pumaman on Fri 14/01/2005 22:47:35
Are we talking cutscene as in StartCutscene/EndCutscene, or are we just talking cutscene as in any blocking sequence of animations?
Title: Re: Is there a way to Auto-Save? (SOLVED)
Post by: Ponch on Fri 14/01/2005 23:24:43
Thanks for the new feature, CJ.

To answer your question: Blocking sequences of animation and HideGUI and HideMouseCursor sort of things.

And for the record, I already have a shrine to you: A blue cup filled with thrice-blessed scotch every friday night (and downed shortly after filling).

I really should upgrade my old version of AGS but I started this mammoth game with it back in the forgotten mists of yesteryear and, by God, I shall finish this game with it!

More scotch for the sacred blue mug!

- Ponch
Title: Re: Is there a way to Auto-Save? (SOLVED)
Post by: Rui 'Trovatore' Pires on Sat 15/01/2005 07:45:22
Great. He'll make CJ so drunk, soon enough the only new features in AGS will be misspelled entries in the "Make My Game" feature. :P
Title: Re: Is there a way to Auto-Save? (SOLVED)
Post by: Scorpiorus on Sat 15/01/2005 16:59:29
Ah, it's just blocking functions. Then maybe it's because SaveGameSlot have saved the state while script's running but the rest of the functions after SaveGameSlot wasn't called after restoring, since, if I get it right, the instruction position in the middle of the script is not saved and script execution isn't resumed?

If it's the case then indeed the last betas already have the fix, hehe. :)
Title: Re: Is there a way to Auto-Save? (SOLVED)
Post by: Pumaman on Sat 15/01/2005 18:09:42
That's correct, yeah -- the game would be saved in the middle of the function, but the rest of the function code wouldn't be executed when the game was restored so it could get stuck.