Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SaveGame UPROPERTY on type TSubclassOf is treated incorrectly #14

Closed
rfsheffer opened this issue Aug 19, 2021 · 4 comments
Closed

SaveGame UPROPERTY on type TSubclassOf is treated incorrectly #14

rfsheffer opened this issue Aug 19, 2021 · 4 comments

Comments

@rfsheffer
Copy link

Currently the system does not support TSubClassOf for saving, but if somebody sets a TSubClassOf as a savable property it treats it like a non-actor UObject. The save/restore process acts like it saved the property correctly tho what is saved is just a class identification (tho incorrect) and nothing is restored on load. It should throw the general "unsupported type" error instead.

Cheers and thanks for the great plugin :)
Ryan

@rfsheffer
Copy link
Author

I need TSubClassOf saved in my own stuff and the way I differentiate the field is to simply change the CastField to ExactCastField in TryWriteUObjectPropertyData and TryReadUObjectPropertyData.

@sinbad
Copy link
Owner

sinbad commented Aug 21, 2021

So presumably on restore you instantiate the referenced object yourself? SPUD won't be able to really - even if we derived the concrete runtime type, it could be from somewhere we don't have access to like your own code or a plugin.

@rfsheffer
Copy link
Author

As long as the type is loaded as in the module has been linked the class reference can be made. Wheather it be a blueprint dynamic class or native. I cannot see any reason for TSubClassOf to not be serializable and restored to the property. I am doing it in custom code however. Anyway, this issue is just to mention TSubClassOf is false possitively saved and restored.

@sinbad
Copy link
Owner

sinbad commented Aug 23, 2021

OK, I've added official support for TSubclassOf properties.

@sinbad sinbad closed this as completed Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants