Creating a Save/Load System
by Peter Medina · in Technical Issues · 10/10/2006 (8:24 pm) · 2 replies
Hello world,
I'm producing a simple arcade like action game with slightly over one hundred levels using TGB. I'm an artist not a programmer, however I have found plenty of help on this site to develop the bulk of what's needed. What I haven't found much info on is the creation of a simple save/load system.
I'm not expecting the answer to be handed to me on a silver platter, but is there any way to create such a system in script? This is basically how it would be used:
1) The game's main menu has two options to start with: New Game and Exit.
2) Player begins game, and progresses through several levels.
3) Player exits game.
4) Next time player starts game, a new option is added to main menu: Continue Game.
5) Player selects "Continue Game" and the last level s/he played is loaded.
6) Player plays game.
So basically, it would remember what the last level played was, and load that upon selecting "Continue Game." The option to "Continue Game" only appears when there is a game to continue.
Any advice on where to look or what to do to make this happen would be much appreciated. I searched the forums and resources several times over the last week, but found nothing.
Thank you,
-Pete
I'm producing a simple arcade like action game with slightly over one hundred levels using TGB. I'm an artist not a programmer, however I have found plenty of help on this site to develop the bulk of what's needed. What I haven't found much info on is the creation of a simple save/load system.
I'm not expecting the answer to be handed to me on a silver platter, but is there any way to create such a system in script? This is basically how it would be used:
1) The game's main menu has two options to start with: New Game and Exit.
2) Player begins game, and progresses through several levels.
3) Player exits game.
4) Next time player starts game, a new option is added to main menu: Continue Game.
5) Player selects "Continue Game" and the last level s/he played is loaded.
6) Player plays game.
So basically, it would remember what the last level played was, and load that upon selecting "Continue Game." The option to "Continue Game" only appears when there is a game to continue.
Any advice on where to look or what to do to make this happen would be much appreciated. I searched the forums and resources several times over the last week, but found nothing.
Thank you,
-Pete
About the author
#2
Thanks again,
-Pete
10/11/2006 (9:38 am)
Thanks for the reply. Yes, I only want to save the level progress, not anywhere in the level. I'd hate for my player to make it really far in the game only to have to start all over again if s/he has to exit the game. This weekend I when I have some free time I will work on it.Thanks again,
-Pete
Torque Owner Paul /*Wedge*/ DElia
http://tdn.garagegames.com/wiki/TGB/ScriptTutorials/ScoreTutorial
That should probably cover the basics of the kind of things you would need to do. And it's possibly more or less complex than what you need. Do you want to save anywhere in a level, or just the level progress? Saving anywhere might be more complex, though it's probably doable by messing with the methods TGB uses already for saving levels. If you just want to save level progress though, you only have to write out a number of the last level you were at or something, and then read that in and set your continue button to send you there.