Recompiling C++ corrupted BP variables

Hey there,

After yet another recompiling my C++ project the editor prevents me from PIE because some variables got invalid and asks for removing them. The catastroph is:

  1. Those variables contained some essential info about all classes of creatures in my game. I assumed it wasn’t sane to type all their uproperty fields in editor, but I couldn’t imagine any scalable alternative.
  2. The C++ parent of the affected BP wasn’t actually modified before the recompiling… except for one thing. I’ve changed the encoding of .h file with the struct my variables belonged to. But after the first occurence (PIE crashed the editor so nothing was saved anyway) I reverted the codepage and recompiled the project again, but the variables are still “of invalid type Structure”.

So the exact questions are:

  1. What the hell was this?!
  2. How could I restore or at least see the values of these variables “of invalid type”?
  3. What is the best way to avoid such accidents? I’d like to use config files, I know “config” parameter of UCLASS but I need this for a USTRUCT or rather for a TMap with these ustructs.

Do you do any hot reloading? If yes, then avoid editing blueprints during those, as it tend to corrupt blueprints due to changes you make. Always do clean compilation with editor turned off before starting editing them

What types does turned in to invalid?

Maybe. Last successful session had several hot reloads but none of them changed the affected struct, nor the BP was edited. The codepage change was made with no editor. Nevertheless I read my blueprint .uasset file in HEX editor and found some “HOTRELOADED” text fragments.

Type turned invalid is USTRUCT(BlueprintType) - with a dozen of plain uproperties, no UObject pointers, no other ustructs fields inside.