game_save

Save a game to a file.

Syntax:

GML Code Example

game_save(filename);


Argument Description
filename The name of the file to save the game to.


Returns: N/A


Description

With this function you can do a basic save of the game to a given file.

NOTE: This function is very limited and it is designed for the beginner to get a save system up and running quickly, but more advanced users may prefer to code their own system using the File functions, due to the fact that the game will not save any of the dynamic resources like data structures, surfaces, added backgrounds and sprites etc..


Example:

GML Code Example

if keyboard_check_pressed(ord("S"))
    {
    global.Saved = true;
    game_save("Save.dat");
    }
 

The above code will set a global variable to true and then saves the game to the file "Save.dat" when the key "S" is pressed.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here