[4.7.3] Struct default values get reset after closing project or compiling

The fix is not yet in 4.7.4, right? I really need it :frowning:

Hey John,

You’re right, this is not in 4.7.4. I looked into this further and it will be included in the 4.8 release. I know this isn’t ideal but I believe it is due to multiple struct fixes that are being pushed into that branch.

But 4.8 will include new bugs and I am pretty sure I won’t be able to use 4.8 before something like 4.8.3, same as I could not use 4.7 before 4.7.3. Is there really no possibility to put this fix into 4.7.4? I don’t want to wait like 2 months (until I can use 4.8) to be able to play my game again, since this bug really does not let me play the game :frowning:

And this is affecting many people, more exactly everyone who want’s to use blueprint structs in 4.7.1 or 4.7.2 or 4.7.3 or 4.7.4. So all these people (including me) can neither play the game nor package the game for others. Isn’t this critical enough for a hotfix?

Well this is good news. While I was researching the Github fix that could be merged into source, the developers added it to the 4.7.4 release build. Which will be released very soon.

This is indeed good news, thanks a lot! :slight_smile:

Just made some tests with 4.7.4 and there are still issues.

It works if you have no inheritance (one BP class with no children). But if you have inherited BPs using some struct from the parent and you set the values to new values, then a bug that appears to be related occurs (click compile and some values are then zeroed and flagged as changed).

Here’s and example with 3 classes:

Base Blueprint Class: GameplayObject

GameplayObject Children Class: Item

Item Children Class: MedKitSmall

37160-showclasses.gif

Now let’s change the value of some variable in the Item and MedKitSmall class structs. Hit compile and this is the result:

37161-changevalues.gif

In the Item class struct, the Mesh and Icon variables have been zeroed and marked as changed. When I change the name in the struct inside the MedKitSmall from Item to MedKitSmall, the values of Type and Interaction are then zeroed.

In the MedKitSmall class struct, If I change the name to something and then back to Item and hit compile, the Name variable gets zeroed as well…

37162-medkitnamebug.gif

Something is definitively wrong with inheritance and struct default values.

Hope this helps!

This is another story that was fixed by my coworker in PR 779 and PR 856.

Any chance for them to get integrated into 4.7.5? Epic started merging commits into the 4.7 branch, so this means there will be a 4.7.5 :slight_smile:

I can confirm that the bug is unfortunately not fixed.

Hi Onoa,

From looking at the gifs you posted, it looks like you are in a version previous to 4.7. I just tested this in 4.7.4 but I’m unable to reproduce your results. Is it only happening with specific variable or is it random?

Hi TJ,

I’m using the latest version, but with the Single Blueprint Layout Editor turned off in the General Experimental section of the Editor Config (I prefer this layout style compared to the new one).

http://puu.sh/h0nOM/d9208df3a3.png

It’s not random, I get this kind of behavior systematically when using structs inside classes that have inheritance. Some of these structs have been created a while ago, and in the past I have had some issues with existing structs when updating to a new version.

I will try to create another example from scratch and see if the issue is still present or if it only occur with older data.

Here’s a sample project where you can test it.

Just open one of the child classes (Item or Sword), and change one default value and hit compile.

Thanks,

HI Onoa,

I’m sorry it’s been a few days and thank you for uploading the test project. I converted it to our latest internal build and it fixed the issue. You should see this working properly in the 4.8 update when it releases.

Cheers,

TJ

Great!

Thanks!

Why will you not put the fix in 4.7.6? Why do you want 4.7 to stay unusable with structs forever? I would like to have a stable version I can work in and I am quite sure 4.8 will introduce new bugs like this where I have to wait until 4.9 or many hotfixes till they are fixed… And at the moment this struct bug is the only really critical bug in 4.7, at least for me. So if this would be fixed I could use 4.7 properly until 4.8.4 or whatever first usable version of 4.8 will be released.

I encountered this same problem just now, although it is limited to just the enum of a struct resetting for me. I found a work around for it, which is not the most ideal solution, but it beats trying to go through the engine source and fix the problem yourself. In the attached picture is an example of an inventory hierarchy that I am developing.

41462-example.png

On the first level is the master class that all items are derived from. Then on the second level the different categories of items are defined. On the third level are the individual items that are placed within the game. A way to get around the problem is to set the default of the parent class to values that the child class is not. Then you would pretty much just have to individually set each child item to have whatever default values you desire. In my case, I made a new enum called ‘Default’ and set everything on the second level to that. Hope this was helpful.

Same problem here, created struct of floats, which not only resets all values of variable to 0 upon opening project, also u have to delete the variable of struct and make a new one to just get it working until you open project again. Had to do a datatable and function that sets struct variable from a single row.

4.15 Still having this issue with a struct node.

Hi Willard720,

The exact issue that is referenced here was verified fixed (not reproducible) back in 4.13. I just tested this again using the repro included on the JIRA report; however, I was unable to reproduce the issue either.

If you are seeing a similar issue in 4.15, could you please try reproducing it in a new project and then create a new report in the Bug section? Make sure to upload that test project along with repro steps?

Thanks,

TJ

Looks like this issue still remains in 4.16 if you have default values saved in a struc in a functionlibrary they are reset when you restart the project.