Hey!
I have an "on key press" autoload function set up in my game. If the player presses F5, the game autosaves to slot 98. If the player presses F7, it loads up the autosave slot (98).
if(keycode == eKeyF7){
RestoreGameSlot(98);
UnPauseGame();
}
How can I change this so that pressing the F7 key will actually load up the most recent save game in general? And how would I put a check in place in case no save games exist? Any help is much appreciated, I've been fiddling around with various possibilities but haven't managed to get it working.
ps. I use the standard AGS Load/Save system detailed here: https://www.adventuregamestudio.co.uk/wiki/Creating_Custom_Save_and_Load_Dialogs
Many thanks!
Shaun
When you fill the list box using ListBox.FillSaveGameList, it sorts the saves by date (most recent first). You may create a hidden list box, fill it, and choose the first item in ListBox.SaveGameSlots[] array (SaveGameSlots[0]). If ListBox.ItemCount is zero, that would mean that there are no saves.
Thanks CW! :)
I'll try this out this evening.
It works! Thanks CW :)