Incorrect saving/loading of string (a URL) results in: FormatException: Expected '{' or "null", found '"'. When loading.
Posted: Tue Apr 20, 2021 10:04 pm
I am trying to use Easy Save to save a URL, and load it when the game is started. Very basic. I am using the latest version of Easy Save and the code given on this page: https://docs.moodkie.com/easy-save-3/getting-started/
However, I am getting an error.
Here is the input string (a URL for an avatar download): https://d1a370nemizbjq.cloudfront.net/2 ... 3c5b58.glb
Here is what gets saved in "SaveFile.es3":
{
"avatarUrl" : {
"__type" : "string",
"value" : "https:\/\/d1a370nemizbjq.cloudfront.net\/24c09e08-f879-4147-9b27-6b05473c5b58.glb"
}
}
When I try to load the string when the game starts, I get this error:
FormatException: Expected '{' or "null", found '"'.
ES3Internal.ES3JSONReader.ReadNullOrCharIgnoreWhitespace (System.Char expectedChar) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:357)
ES3Internal.ES3JSONReader.StartReadObject () (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:111)
ES3Reader.ReadObject[T] (System.Object obj, ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:236)
ES3Reader.ReadInto[T] (System.Object obj, ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:292)
ES3Reader.ReadInto[T] (System.String key, T obj) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:228)
ES3.LoadInto[T] (System.String key, T obj, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:536)
ES3.LoadInto[T] (System.String key, T obj) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:491)
GameManager.Awake () (at Assets/_Scripts/GameManager.cs:45)
Could you please advise in how to fix this?
However, I am getting an error.
Here is the input string (a URL for an avatar download): https://d1a370nemizbjq.cloudfront.net/2 ... 3c5b58.glb
Here is what gets saved in "SaveFile.es3":
{
"avatarUrl" : {
"__type" : "string",
"value" : "https:\/\/d1a370nemizbjq.cloudfront.net\/24c09e08-f879-4147-9b27-6b05473c5b58.glb"
}
}
When I try to load the string when the game starts, I get this error:
FormatException: Expected '{' or "null", found '"'.
ES3Internal.ES3JSONReader.ReadNullOrCharIgnoreWhitespace (System.Char expectedChar) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:357)
ES3Internal.ES3JSONReader.StartReadObject () (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:111)
ES3Reader.ReadObject[T] (System.Object obj, ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:236)
ES3Reader.ReadInto[T] (System.Object obj, ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:292)
ES3Reader.ReadInto[T] (System.String key, T obj) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:228)
ES3.LoadInto[T] (System.String key, T obj, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:536)
ES3.LoadInto[T] (System.String key, T obj) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:491)
GameManager.Awake () (at Assets/_Scripts/GameManager.cs:45)
Could you please advise in how to fix this?