ArgumentOutofRangeException Error

Discussion and help for Easy Save 3
Post Reply
RonDMC
Posts: 7
Joined: Thu Nov 23, 2017 12:56 am

ArgumentOutofRangeException Error

Post by RonDMC »

I'm getting a bunch of these errors when trying to build out my game. They all look like this and seem to be tied to the Easy Save 3 Manager.

Code: Select all

ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[UnityEngine.Object].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
ES3Internal.ES3SerializableDictionary`2+Enumerator[System.Int64,UnityEngine.Object].MoveNext () (at Assets/Plugins/Easy Save 3/Scripts/ES3SerializableDictionary.cs:204)
System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[System.Collections.Generic.KeyValuePair`2[System.Int64,UnityEngine.Object]].MoveNext ()
System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[System.Collections.Generic.KeyValuePair`2[System.Int64,UnityEngine.Object],System.Int64].MoveNext ()
System.Collections.Generic.List`1[System.Int64].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
System.Collections.Generic.List`1[System.Int64]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
System.Linq.Enumerable.ToList[Int64] (IEnumerable`1 source)
ES3Internal.ES3IdRefDictionary.RemoveNullValues () (at Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs:237)
ES3ReferenceMgr.GenerateReferences () (at Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgr.cs:33)
ES3ReferenceMgrEditor.OnInspectorGUI () (at Assets/Plugins/Easy Save 3/Editor/ES3ReferenceMgrEditor.cs:86)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1253)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Do I need the manager if I'm saving/loading specific variables from a different script? Or is there a fix/explanation for the error? I can't seem to figure it out.
User avatar
Joel
Moodkie Staff
Posts: 4824
Joined: Wed Nov 07, 2012 10:32 pm

Re: ArgumentOutofRangeException Error

Post by Joel »

Hi Ron,

I've received an error report regading this before, but was not sent a project which replicates it. Would you be able to PM me a project which replicates it so I can try to work out what's going on?

You should be safe to remove the Easy Save 3 Manager if you're not saving references, or classes which contain references. You can go to Window > Easy Save 3 > Settings and unchecking Auto Add Manager to Scene.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
RonDMC
Posts: 7
Joined: Thu Nov 23, 2017 12:56 am

Re: ArgumentOutofRangeException Error

Post by RonDMC »

Sent the PM. Please let me know if you find the issue and thanks for looking into it. Hope the project files helps.
User avatar
Joel
Moodkie Staff
Posts: 4824
Joined: Wed Nov 07, 2012 10:32 pm

Re: ArgumentOutofRangeException Error

Post by Joel »

Thanks for sending that over, much appreciated!

I've managed to find the issue. It looks like there's an edge case where null values will not be removed from the reference manager. This will be fixed in the next update, but in the meantime I've created a fix for this and PM'd it over to you.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
RonDMC
Posts: 7
Joined: Thu Nov 23, 2017 12:56 am

Re: ArgumentOutofRangeException Error

Post by RonDMC »

Hi Joel.

Unfortunately, I don't think the fix worked. If I delete the Save Manager and create a new one, I'll get multiple errors like the one below:

Code: Select all

Could not extract GUID in text file Assets/Scenes/StartScreen.unity at line 1247.
I then have to open the scene in Notepad++ and have to manually delete the lines in question.
Unity will then return the ArgumentOutofRange error again after a build or Refreshing References.

The GUID error will also prevent a build.

This was all tested after applying the fix you gave me.
User avatar
Joel
Moodkie Staff
Posts: 4824
Joined: Wed Nov 07, 2012 10:32 pm

Re: ArgumentOutofRangeException Error

Post by Joel »

Hi Ron,

That's very strange, I don't seem to be getting this at my end with your project.

The error suggests that there was an issue with the Asset Store importer corrupting a GUID, as Easy Save does not have any affect on the GUIDs of objects. The only thing I can think which might cause this is because the UnityPackage was created with Unity 5.6 rather than 2017.3, though UnityPackages are supposed to work between versions. Just incase, I've PM'd you a UnityPackage created with 2017.3.

If this doesn't fix your issue, please could you send me another project over? Preferably with the "Could not extract GUID" error?

Many thanks for your patience,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply