SCI Kernel Documentation/Save-Restore Game Functions

From SCI Wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Index


Save/Restore Game Functions

Author: Jeff Stephenson

Revision by: David Slayback

 


Save/Restore Game Functions

Saves the whole heap, including scripts loaded and all global, local, and temporary variables. Name is a string of the current game (ie. King's Quest#1 = KQ1), num is the number of the save game, comment is a pointer to a string that will be saved for later lookup, and version is the current version of the SCI interpreter. The game is saved under <name>SG.<num> and the file <name>SG.DIR contains the comment and the number for the given save game.


(SaveGame name num @comment version)

Saves the whole heap, including scripts loaded and all global, local, and temporary variables. Name is a string of the current game (ie. King's Quest#1 = KQ1), num is the number of the save game, comment is a pointer to a string that will be saved for later lookup, and version is the current version of the SCI interpreter. The game is saved under <name>SG.<num> and the file <name>SG.DIR contains the comment and the number for the given save game.


(RestoreGame name num version)

RestoreGame restores the heap in the saved game, and then starts the game from where it had been saved. If the current running SCI version does not match the restored game's one, then a message will be printed and the game will not be restored.


(RestartGame)

This function resets the system to the state it had at the beginning of the game, allowing the user to restart the game without rebooting it.


(GameIsRestarting [flag])

If flag is present will set the GameIsRestarting internal flag to the given value, TRUE or FALSE. With no arguments, the function returns the value of the internal flag. The internal flag is set by RestartGame, and reset every time in the doit: of theGame.


(GetSaveDir)

Return a string pointing to the current save directory.


(CheckSaveGame gameName fileNum version)

Check the save game file "<gameName>SG.<fileNum>" to see if the versions match and so it can be restored.

 

Notes


 

Table of Contents

 

< Previous: Picture Functions Next: Animation Functions >