1. Hey! Guest! The 34th GMC Jam will take place between August 22nd, 12:00 UTC (Thursday noon) and August 26th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

Android on_game_paused and saving on android

Discussion in 'Programming' started by Verilyzed, May 6, 2019.

  1. Verilyzed

    Verilyzed Member

    Joined:
    Apr 10, 2018
    Posts:
    21
    Hello!
    My name ist Colin.

    I got a problem with saving my game with *.ini files while using step event and on_game_paused.

    I also used Game End and Room End events. Also I used event_perform in combination with step and on_game_paused and performed a new user event with that code in it.
    This is the only code i got.

    Code:
    if (os_is_paused()) {
         ini_open("save.ini")
        
         ini_write_real("save", "money", global.money);
         ini_write_real("save", "coins", global.coins);
    
         ini_write_real("save", "xp", global.xp);
         ini_write_real("save", "lvl", global.level);
    
         ini_write_real("save", "high", global.high);
         ini_write_real("save", "wanted", global.wanted);
        
         ini_close();
        }
    
    It were really nice if someone could help me out.

    Thanks!
     
  2. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,777
    And what's the problem?
     
  3. Verilyzed

    Verilyzed Member

    Joined:
    Apr 10, 2018
    Posts:
    21
    It dont save the game if you quit it. I want if i quit the game that it saves but it dont save the game
     
  4. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,327
    Trying to catch and react to hard quits on a mobile platform is a fool's errand. The only mitigation is to save early and save often.
     
  5. Verilyzed

    Verilyzed Member

    Joined:
    Apr 10, 2018
    Posts:
    21
    Okay thats bad.
    But in Game Maker 1 this function worked for me so im a little bit confused.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice