Blueprint Structures Arrays bug?

I think that there is an bug with Blueprint Structures when creating Arrays for them.

Repro:

  1. Create a structure with couple of different variables (floats, bools, enums etc),

  2. Create a array with that structure,

  3. Fill the array (add, remove) with something and remove some element using Bluepritns (not using defaults values!)

  4. Now go to your structure and add another one variable to the structure,

  5. Now when you are adding something to the array you can see (in debug) that there are proper values there,

  6. But if you foreach the array after 1-2 seconds new structure variables are set to DEFAULTS values, not values that you have added when adding to the array,

It’s really hard to explain the issue with blueprints. I’ve done a lot of bp here so can’t really show you the issue, but I’m seeing that those values are default event when I’m selecting exactly what should be there.

Basically this issue is preventing me to work on the game. Im now little bit affraid to use blueprints in serious games. I will be really grateful if someone from Epic can look at it.

I have seen a few complaints about structs in arrays since blueprint-created structs were released. Probably need a dev to chime in.

If you are afraid of this problem and how long it might take to fix if it is a bug, then you can still work around the issue.

You can keep each buff’s information stored across a series of arrays. Value, Duration, AP Cost, etc arrays. Then each of your buffs has an index that is shared across all of those arrays. If your character gets buff # 5, then you search that index across all the arrays to pull the properties.

Anyway that is one way to do it, at least until your struct issue is resolved.

Yea I can workarround this but then blueprints will look really bad and making changes will be hard. What if in middle of the production something with blueprints will cause such issue? It will be pain to whole team to create work arrounds:(

Yeah I would prefer structs be in working order, but these kinds of bugs don’t happen very often, and creating structs in blueprints is new. I wouldn’t worry about things like this occurring to established features when you are in the middle of a project.

I really hope this will be fixed in 4.3.1

Anyone from Epic can comment this? it’s a nasty issue!

Hi Intoxicat,

I have assigned a technician to look into the issue. Structs are currently not as stable as we would like and making sure they work properly is a high priority for us. Once he attempts to reproduce the error, he will get back to you with more questions or comments.

Thank you,

alexander

Hi intoxicat3,

Thank you for the feedback. I was able to reproduce your issue and have submitted it to our developers to look into.

It looks like as soon as the blueprint is compiled that the struct data in the array is reset back to default. I believe this is at the root of the issue you are seeing.

Thanks, TJ

Is there any work arrond for now?

At the moment the only workaround is to use the struct by itself. They keep all their data and work fine as long as they’re not called through an array. I know this isn’t ideal, especially if you can’t do what you need with a struct alone.

As the developers look into the issue further we may find another workaround. We will post back here as soon as we have something.

Hi intoxicat3,

We just got a fix in for this. If you have github access, you can view it here:
https://github.com/EpicGames/UnrealEngine/commit/3f6b62c2427b05d87755e6b52d627252f8a0cc46

Hope this helps!

Mike Thanks!

Is there any chance for 4.3.2 quick fix with strucs resolved? From my point of view: it’s a new feature that isn’t working correctly in 4.3.1. Not everyone can recompile source.

Just a thought.

I understand that not everyone can compile from github, just figured it wasworth a suggestion for a more immediate resolution. This fix will be in 4.4 which is hopefully right around the corner (we’ve already released the preview here: Unreal Engine 4.4 Preview Notes - Announcements - Unreal Engine Forums). We have all hands on deck trying to give this one out the door quickly.

If you do need a more immediate resolution, have you tried manually entering the default values after they’ve been cleared? I believe the array members should only clear themselves if left unmodified. Once modified, they should stick… I know this can be tedious, but could serve as a work around until 4.4 is here. Let me know how that works for you. Thanks!

Hi Mike I woul like to thank you for support and basically Epic support. Keep the good work and speak with us developers as much as you can! It’s a cloue to be the best engine provider out there.

Hello, I was going to make a topic about array structures but seems there is a fix already committed.

At any case here the problem that I personally have with array structures:

Please take a look at this image…

As you can see there is a problem when setting default variables into an struct array (and it doesn’t only happen with booleans btw).


Also (and this is more like a feature request but still…) PLEASE add a way to reorder structure variables!

Basically I’ve the same issue using 4.5 :frowning:
I have a structure with ENUM
I have a array of the structure somewhere and added couple of default values inside the array
When I foreach and check which ENUM is the right one I can see that the last ENUM is really weird and doesn’t mach ENUM that I’ve created. The bug occures when I changed default of the ENUM in array.

I can upload the project so you can check it out.

When I deleted all of TEMP files in my project it runs OK.

Any updates on this? I seem to be having some issues with arrays and structs in blueprint as well. This seems like a major issue to me and makes me question whether I need to just switch to C++. Any feedback you guys can provide would be very helpful.

Thanks

Hi Xarol,

The issue that was originally reported in this post was fixed in version 4.4 of the editor. Which version are you currently using?

If you are using our latest build (4.6.1) and you are experiencing this same issue, could you post some screenshots and repro steps? As well as any other info that may be relevant.

If your issue is different but about the functionality of Strucs/Arrays in general, could you please create a new report and post a link to it here?

Thanks,

TJ

Hey guys,

As of version 4.8.1 I still seem to be encountering this bug.

As the OP stated, it only seems to be happening with an Array of Structures. I’ve managed to get it working for single structure variables, but the moment an AoS is introduced, all bets go out the window.

Perhaps the issue is that I’m trying to communicate the values between two different Blueprints, but I’m not sure if it’s because of an error in core Struct functionality or some other bug involving Blueprint communication.

Just wanted to chime in. Would love perspective from other people who might be facing the same problem. =/