Issue Saving Custom Class Lists

Discussion and help for Easy Save 3
Post Reply
amy
Posts: 3
Joined: Sun Oct 08, 2023 6:27 am

Issue Saving Custom Class Lists

Post by amy »

Hello! Long time user of Easy Save, running into a bit of an issue, and hoping for some guidance.

I'm trying to save a List of custom objects, which also contain lists of custom objects. I've done this elsewhere in my project without issue, but for an unknown reason this time the objects within the list aren't saving correctly and, upon checking the .es3 file, my list of objects is just saving as a list of null objects. I've tried adding the necessary classes for both the list of objects, as well as the nested lists, via the Types tab in the ES3 menu, but I'm still getting null reference exceptions all over the place when I try to load and use these objects :cry:

I've browsed the documentation, but I think I must still be missing something - is there any additional step I should be taking to save lists of custom classes, with nested lists?

Otherwise, I have a little test project I've managed to reproduce the issue in, I can DM you a download link to it if that would be helpful :) Thank you!!
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Issue Saving Custom Class Lists

Post by Joel »

Hi Amy, thanks for getting in contact.

That's very strange, we have no reported issues with saving and loading nested lists (as long as there's enough type data for Easy Save to know the types of the elements in the inner list then there shouldn't be an issue).

Firstly please could you show me some more information about how you're saving your custom lists, what the custom classes are, etc. We only usually take a look at test projects as a last resort as they usually take a while to download, unpack, recompile and understand :)

Also are you getting any warnings in the console?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
amy
Posts: 3
Joined: Sun Oct 08, 2023 6:27 am

Re: Issue Saving Custom Class Lists

Post by amy »

Hello, this one was a silly mistake on my part unfortunately (classic, as soon as I post online, I find the issue :D ) I'd mistakenly had some of my classes inheriting from monobehaviour, but was creating them like an object with new() to save, which I guess was causing issues in the saving process. Either way, fixing that resolved the issue.
Thanks anyway for your help!!
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Issue Saving Custom Class Lists

Post by Joel »

Glad you found the solution :)

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