Download

Checking default values in Editor

Hi everyone,

got a question i found no answer to yet.

I have c++ classes which i want as parents for BP classes.
Some of the properties i have to have filled with appropriate values (for example: a enum property (NONE, E_one, E_two etc) cannot have value NONE).
Is there a proposed way to implement checks on blueprint compile, so i can tell the designer/modder to fill the property with a value?

Regards

  • Algorithman

You could check all the values on begin Play and print to the log / assert if something isn’t correctly set. That’s probably the fastest way!

Unfortunately I don’t think there’s a way to print additional warnings to the blueprint compiler window… might be a feature request for the engine.

Good idea, i made a feature request. I think coders and designers alike will profit from this.
Coders get less preventable chatter and designers a better workflow.

Does’nt PostEditChangeProperty do the job ? See How to handle property updates in code? - UE4 AnswerHub

Not if you don’t touch the property.

Best example is with the ENUM:

Enum value: E_NONE, E_ONE, E_TWO

If you want E_ONE or E_TWO as valid options and you can’t get rid of E_NONE and don’t want to set the default to either E_ONE or E_TWO, compiling with E_NONE as value still succeeds.
There is no enforcement (yet) for the designer/modder that he has to choose something other than E_NONE.