Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Arjunaz78 on Wed 18/01/2012 20:26:32

Title: Auto Save Game [SOLVED]
Post by: Arjunaz78 on Wed 18/01/2012 20:26:32
How can i make an auto save games function using AGS editor? what i want is the game autosave when player currently in certain room or certain important event trigger. I found that function comes usefull especially when a long play of games, instead of using manual save games menu.

THX.
Title: Re: Auto Save Game
Post by: on Wed 18/01/2012 20:30:41
You can use the SaveGameSlot command: SaveGameSlot (int slot, string description)

This allows you to do a "silent save"- the player will not even notice it! The manual strongly recommends to use a number slot of 100 or higher, so that you do not interfere with the SaveGameDialog command.

Simply put: SaveGameSlot(100, "AutoSave") will create a savegame.
RestoreGameSlot(100) will restore it, as if selected with a "load" screen.

If you want to make sure the player doesn't wonder why he can't save, I'd use a selfmade "autosave" function:


function CustomAutosave() {
    SaveGameSlot(100, "AutoSave");
    Display("Your game has been saved!");
}


Take note that with this method you will always only have ONE autosave slot, because each call to the function will overwrite the previous save.