Save and load script
A script which let the user enter a filename to save or to load a game with a standard windows message screen. An editable message screen can be achieved by using the open example on the examples page
Save and load script |
//////////////// Save and load script ////////////////////
// // Copyright Simon Donkers 27-1-2005 // www.simondonkers.com - gmmentor@simondonkers.com // // argument0 = 0 for saving, 1 for loading // argument1 = file extension. For example .sav // Do not add a '*' sign for the extension // standard directory is the directory the game stands in // ///////////////////////////////////////////////////// var Savegame,Loadgame; if argument0 = 0 then { SaveGame = get_save_filename('SaveGame(*' + argument1 + ')|*' + argument1 + '', ''); if SaveGame != '' then if string_copy(SaveGame, string_length(SaveGame) - 3, 4) != argument1 then SaveGame = SaveGame + argument1; game_save(SaveGame); } else { LoadGame = get_open_filename('Save games|*' + argument1 + '', ''); if (LoadGame != '') then if file_exists(LoadGame) then game_load(LoadGame); } |