Unintelligible Warning

Discussion and help for Easy Save 3
Post Reply
petaaaaa
Posts: 8
Joined: Thu Sep 07, 2023 1:23 pm

Unintelligible Warning

Post by petaaaaa »

Code: Select all

List<GameObject> buildObjGameObject= ES3.Load<List<GameObject>>("buildObjGameObject", saveFileName);
This code will trigger the following error

Code: Select all

Adding component failed. Add required component of type 'BoxCollider' or 'CapsuleCollider' or 'CharacterController' or 'MeshCollider' or 'SphereCollider' or 'TerrainCollider' or 'WheelCollider' to the game object 'ObjectName' first.
UnityEngine.GameObject:AddComponent (System.Type)
I don't know what this Warning requesting
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Unintelligible Warning

Post by Joel »

Hi there,

I've not seen this error before. Is there a stack trace with the error with line numbers?
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
petaaaaa
Posts: 8
Joined: Thu Sep 07, 2023 1:23 pm

Re: Unintelligible Warning

Post by petaaaaa »

Here is a detailed message.

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
ES3Types.ES3UserType_BuildObj.ReadComponent[T] (ES3Reader reader, System.Object obj) (at Assets/Easy Save 3/Types/ES3UserType_BuildObj.cs:43)
ES3Types.ES3ComponentType.ReadUnityObject[T] (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ComponentType.cs:36)
ES3Types.ES3UnityObjectType.ReadObject[T] (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3UnityObjectType.cs:64)
ES3Types.ES3ObjectType.ReadInto[T] (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:75)
ES3Types.ES3Type_GameObject.ReadComponents (ES3Reader reader, UnityEngine.GameObject go) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:233)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:176)
ES3Types.ES3ObjectType.ReadInto[T] (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:75)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:136)
ES3Types.ES3ObjectType.Read[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:52)
ES3Reader.ReadObject[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:253)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:282)
ES3Types.ES3ListType.Read (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ListType.cs:64)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Reader.Read[T] (System.String key) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:201)
ES3.Load[T] (System.String key, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:459)
ES3.Load[T] (System.String key, System.String filePath) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:433)
petaaaaa
Posts: 8
Joined: Thu Sep 07, 2023 1:23 pm

Re: Unintelligible Warning

Post by petaaaaa »

This will add a
NavMeshObstacle attached to the game object you are trying to save.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Unintelligible Warning

Post by Joel »

Hi there,

This appears to be a different error message to the one you posted in your first message. This second error message is a Null reference exception. Could you explain what error you're trying to resolve?
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
petaaaaa
Posts: 8
Joined: Thu Sep 07, 2023 1:23 pm

Re: Unintelligible Warning

Post by petaaaaa »

Our apologies.

When this happens, I get one log and one error message.
My second post was the error message one. So I will send you the log again.

Code: Select all

Adding component failed. Add required component of type 'BoxCollider' or 'CapsuleCollider' or 'CharacterController' or 'MeshCollider' or 'SphereCollider' or 'TerrainCollider' or 'WheelCollider' to the game object '1_BuildObjPCTable(Clone)' first.
UnityEngine.GameObject:AddComponent (System.Type)
ES3Types.ES3Type_GameObject:ReadComponents (ES3Reader,UnityEngine.GameObject) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:232)
ES3Types.ES3Type_GameObject:ReadObject<object> (ES3Reader,object) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:176)
ES3Types.ES3ObjectType:ReadInto<object> (ES3Reader,object) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:75)
ES3Types.ES3Type_GameObject:ReadObject<object> (ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:136)
ES3Types.ES3ObjectType:Read<object> (ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:52)
ES3Reader:ReadObject<object> (ES3Types.ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:253)
ES3Reader:Read<object> (ES3Types.ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:282)
ES3Types.ES3ListType:Read (ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ListType.cs:64)
ES3Reader:Read<System.Collections.Generic.List`1<UnityEngine.GameObject>> (ES3Types.ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Reader:Read<System.Collections.Generic.List`1<UnityEngine.GameObject>> (string) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:201)
ES3:Load<System.Collections.Generic.List`1<UnityEngine.GameObject>> (string,ES3Settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:459)
ES3:Load<System.Collections.Generic.List`1<UnityEngine.GameObject>> (string,string) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:433)
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Unintelligible Warning

Post by Joel »

Thanks for sending that over, much appreciated.

This occurs because there is a Component on your GameObject (specifically 1_BuildObjPCTable(Clone)) which requires there to also be a Collider on your GameObject before it can be added. It's likely that the Collider is being loaded after this Component, causing the error.

In this case you would need to ensure that the Collider is above the Component which requires a Collider so that it gets loaded in the correct order.
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
petaaaaa
Posts: 8
Joined: Thu Sep 07, 2023 1:23 pm

Re: Unintelligible Warning

Post by petaaaaa »

This was a problem with RequireComponent.
Perhaps specifying multiple components in RequireComponent caused the error
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Unintelligible Warning

Post by Joel »

Glad you managed to resolve the issue.

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