1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

UWP Saving and Loading ini Files (targeting Xbox One)

Discussion in 'Programming' started by eyethree, Dec 4, 2019.

Tags:
  1. eyethree

    eyethree Member

    Joined:
    Dec 26, 2017
    Posts:
    10
    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: Dec 4, 2019
  2. eyethree

    eyethree Member

    Joined:
    Dec 26, 2017
    Posts:
    10
    If a mod sees this, could you please move this to the programming forum? Sorry and thanks.
     

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