How do I save on exit?

0 favourites
  • 7 posts
From the Asset Store
Match the similar cards with each other and free all animals!
  • I'm using local storage to save but when I do On End Of Layout> Set Item... the data does not get saved. Is this supposed to be possible or should I just keep saving every second? But that seems a bit overkill(?)

  • Don't save every second. Don't save on end of layout. Are you talking about saving as you close the application? That seems risky, just don't allow a save at that point.

  • Yeah, save before exiting the layout:

    On clicked ExitButton
    	Local Storage set...
    	Wait for previous action to complete
    	Go to MainMenu layout
    
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The best way to do that is, store data into the Local Storage, whenever a new data or changes to the data are made. That's so when the user exits the application, the data or changes he or she has made is retained, without making redundant saves in the Local Storage.

  • I need the game to remember the system time at which you were last playing the game. There are plenty of 'idle' games that do this. I can't expect the player to press an exit button either. Likely they will just close the app with the device buttons or it just suspends.

    Maybe that's the answer..can I detect device button and not quit until it's saved??

    So far though the only way I can think to do it is saving the time every second of so unless there is another way I missed?

    On application end would be perfect of course..

  • If you're saving every second I don't see the problem then. You're worried about missing half a second of progress if the player exits within a second? You do present a problem which is the player can potentially shut down the application while it is saving, I don't know if this can lead to corrupt data.

  • You should not save every second. I'd go for important events and save then. If important stuff is changing every second, you should save regularly, but, still, I'd not recommend every second. Also, make it clear to the player that he should hit a Save button before leaving or risk losing "some seconds" of his or her progress.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)