In my case, I have struct that contains an array of structs, which contains another array of structs, which, regardless of what I do, can’t be filled. They are always empty. The array knows it’s size and the structs are always as default.
I need to save this data, and I can’t do it by any other way than what I am doing right now, how can I possibly do that ?
Bonus glitch : I modified a default value on one of my structs, and now the parent struct doesn’t recognize the modified struct.
EDIT : All of the above is wrong, the reason for that is because I was using Set Array Elem. You need to use SetMemberInStruct or reconstruct the array from scratch for it to work.
I recently tried to make same but in c++, I got an error about nested loops inside structs not being supported, I used Map for it, dunno about blueprint support of them in that exact case, but it should be working.
Also, there used to be a difference between a CustomEvent and a Function passing arrays of struct where the Event refused to pass a struct reference and always returned a copy. Not sure if this still holds true.
edit: you, of course, need to connect *ArrayIndex *of *ForEachLoop *with *SetArrayElem’s *index. My bad.
I actually don’t use Set Members in Struct or Set Array Elem anymore, I construct the array from scratch every time I use it, because it suits my needs better.
But try to disconnect Set Array Elem and you’ll still see “update this text!”.
Disconnect Set Members in Common Data and it’ll stay as before.
No, it will not update, why would it? Not sure why you’re saying this. You clearly have not tested this, have you? :p:
Updating as I’ve shown above works, so will constructing from scratch. Updating will be more preferable since you do not need to recreate the entire struct. And that’s quite important when you deal with multiple layers of nested structs, especially when they contain additional arrays of other struts.
Using the method of recreating structs from scratch on anything moderately complex will require a silly amount of unnecessary rewiring.
However, since recreating the entire struct suits your needs better, can we consider the original issue resolved?
Just noticed you’ve updated your original post. Glad you have it working.