• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Help with saving

R

r7465

Guest
There is a slight problem over here. I want the game to instantly load from last time whenever the player opens it. How can I do that? thanks.

By that I mean the game always loads on the main menu and all variables etc are loaded.
 

FrostyCat

Redemption Seeker
If you don't use any dynamically generated data (e.g. data structures, particle systems buffers, surfaces, etc.), aren't working with HTML5 or mobile and won't be updating your game after release, you can get away with game_save() and game_load() (plus file_exists() to check if there is pre-saved data). Otherwise, you have to think of what pieces of data needs saving in your project and then read/write the entries accordingly (INI is a popular approach around here, but not the only one). Functions related to this are found under Reference => File Handling in the Manual (bring it up with the F1 key from within GM).

Saving is one of those features that novices often believe can be spontaneously added to just about any project, while in reality it almost always happens with prior planning well in advance.
 
R

r7465

Guest
Ahh, I didn't know about file_exists. Great feature, thanks!
 
Top