Forum rules - please read before posting.

optionsData no longer contains definition of lastSaveID and GetPreviousSaveIDs

Hi Chris! I've just updated AC from 1.81.7 to 1.82.1, and I got these console errors:

Assets_EverAfter\Scripts\SaveSetup.cs(19,44): error CS1061: 'OptionsData' does not contain a definition for 'lastSaveID' and no accessible extension method 'lastSaveID' accepting a first argument of type 'OptionsData' could be found (are you missing a using directive or an assembly reference?)

Assets_EverAfter\Scripts\SaveSetup.cs(23,43): error CS1061: 'OptionsData' does not contain a definition for 'GetPreviousSaveIDs' and no accessible extension method 'GetPreviousSaveIDs' accepting a first argument of type 'OptionsData' could be found (are you missing a using directive or an assembly reference?)

Assets_EverAfter\Scripts\SaveSetup.cs(38,44): error CS1061: 'OptionsData' does not contain a definition for 'lastSaveID' and no accessible extension method 'lastSaveID' accepting a first argument of type 'OptionsData' could be found (are you missing a using directive or an assembly reference?)

This is the script I had been using, which deletes all saves that are more recent than the one the player has chosen (i.e. loading a previous save permanently takes the player to that point in time, and they can't change their mind):

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using AC;

public class SaveSetup : MonoBehaviour
{


    void LoadRewindSave()
    {
        AC.SaveSystem.LoadGame(AC.GlobalVariables.GetIntegerValue(15));
    }

    void RewindToSave()
    {

        int saveToRewindTo = AC.GlobalVariables.GetIntegerValue(15); // The rewind save variable
        int lastSave = Options.optionsData.lastSaveID;

        bool foundsave = false;
        List<int> ListOfSaves = new List<int>();
        ListOfSaves = Options.optionsData.GetPreviousSaveIDs();

        for (int i = 0; i < ListOfSaves.Count; i++)
        {
            if ( ListOfSaves[i] == saveToRewindTo)
            {
                foundsave = true;
            }

        }

        while (lastSave != saveToRewindTo && foundsave == true)
        {

            AC.SaveSystem.DeleteSave(lastSave);
            lastSave = Options.optionsData.lastSaveID;

        }      

    }

    void RewindToBeginning()
    {


        List<SaveFile> ListOfSaves = new List<SaveFile>();
        ListOfSaves = KickStarter.saveSystem.foundSaveFiles;

        for (int i = 0; i < ListOfSaves.Count; i++)
        {

                AC.SaveSystem.DeleteSave(ListOfSaves[i].saveID);

        }

        ResetDialogueDatabase();
    }

    void ResetDialogueDatabase()
    {

        PixelCrushers.DialogueSystem.PersistentDataManager.Reset(PixelCrushers.DialogueSystem.DatabaseResetOptions.KeepAllLoaded);

    }

}

Why can we no longer access lastSaveID and GetPreviousSaveIDs?

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.