Error when using reader.ReadInto<GameObject> inside an ES3Type

Discussion and help for Easy Save 3
Post Reply
gabrieljacintho
Posts: 7
Joined: Wed Apr 03, 2024 12:17 pm

Error when using reader.ReadInto<GameObject> inside an ES3Type

Post by gabrieljacintho »

I generated a ES3Type to a ObjectFactory script called "Spawner" and modified the script to use my pooling system when loading the instances previously instantiated by Spawner.

But, when I try to use the method reader.ReadInto<GameObject>, I receive a error saying "Self-assigning Read is not implemented or supported on this type."
ES3UserType_SpawnPoints.cs
(3.44 KiB) Downloaded 13 times
Can someone help me please?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Error when using reader.ReadInto<GameObject> inside an ES3Type

Post by Joel »

Hi there,

Please could you show me the error message with full stack trace so I can see on what lines the error is occurring.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
gabrieljacintho
Posts: 7
Joined: Wed Apr 03, 2024 12:17 pm

Re: Error when using reader.ReadInto<GameObject> inside an ES3Type

Post by gabrieljacintho »

Hello Joel,

Just to clarify, the SpawnPoint script is a child of Spawner script.
Spawner.cs
(19.13 KiB) Downloaded 13 times
ES3UserType_Spawner.cs
(1.99 KiB) Downloaded 12 times
SpawnPoints.cs
(3.06 KiB) Downloaded 15 times
This is the error:

Code: Select all

NotImplementedException: Self-assigning Read is not implemented or supported on this type.
ES3Types.ES3Type.ReadInto[T] (ES3Reader reader, System.Object obj) (at D:/Gabriel/Documents/Unity Projects/Ghoul-Hunt/Assets/Plugins/Easy Save 3/Scripts/Types/ES3Type.cs:41)
ES3Types.ES3ObjectType.ReadInto[T] (ES3Reader reader, System.Object obj) (at D:/Gabriel/Documents/Unity Projects/Ghoul-Hunt/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:66)
ES3Reader.ReadObject[T] (System.Object obj, ES3Types.ES3Type type) (at D:/Gabriel/Documents/Unity Projects/Ghoul-Hunt/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:243)
ES3Reader.ReadInto[T] (System.Object obj, ES3Types.ES3Type type) (at D:/Gabriel/Documents/Unity Projects/Ghoul-Hunt/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:296)
ES3Reader.ReadInto[T] (System.Object obj) (at D:/Gabriel/Documents/Unity Projects/Ghoul-Hunt/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:133)
ES3Types.ES3UserType_SpawnPoints.ReadComponent[T] (ES3Reader reader, System.Object obj) (at Assets/Easy Save 3/Types/ES3UserType_SpawnPoints.cs:76)
ES3Types.ES3ComponentType.ReadUnityObject[T] (ES3Reader reader, System.Object obj) (at D:/Gabriel/Documents/Unity Projects/Ghoul-Hunt/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ComponentType.cs:36)
ES3Types.ES3UnityObjectType.ReadObject[T] (ES3Reader reader, System.Object obj) (at D:/Gabriel/Documents/Unity Projects/Ghoul-Hunt/Assets/Plugins/Easy Save 3/Scripts/Types/ES3UnityObjectType.cs:64)
ES3Types.ES3ObjectType.ReadInto[T] (ES3Reader reader, System.Object obj) (at D:/Gabriel/Documents/Unity Projects/Ghoul-Hunt/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:75)
ES3Types.ES3ObjectType.ReadInto[T] (ES3Reader reader, System.Object obj) (at D:/Gabriel/Documents/Unity Projects/Ghoul-Hunt/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:66)
ES3Reader.ReadObject[T] (System.Object obj, ES3Types.ES3Type type) (at D:/Gabriel/Documents/Unity Projects/Ghoul-Hunt/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:243)
ES3Reader.ReadInto[T] (System.Object obj, ES3Types.ES3Type type) (at D:/Gabriel/Documents/Unity Projects/Ghoul-Hunt/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:296)
ES3Reader.ReadInto[T] (System.String key, T obj) (at D:/Gabriel/Documents/Unity Projects/Ghoul-Hunt/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:232)
ES3.LoadInto[T] (System.String key, T obj, ES3Settings settings) (at D:/Gabriel/Documents/Unity Projects/Ghoul-Hunt/Assets/Plugins/Easy Save 3/Scripts/ES3.cs:603)
FireRingStudio.Spawn.Spawner.Load (ES3Settings settings) (at Assets/_AssetBase/Scripts/Spawn/Spawner.cs:565)
FireRingStudio.Spawn.Spawner.Load () (at Assets/_AssetBase/Scripts/Spawn/Spawner.cs:613)
UnityEngine.Events.InvokableCall.Invoke () (at <b1fe495152fd4f0180f79e56e3bccacc>:0)
UnityEngine.Events.UnityEvent.Invoke () (at <b1fe495152fd4f0180f79e56e3bccacc>:0)
FireRingStudio.Save.HasSaveKeyEvents.Check () (at Assets/_AssetBase/Scripts/Save/HasSaveKeyEvents.cs:43)
UnityEngine.Events.InvokableCall.Invoke () (at <b1fe495152fd4f0180f79e56e3bccacc>:0)
UnityEngine.Events.UnityEvent.Invoke () (at <b1fe495152fd4f0180f79e56e3bccacc>:0)
FireRingStudio.TimerEvents.OnEndTimer () (at Assets/_AssetBase/Scripts/TimerEvents.cs:26)
FireRingStudio.Timer+<TimerRoutine>d__37.MoveNext () (at Assets/_AssetBase/Scripts/Timer.cs:143)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <b1fe495152fd4f0180f79e56e3bccacc>:0)
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Error when using reader.ReadInto<GameObject> inside an ES3Type

Post by Joel »

Hi there,

Please could you show me Assets/Easy Save 3/Types/ES3UserType_SpawnPoints.cs, as this is the ES3Type which is triggering it. Also just to check, have you modified ES3UserType_SpawnPoints.cs at all?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
gabrieljacintho
Posts: 7
Joined: Wed Apr 03, 2024 12:17 pm

Re: Error when using reader.ReadInto<GameObject> inside an ES3Type

Post by gabrieljacintho »

Hi Joel,

Yes, I modified the ES3Type to use my pooling system:
ES3UserType_SpawnPoints.cs
(3.44 KiB) Downloaded 15 times
Best regards,
Gabriel Jacintho
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Error when using reader.ReadInto<GameObject> inside an ES3Type

Post by Joel »

Hi there,

Have you created your own ES3Type for GameObject? If so, you will need to delete this and use the default ES3Type for it as otherwise you won't have any ReadInto functionality.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
gabrieljacintho
Posts: 7
Joined: Wed Apr 03, 2024 12:17 pm

Re: Error when using reader.ReadInto<GameObject> inside an ES3Type

Post by gabrieljacintho »

Hi Joel,

No, I didn't create my own ES3Type for GameObject.

Best regards,
Gabriel Jacintho
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Error when using reader.ReadInto<GameObject> inside an ES3Type

Post by Joel »

Hi there,

Please could you replicate this in a new project with a very simple scene using the latest version of Easy Save and send me a link to it using the form at moodkie.com/contact along with step-by-step instructions and I don't appear to be able to replicate this at my end, and I'm not sure how this could be possible without overriding the ES3Type for GameObject :)

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply