Serialization Bug

Summary

when using a custom device class to hold and editable of a common class that references another custom device this references can be “set” in the editor but when testing in a session is defaulted as if it was set to “none”.

Please select what you are reporting on:

Unreal Editor for Fortnite

What Type of Bug are you experiencing?

Devices

Steps to Reproduce

Drop the 2 devices in the editor.
Set the references
Change the default name of both so they are different.
Test in a session.

Expected Result

See logs like:
“OnBegin from custom_creative_device:”
“Name: CustomName”
“OnBegin from serialization_test:”
“Ref Class Name: NewRefName”
“Name: CustomName”

Observed Result

Logs look like:
“OnBegin from custom_creative_device:”
“Name: CustomName”
“OnBegin from serialization_test:”
“Ref Class Name: NewRefName”
“Name: DefaultName”

Platform(s)

windows

Upload an image


Additional Notes

Code used to reproduce this:

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

serialization_test := class(creative_device):
    @editable
    RefClass : reference_class = reference_class{}

    OnBegin<override>()<suspends>:void=
            Sleep(0.2)
            Print("OnBegin from serialization_test:")
            Print("Ref Class Name: {RefClass.Name}")
            Print("Name: {RefClass.CustomDevice.Name}")

reference_class := class():
    @editable
    Name : string = "DefaultName"
    @editable
    CustomDevice : custom_creative_device = custom_creative_device{}

custom_creative_device := class(creative_device):
    @editable
    Name : string = "DefaultName"

    OnBegin<override>():void=
        Print("OnBegin from custom_creative_device:")
        Print("Name: {Name}")

One thing I noticed while testing this in the new version 33.30.
If you launch a session with the reference not set yet.


Then set it and test it without pushing the changes

It “works” as expected.

But as soon as you push the changes

The problem returns.

Losing the reference of the custom device to “none”. It’s not visible in the editor as it’s bugged showing the “reference” but it’s not. If you try to clear it nothing happens.

To set it again you can:

  • Revert the file with revision control and set it again
  • Have another “custom device” that you can reference, and go back and forth between those.
  • Reopen the project and set it.

I’ll see if I can get someone to take a look.