Using FOnlineJsonSerializable on a struct
I'm trying to serialize a very simple struct, but I'm guessing UE4's preproccessor scripts are borking this.
My compilation error:
Just below this struct I have a class that extends FOnlineJsonSerializable, and that compiles just fine, so it definitely has a reference to FOnlineJsonSerializable, I'm guessing this is a bug with the preprocessors.
Has anyone seen this or found a workaround? This is currently blocking me, and I'd rather not have to write a custom serializer method.
Thanks for any help!
This is an old question now, but I ran into this issue and found the problem and an alternate solution. The issue is that the type is not a
TL;DR: It can't find the struct because it hasn't preprocessed it.
If you absolutely need the type to take advantage of the preprocessor (eg. make it exposed to Blueprint), you can make it a
But if you don't need your type to take advantage of the preprocessor, just making it a regular old struct will do the job. Eg.
You can still use it as you would any other C++ struct, because that's exactly what it is. You don't even have to use the prefix if you don't want to, the preprocessor won't enforce it.
Hope this helps someone, happy coding.
answered May 18 '16 at 06:15 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here