Difference between revisions of "SCI Kernel Documentation/Save-Restore Game Functions"
m (Collector moved page SCI Kernel Documentation/Save/Restore Game Functions to SCI Kernel Documentation/Save-Restore Game Functions) |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
[[SCI Kernel Documentation/String Functions|6]] | | [[SCI Kernel Documentation/String Functions|6]] | | ||
[[SCI Kernel Documentation/Picture Functions|7]] | | [[SCI Kernel Documentation/Picture Functions|7]] | | ||
− | [[SCI Kernel Documentation/Save | + | [[SCI Kernel Documentation/Save-Restore Game Functions|8]] | |
[[SCI Kernel Documentation/Animation Functions|9]] | | [[SCI Kernel Documentation/Animation Functions|9]] | | ||
[[SCI Kernel Documentation/Graphic Screen Functions|10]] | | [[SCI Kernel Documentation/Graphic Screen Functions|10]] | | ||
Line 23: | Line 23: | ||
</div><br /> | </div><br /> | ||
− | <div align="center"><span style="font-size: 22pt"></span><br /> | + | <div align="center"><span style="font-size: 22pt">Save/Restore Game Functions</span><br /> |
''Author: [[Jeff Stephenson]]''<br /> | ''Author: [[Jeff Stephenson]]''<br /> | ||
''Revision by: David Slayback''</div> | ''Revision by: David Slayback''</div> | ||
Line 29: | Line 29: | ||
| | ||
− | + | ==<br /> Save/Restore Game Functions == | |
+ | |||
+ | <blockquote> | ||
+ | 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. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (SaveGame name num @comment version) === | ||
+ | |||
+ | <blockquote> | ||
+ | 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. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (RestoreGame name num version) === | ||
+ | |||
+ | <blockquote> | ||
+ | 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. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (RestartGame) === | ||
+ | |||
+ | <blockquote> | ||
+ | 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. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (GameIsRestarting [flag]) === | ||
+ | |||
+ | <blockquote> | ||
+ | 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. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (GetSaveDir) === | ||
+ | |||
+ | <blockquote> | ||
+ | Return a string pointing to the current save directory. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (CheckSaveGame gameName fileNum version) === | ||
+ | |||
+ | <blockquote> | ||
+ | Check the save game file "<gameName>SG.<fileNum>" to see if the versions match and so it can be restored. | ||
+ | </blockquote> | ||
| | ||
Line 42: | Line 82: | ||
| | ||
− | <span style="float: left">[[SCI Kernel Documentation/|< Previous: ]]</span><span style="float: right">[[SCI Kernel Documentation/|Next: | + | <span style="float: left">[[SCI Kernel Documentation/Picture Functions|< Previous: Picture Functions]]</span> |
+ | <span style="float: right">[[SCI Kernel Documentation/Animation Functions|Next: Animation Functions >]]</span> | ||
| | ||
[[Category:SCI Documentation]] | [[Category:SCI Documentation]] | ||
− | |||
[[Category:Kernel Functions]] | [[Category:Kernel Functions]] | ||
+ | [[Category:Save/Restore Game Functions]] |
Latest revision as of 19:06, 3 December 2015
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
< Previous: Picture Functions Next: Animation Functions >