Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* HI JIMMY, THIS IS FOR YOU !!!
- so for saving I personally have 3 save files + a game settings save file that is separate.
- I separated the scripts for Game Settings saving and Game Save Files saving.
- here's stuff that YOU SHOULD PLEASE READ!:
- you need a global varialble: global.file
- so yeah just: global.file = 0;
- this is the save file number you are using, if you will only ever have one file just leave it as 0 forever.
- [ - - USE FOR SAVE FILES - - ]
- Save_File_Real(section, key, value);
- -> Saves numbers to a file
- Save_File_String(section, key, value);
- -> Saves strings to a file
- Load_File_Real(section, key, default);
- -> Loads a number from a file
- Load_File_String(section, key, default);
- -> Loads a strings from a file
- EXAMPLES:
- Save_File_String("CoolGuy", "Nickname", "Lord of Cool");
- Save_File_Real("Tile27", "XX", 64);
- Save_File_Real("Tile27", "YY", 96);
- var nickname = Load_File_String("CoolGuy", "Nickname", "defaultname");
- [ - - USE FOR GAME SETTINGS - - ]
- Save_Game_Real(section, key, value);
- -> Saves numbers to the game settings
- Save_Game_String(section, key, value);
- -> Saves strings to the game settings
- Load_Game_Real(section, key, default);
- -> Loads a number from the game settings
- Load_Game_String(section, key, default);
- -> Loads a strings from the game settings
- EXAMPLES:
- Save_Game_String("SETTINGS", "Username", "pizzaman");
- Save_Game_Real("SETTINGS", "favoritenumber", 128);
- [ - - last one - -]
- There is actually two more scripts, "Save_Game", and "Load_Game", but mine are written specifically for OtC so you're going to have to make it up idk how you want it.
- okay now to the code
- */
- /// Save_File_Real(section, key, value);
- // Saves numbers to a file
- var sect = argument[0], key = argument[1], val = argument[2];
- var filename = working_directory+"\\Saves\\"+"File"+string(global.file)+".ini";
- ini_open(filename);
- ini_write_real(sect, key, val);
- ini_close();
- /// Save_File_String(section, key, value);
- // Saves strings to a file
- var sect = argument[0], key = argument[1], val = argument[2];
- var filename = working_directory+"\\Saves\\"+"File"+string(global.file)+".ini";
- ini_open(filename);
- ini_write_string(sect, key, val);
- ini_close();
- /// Load_File_Real(section, key, default);
- // Loads a number from a file
- var sect = argument[0], key = argument[1], def = argument[2];
- var filename = working_directory+"\\Saves\\"+"File"+string(global.file)+".ini";
- ini_open(filename);
- var data = ini_read_real(sect, key, def);
- ini_close();
- return data;
- /// Load_File_String(section, key, default);
- // Loads a strings from a file
- var sect = argument[0], key = argument[1], def = argument[2];
- var filename = working_directory+"\\Saves\\"+"File"+string(global.file)+".ini";
- ini_open(filename);
- var data = ini_read_string(sect, key, def);
- ini_close();
- return data;
- /// Save_Game_Real(section, key, value);
- // Saves numbers to the game settings
- var filename = working_directory + "GameSave.ini";
- var Section = argument[0];
- var Key = argument[1];
- var Value = argument[2];
- ini_open(filename);
- ini_write_real(Section, Key, Value);
- ini_close();
- /// Save_Game_String(section, key, value);
- // Saves strings to the game settings
- var filename = working_directory + "GameSave.ini";
- var Section = argument[0];
- var Key = argument[1];
- var Value = argument[2];
- ini_open(filename);
- ini_write_string(Section, Key, Value);
- ini_close();
- /// Load_Game_Real(section, key, default);
- // Loads a number from the game settings
- var filename = working_directory + "GameSave.ini";
- var Section = argument[0];
- var Key = argument[1];
- var Default = argument[2];
- ini_open(filename);
- var data = ini_read_real(Section, Key, Default);
- ini_close();
- return data;
- /// Load_Game_String(section, key, default);
- // Loads a strings from the game settings
- var filename = working_directory + "GameSave.ini";
- var Section = argument[0];
- var Key = argument[1];
- var Default = argument[2];
- ini_open(filename);
- var data = ini_read_string(Section, Key, Default);
- ini_close();
- return data;
Add Comment
Please, Sign In to add comment