Is there a way to Auto-Save? (SOLVED)

Started by Ponch, Thu 13/01/2005 04:20:23

Previous topic - Next topic

Ponch

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.

Barbarian

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 ).
Conan: "To crush your enemies, see them driven before you, and to hear the lamentation of the women!"
Mongol General: "That is good."

Blade of Rage: www.BladeOfRage.com

Scorpiorus

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.

Ponch

#3
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

Rui 'Trovatore' Pires

Someone remind me to be the next guy to solve Ponch's problems. I mean, Mint-Flavored Dental Floss? How cool is that?! :=
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Barbarian

*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
Conan: "To crush your enemies, see them driven before you, and to hear the lamentation of the women!"
Mongol General: "That is good."

Blade of Rage: www.BladeOfRage.com

Scorpiorus

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?

Pumaman

This issue is conveniently bypassed by 2.7, since SaveGameSlot doesn't actually save until the script finishes running. ;)

Scorpiorus

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?Ã,  :=

Pumaman

Are we talking cutscene as in StartCutscene/EndCutscene, or are we just talking cutscene as in any blocking sequence of animations?

Ponch

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

Rui 'Trovatore' Pires

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
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Scorpiorus

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. :)

Pumaman

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.

SMF spam blocked by CleanTalk