I have been using Easy Save for the past couple of months. Overall it's been an ok experience. However, I have had a massive error within the last 24 hours. So I have been saving scriptable objects as .byte files. Up until now I haven't had many issues. I have released several patches where people can move saves across for our alpha. It's worked every time (minus some errors from my side). However, the last patch I never changed the saving/loading code manager. But now it is throwing this error.
FormatException: Expected '{' or "null", found '0'.
ES3Internal.ES3JSONReader.ReadNullOrCharIgnoreWhitespace (System.Char expectedChar)
I have traced it to this line (worked in all previous patches till now) ScriptableObject Item = ES3.Load<ScriptableObject>("Item", File);
There is nothing wrong with the encryption password as I have not changed that.
FormatException: Expected '{' or "null", found '0'. ES3Internal.ES3JSONReader.ReadNullOrCharIgnoreWhitespace (System.Cha
-
- Posts: 5
- Joined: Sat Nov 28, 2020 7:29 pm
Re: FormatException: Expected '{' or "null", found '0'. ES3Internal.ES3JSONReader.ReadNullOrCharIgnoreWhitespace (System
Hi there,
You should provide the type of the ScriptableObject to the ES3.Load method. I.e. ES3.Load<MyType> rather than ES3.Load<MyScriptableObject>.
If this doesn't resolve your issue, please could you send over the ScriptableObject you are saving, and also your save file (found in Window > Easy Save 3 > Tools > Open Persistent Data Path).
All the best,
Joel
You should provide the type of the ScriptableObject to the ES3.Load method. I.e. ES3.Load<MyType> rather than ES3.Load<MyScriptableObject>.
If this doesn't resolve your issue, please could you send over the ScriptableObject you are saving, and also your save file (found in Window > Easy Save 3 > Tools > Open Persistent Data Path).
All the best,
Joel
-
- Posts: 5
- Joined: Sat Nov 28, 2020 7:29 pm
Re: FormatException: Expected '{' or "null", found '0'. ES3Internal.ES3JSONReader.ReadNullOrCharIgnoreWhitespace (System
Thanks, I will look into that fix. However, it was originally a specific SO type which didn't work then I put into a universal SO type then cast it. But I will try that and get back to you thank you!
Re: FormatException: Expected '{' or "null", found '0'. ES3Internal.ES3JSONReader.ReadNullOrCharIgnoreWhitespace (System
If that and deleting your save data doesn't resolve your issue, if you could create a new project with a basic scene which replicates it I'll be happy to look into it further.
All the best,
Joel
All the best,
Joel
-
- Posts: 5
- Joined: Sat Nov 28, 2020 7:29 pm
Re: FormatException: Expected '{' or "null", found '0'. ES3Internal.ES3JSONReader.ReadNullOrCharIgnoreWhitespace (System
Ok, so converting it from the base scriptableobject to a specific didn't fix it as the save files have been saved as the base scriptable object error shown below:
InvalidOperationException: Trying to load data of type BaseItem, but data contained in file is type of UnityEngine.ScriptableObject
However, there is no files within the persistence data directory. Overall this was an unforeseen issue as I have been using this system and adding new items and so on for the last 2 months without issues till now.
Also side note to consider. Without changing the code in any shape or form. We are able to start a new save for the game and continue playing from there. However, some of our earlier players have limited edition items from halloween and so on. So also then checked the old items in the saving system with a new save and they saved fine. I'll send over the items we are saving. However they are encrypted with AES the temp password is : password. Also is a screenshot of the persistent data path
InvalidOperationException: Trying to load data of type BaseItem, but data contained in file is type of UnityEngine.ScriptableObject
However, there is no files within the persistence data directory. Overall this was an unforeseen issue as I have been using this system and adding new items and so on for the last 2 months without issues till now.
Also side note to consider. Without changing the code in any shape or form. We are able to start a new save for the game and continue playing from there. However, some of our earlier players have limited edition items from halloween and so on. So also then checked the old items in the saving system with a new save and they saved fine. I'll send over the items we are saving. However they are encrypted with AES the temp password is : password. Also is a screenshot of the persistent data path
- Attachments
-
- Capture.PNG (3.43 KiB) Viewed 1394 times
-
- GameSaves.zip
- (1.32 MiB) Downloaded 99 times
Re: FormatException: Expected '{' or "null", found '0'. ES3Internal.ES3JSONReader.ReadNullOrCharIgnoreWhitespace (System
Hi there,
The error message you're getting is likely because you've saved it using ScriptableObject as the generic parameter. You would need to delete the save data you've created where you've used ScriptableObject as the generic parameter.
Unfortunately I wouldn't be able to determine the issue from the save files. Please could you send me a very basic project which replicates your issue?
All the best,
Joel
The error message you're getting is likely because you've saved it using ScriptableObject as the generic parameter. You would need to delete the save data you've created where you've used ScriptableObject as the generic parameter.
Unfortunately I wouldn't be able to determine the issue from the save files. Please could you send me a very basic project which replicates your issue?
All the best,
Joel
-
- Posts: 5
- Joined: Sat Nov 28, 2020 7:29 pm
Re: FormatException: Expected '{' or "null", found '0'. ES3Internal.ES3JSONReader.ReadNullOrCharIgnoreWhitespace (System
Hello Joel,
As to your last statement, I am slightly confused. The generic parameter would of caused an issue months ago if that was the case. We are saving and loading as a scriptableobject (generic) then when we load it we cast it as a specified type. This has worked on public builds for months. It's only since the last patch that it decided that there was an error. However, it works with a fresh save. So we have resorted to manually creating new saves for our supporters. Which was last resort. So I have no idea how you are coming to the conclusion that it's the generic parameter that is the issue if it hasn't caused an error till now.
As to your last statement, I am slightly confused. The generic parameter would of caused an issue months ago if that was the case. We are saving and loading as a scriptableobject (generic) then when we load it we cast it as a specified type. This has worked on public builds for months. It's only since the last patch that it decided that there was an error. However, it works with a fresh save. So we have resorted to manually creating new saves for our supporters. Which was last resort. So I have no idea how you are coming to the conclusion that it's the generic parameter that is the issue if it hasn't caused an error till now.
Re: FormatException: Expected '{' or "null", found '0'. ES3Internal.ES3JSONReader.ReadNullOrCharIgnoreWhitespace (System
Hi there,
Just to clarify, my message was about this error message (which differs from your original error message, which is the longer term one):
Regarding your original error message. I.e.:
All the best,
Joel
Just to clarify, my message was about this error message (which differs from your original error message, which is the longer term one):
This is absolutely caused by the mismatch of generic parameters and cannot be caused by anything elseInvalidOperationException: Trying to load data of type BaseItem, but data contained in file is type of UnityEngine.ScriptableObject
Regarding your original error message. I.e.:
As mentioned, I would need to see a basic project which replicates it to draw any conclusions about this.FormatException: Expected '{' or "null", found '0'.
ES3Internal.ES3JSONReader.ReadNullOrCharIgnoreWhitespace (System.Char expectedChar)
All the best,
Joel