Forum rules - please read before posting.

Error deleting autosave

edited June 2020 in Engine development

Deleting an autosave when it's the only existing save, causes AC to crash. I'm attaching a test actionlist I created to verify this issue. Game crashes on action (3). The autosave is deleted, but the actionlist never gets to (4).

https://imgur.com/a/EwznomD

Comments

  • Ah I forgot, the error is:

    ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <567df3e0919241ba98db88bec4c6696f>:0)
    AC.SaveSystem.DeleteSave (System.Int32 elementSlot, System.Int32 saveID, System.Boolean useSaveID) (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:2275)
    AC.ActionManageSaves.Run () (at Assets/AdventureCreator/Scripts/Actions/ActionManageSaves.cs:128)
    AC.ActionList+<RunAction>d__34.MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:377)
    
  • I tried to add a dummy save to avoid this issue. It works, but the strange thing is that when I delete my autosave via the actionlist, the dummy save is deleted as well.

  • Open up ActionManageSaves.cs, and find (around line 90):

    SaveSystem.DeleteSave (0);
    

    And replace it with:

    SaveSystem.DeleteSave (0); return 0f;
    

    Does that solve the issue?

  • Yes, that did it. :smile:

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.