Can't set array elements in structure array [Demo project]

Setup: Array of structures “StructureA”. In StructureA, array of integers/strings/whatever. Result: Can’t set any element in integer/string/etc array.

I’ve attached demo project. From simple BP setup, it will print string showing that values 1,2 and 3 are added to integer array, but then, when trying to read these values, it will just print “0”. Same goes for array of Strings, where it will read just a blank field instead of added string values.
SIMPLE DEMO PROJECT

PS. This bug is probably related to THIS ONE.

Edit: Updated product version, it still happens in 4.9.

Hi Slavq,

Thank you for the report and the attached project, I was easily able to reproduce the issue. I created JIRA UE-20424 for the issue and our developers will be investigating it further. We will post here with updates as well have them.

Cheers,
TJ

Hello, any news on this one? Will it make into 4.10? This bug prevents me from finishing my save/load system.

Hi Slavq,

This has been put on the to do list by the developers but it will very likely not be fixed by the time 4.10 is released.

As a workaround, try resetting the struct array at the end with the one that you added to.

Can you please elaborate on your workaround? I believe I’m running into this same issue with my inventory system (Character has array of clothing structures, clothing structure has array of items).

I can’t seem to figure out any way to work around this, and its really causing me a headache.

Thanks in advance!

Hi NightHawk45,

This was a workaround described to me by the devs. I hadn’t had time to try it but I just did and it doesn’t workaround the issue like we hoped. We will be investigating this issue but for now it doesn’t seem this exact setup with Struct Arrays is the way to go on this.

Is there any news about this bug? It’s been a couple of months now and I can’t figure out any workaround.

Hi Slavq,

We are planning an overhaul of structs and arrays that will most likely fix this issue. We hope to have more news on this in a future update, however we do not currently have a timetable.

Couple of months have passed, 4.11 is out, but I guess that the struct & array overhaul is not there yet?

Hi Slavq,

Internally, yes. This particular issue has been fixed but it didn’t make it in the 4.11 release.

Its 4.14 now, but I still have this bug.

Do you know if it would be possible to work around this by using C++? Or is TArray also bugged in this fashion?

Indeed, in 4.14 the bug still exists… It can be reproduced in the same attached demo project, just like before.

I can confirm I just discovered a similar issue related to nested Structs. I created a Struct with a bunch of values related to my buildings. Then created another Struct to created a list of edited values for different building types. Seems to work in the PIE but trying to use it in standalone it never reads the stored values in the Struct. If I close and open the editor the Structs and BP that reference the Structs get all messed up. Really annoying on a seemingly core function.