UWP Saving and Loading ini Files (targeting Xbox One)

E

eyethree

Guest
Hello,
I've recently had to rework a save system for one of my games on Xbox One to Save/Load via ini files/functions (followed this YoYo tutorial with the included wrappers).

After rewriting everything (which I thought I understood, but I've been up for 32 hours, so pardon my complete lack of understanding if I butchered this), I'm left with a Save/Load system that doesn't function properly.

For the load function (placed on an object in first room[create event[):

globalvar loadbuff;
global.loadbuff = buffer_create(1,buffer_grow,1);
buffer_async_group_begin("Spoopy_Game");
buffer_async_group_option("showdialog",0); // Stop platform dialogues appearing for this auto-save (if you do this your player won't be able to select a slot manually)
buffer_async_group_option("slottitle","SpoopyGame"); // Set the title of the slot we're going to save into
buffer_async_group_option("subtitle","Super Spoopy Save File"); // Set a subtitle that's visible in the XBox UI
buffer_load_async(global.loadbuff,"Save.sav",0,-1); // Say what we want to load and into which buffer
ini_open_from_string("");
global.orbs = ini_read_real("SpoopyData","orbs",2500);
ini_close();
global.loadid = buffer_async_group_end(); // Actually start loading now, and return a request ID value



For the save function (placed on an object in room where data needs to be saved[create event]):

buffer_async_group_begin("Spoopy_Game");
buffer_async_group_option("showdialog",0); // Stop platform dialogues appearing for this auto-save (if you do this your player won't be able to select a slot manually)
buffer_async_group_option("slottitle","SpoopyGame"); // Set the title of the slot we're going to save into
buffer_async_group_option("subtitle","Super Spoopy Save File"); // Set a subtitle that's visible in the XBox UI
globalvar savebuff;
global.savebuff = buffer_create(1,buffer_grow,1);
ini_open_from_string("");
ini_write_real("SpoopyData","orbs",global.orbs);
var inistring = ini_close();
buffer_write(global.savebuff,buffer_string,inistring);
buffer_save_async(global.savebuff,"Save.sav",0,buffer_get_size(global.savebuff)); // Pass the data to be saved
global.saveid = buffer_async_group_end(); // Start the save process and return the save request ID


If anyone can help me fix this issue and tell me what I'm doing wrong/missing, I'd greatly appreciate it.
 
Last edited by a moderator:
E

eyethree

Guest
If a mod sees this, could you please move this to the programming forum? Sorry and thanks.
 
Top