• 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.

Question - Code Where are files saved to in GM2?

P

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
 

Gamerev147

Member
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! :)
 
P

Plan-G

Guest
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! :)
Thanks! I should have mentioned I'm working on Mac so just trying to find the Run box command ;)
 
P

Plan-G

Guest
Is anyone out there implementing a save/load game system for iOS and Android targets?
 
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/
 
P

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
 

rwkay

GameMaker Staff
GameMaker Dev.
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
 
Top