rekamemag2
Member
I can't figure out how to load and save data on iOS!?
The app itself runs fine on iOS but when I close the app and then start again, it doesn't load the saved data?
What am i doing wrong?
When the game starts it calls the object below:
obj_init_game: (create event):
script_init:
script_game_load:
script_game_save - this is called every time the user unlocked a stage in the step event. So if the user closes the app and then re-opens again the progress can be loaded at startup (script_game_load) - but it doesn't!? Any help?
The app itself runs fine on iOS but when I close the app and then start again, it doesn't load the saved data?
What am i doing wrong?
When the game starts it calls the object below:
obj_init_game: (create event):
GML:
script_init();
script_game_load();
GML:
global.user_savefile="settings.ini";
global.user_levels_unlocked=1;
//(much more stuff in this init_script)
GML:
ini_open(working_directory + global.user_savefile);
if !ini_section_exists("levels") {
global.user_levels_unlocked = ini_read_real("levels", "user_levels_unlocked", 1)
}
}
ini_close();
GML:
if (file_exists(working_directory + global.user_savefile)) file_delete(working_directory + global.user_savefile);
ini_open(working_directory + global.user_savefile);
ini_write_real("levels", "user_levels_unlocked", global.user_levels_unlocked);
ini_close();