1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Question - Code Where are files saved to in GM2?

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Plan-G, Dec 8, 2017.

  1. Plan-G

    Plan-G Guest

    Hey all,

    If I use the GM2 function:

    file_text_open_write("save.json")

    Where will the "save.json" file actually be saved to?

    I'm having a problem with autosaving and I need to manually check that the file is actually being created and written to properly.

    Thanks for any help!

    G
     
  2. Gamerev147

    Gamerev147 Member

    Joined:
    Sep 12, 2016
    Posts:
    444
    Anytime you save files like that in any version of game maker, game maker creates a folder for your game in a "temporary location."

    If you open the "Run" box by pressing the Windows key + R, in the box type the following:
    %localappdata%

    This will open Windows explorer. Find a folder with the project name of your game on it. Open the folder.
    Any files you save will be saved here. Good luck! :)
     
    Bentley likes this.
  3. Plan-G

    Plan-G Guest

    Thanks! I should have mentioned I'm working on Mac so just trying to find the Run box command ;)
     
  4. Plan-G

    Plan-G Guest

    Is anyone out there implementing a save/load game system for iOS and Android targets?
     
  5. IndianaBones

    IndianaBones Member

    Joined:
    Jul 5, 2016
    Posts:
    2,273
    On my Mac, when testing the game in the IDE, the files save here:

    /Users/<username>/Library/Application Support/com.yoyogames.macyoyorunner/

    And for a standalone build:

    /Users/<username>/Library/Application Support/AppID/
     
  6. csanyk

    csanyk Member

    Joined:
    Jun 20, 2016
    Posts:
    821
  7. rwkay

    rwkay YoYo Games Staff YYG Staff

    Joined:
    Apr 12, 2016
    Posts:
    1,049
  8. Plan-G

    Plan-G Guest

    Thanks everyone for the support ;)

    That's all been really useful to help me start understanding the save system for files. I've had success with ds_map_secure_save and load. Really happy with that so far, and nice to see the file get encrypted.

    I'm using this save file for all of the player progress, and soon I'll be updating it with in-app purchase info. So the next big question is:

    What happens to this save file when the user updates the app?

    I really don't want my users to lose their progress or in-app purchases when I publish an update.

    For now, I'm only targeting iOS and Android, so really only need to know how to deal with this issue on those two platforms.

    I imagine this is a pretty common question, but I've not been able to understand an answer so far :/

    Thanks!
    G
     
  9. rwkay

    rwkay YoYo Games Staff YYG Staff

    Joined:
    Apr 12, 2016
    Posts:
    1,049
    On iOS and Android the save area is handled by the OS - this will only get wiped if the user uninstalls your app or chooses to wipe it within the OS settings (or something goes really wrong with the device).

    During development saves may get wiped if the application is uninstalled from your device (which can happen with GM as well - as we may uninstall the app when installing it onto your device, if certain conditions are met, usually these are error cases - though I believe we have a preference to force the uninstall first)

    Russell
     

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