Invalid cast on byte[] fields

Discussion and help for Easy Save 3
Post Reply
gyst
Posts: 1
Joined: Sat Jun 15, 2019 12:06 pm

Invalid cast on byte[] fields

Post by gyst »

I'm using ES3 in my game and I absolutely love it, but I recently encountered a problem and I'm wondering if anyone here can help me out.

I have a custom class, which I save to and load from. I recently added a field of type byte[], and now when I try to load the saved file I receive an "Invalid cast" error. No error is generated when saving the file, but I can't 100% confirm that the save was successful without being able to load it again.

I can work around this problem by converting my byte[] field to List<byte>, but ideally I'd like to be able to a byte[] field directly.

Please note that I want to save this field as part of my custom class (I know there are other tools for saving byte[]s directly. I'm looking for some way to save it as part of a custom class).

Any thoughts?

Thanks!
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Invalid cast on byte[] fields

Post by Joel »

Hi there,

If you've created an ES3Type for your class, you should just need to go the Types pane, press Reset to Default, and then create the ES3Type again.

If you are not using an ES3Type, the change of type should be handled by default. If this is not the case, please could you create a new project which replicates it and Pm it to me?

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