I havn't had this issue before upgrading, now I am seeing this error with the latest version.
"The data you are trying to load does not match the Load method you are using to load it."
I need some help figuring out what the problem is as I have no clue.
The saves works correctly without errors, after running the game many times, this error starts to show up.
The data does save and load without issue (as far as i can see, not 100%) but this error consistently appears.
The data you are trying to load does not match the Load meth
Re: The data you are trying to load does not match the Load
Hi there,
Please could you provide a sample script or create a new project which exhibits the error and PM it to me so I can replicate it? We've had no other reports of this error occurring unnecessarily.
Also you may want to open the file in the File Editor and check that the type of data in the file is what you expect.
All the best,
Joel
Please could you provide a sample script or create a new project which exhibits the error and PM it to me so I can replicate it? We've had no other reports of this error occurring unnecessarily.
Also you may want to open the file in the File Editor and check that the type of data in the file is what you expect.
All the best,
Joel
Re: The data you are trying to load does not match the Load
Code: Select all
if (ES2.Exists (path)) {
saveProp = ES2.LoadList<ItemProperties> (path);
//error happens as soon as the line above is called
}
I was seeing this error in the editor and then I deleted all saves now the error is gone and hasn't happened yet.
While on the device, this error started showing today after a week of use.
I am unable to open the file in editor because it is a custom data type and view is not supported.
Re: The data you are trying to load does not match the Load
Could you please provide some details as to what this error is and what it implies to saving / loading?
Because even with this error, I can still save and still see my data loading. What are the impacts of the error?
Because even with this error, I can still save and still see my data loading. What are the impacts of the error?
Re: The data you are trying to load does not match the Load
Our code checks the type stored in the header of the tag written for the file, and if it does't match the type specified when loading, the error is thrown. Typically Unity stops execution of that script when Debug.LogError is triggered, so I'm not sure why it's continuing execution afterwards.
Firstly, you should check that nothing of a different type is being saved to the same tag in your code. You might want to do a search, just incase there's a script you've used for development.
Secondly, you should check that the type you're saving is actually a List<ItemProperties>, and not a List of some subclass/parent class of ItemProperties. Something along the lines of:
When it happens again, it might be worth sending me the save file and a basic project which loads from the file and causes the error, so I can test it at my end.
All the best,
Joel
Firstly, you should check that nothing of a different type is being saved to the same tag in your code. You might want to do a search, just incase there's a script you've used for development.
Secondly, you should check that the type you're saving is actually a List<ItemProperties>, and not a List of some subclass/parent class of ItemProperties. Something along the lines of:
if(saveProp.GetType() != typeof(List<ItemProperties>)) Debug.LogError("saveProp is *not* a List<ItemProperties>"); else Debug.Log("saveProp is a List<ItemProperties>");The error seems very strange, especially given the functionality for this hasn't changed in 4 years, and we've never come across this being triggered erroneously.
When it happens again, it might be worth sending me the save file and a basic project which loads from the file and causes the error, so I can test it at my end.
All the best,
Joel
Re: The data you are trying to load does not match the Load
if (ES2.LoadList<CurrencyData> (path).GetType() != typeof(List<CurrencyData>)) { Debug.Log ("NOT CURRENCY"); } else { Debug.Log ("IS CURRENCY"); } List<CurrencyData> tmp = ES2.LoadList<CurrencyData> (path);So I added your suggested check and it returns valid expected data type. However, error is at both loads.
Re: The data you are trying to load does not match the Load
Hi there,
I apologise, I should've been more clear. You would need to use that code when saving the data, to ensure that the data saved is the type you expect.
Also if the error is intermittent, this will only flag up when the particular save happens which causes the data to be incorrect.
All the best,
Joel
I apologise, I should've been more clear. You would need to use that code when saving the data, to ensure that the data saved is the type you expect.
Also if the error is intermittent, this will only flag up when the particular save happens which causes the data to be incorrect.
All the best,
Joel