• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

iOS ios ini_open load and save data not working directly on iPhone?

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):
GML:
script_init();
script_game_load();
script_init:
GML:
global.user_savefile="settings.ini";
global.user_levels_unlocked=1;
//(much more stuff in this init_script)
script_game_load:
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();
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?
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();
 
Top