01-13-2018, 11:09 AM
I used similar code to save files in GM 8, but when I use it in GM Studio 2, it won't save a file in the location that the ApplicationData environment variable points to. It seems that the AppData environment variable works a little differently in newer versions of GM, so what I am doing wrong here?
Code:
if file_exists(environment_get_variable("ApplicationData")+"\gamename.sav")
file_delete(environment_get_variable("ApplicationData")+"\gamename.sav");
var file = file_text_open_write(environment_get_variable("ApplicationData")+"\gamename.sav");
var savelist = ds_list_create();
ds_list_add(savelist, global.boringVariableName);
var savestr = ds_list_write(savelist);
file_text_write_string(file, savestr);
ds_list_destroy(savelist);
file_text_close(file);