Summary
The editor behavior of components is somewhat incorrect compared to what you would normally get statically flagged at compile time in code.
Some of it was mentioned in the following report but none of it was actually addressed: [Major] Many `@editable` values cannot be set any more (Scene Graph)
Please select what you are reporting on:
Unreal Editor for Fortnite
What Type of Bug are you experiencing?
UI/Tools
Steps to Reproduce
Here’s the code to reproduce the behaviors.
vz_test_non_concrete_editables_component := class<final><final_super>(component) {
@editable
ENonConcrete: vz_non_concrete_class
@editable
ESetNonConcrete: vz_non_concrete_class = vz_non_concrete_class { Number := 42 }
@editable
EOptionalNonConcrete: ?vz_non_concrete_class
@editable
ESetOptionalNonConcrete: ?vz_non_concrete_class = false
@editable
ENonConcreteArray: []vz_non_concrete_class
}
vz_non_concrete_class := class {
@editable
Number: int
}
Expected Result
NonConcrete
field should saySet to Value
EOptionalNonConcrete
field’s drop down options should presentNone
as an optionESetOptionalNonConcrete
should be set toNone
- All fields that have no default value in code should have NO default value assigned by the editor, regardless of the type being
concrete
(source of bugs). Therefore theNumber
field should saySet to Value
instead of0
. Index [...]
element ofENonConcreteArray
should not default to the base class.- When a value is not set, it should say
Set to Value
instead ofNone
.None
should be reserved for representingfalse
of an optional type of if potentially anenum
with an explicitNone
case.
Observed Result
ENonConcrete
field saysNone
, but it really should be sayingSet to Value
EOptionalNonConcrete
field correctly saysSet to Value
but the drop down menu does not provide theNone
as an option. The type is?vz_non_concrete_class
sofalse
akaNone
should be an optionESetOptionalNonConcrete
incorrectly saysSet to Value
, but it really should sayNone
as the value is explicitly set in code tofalse
ENonConcreteArray
automatically assumes we want to use thevz_non_concrete_class
class as its new element even if there could be more subclasses. Additionally if we set the the type to the class, allconcrete
fields are automatically initialized with a default value, this is a source of bugs. In code initialization process is explicit for a good reason and types without a value, even if they areconcrete
cannot be omitted from the explicit user written initialization process. The editor circumvents this by giving types that areconcrete
a sort of “convenience”, but in reality this will lead to wrongly / unintentionally set values when using the editor workflow.
Platform(s)
PC / UEFN