Cannot add struct to array without adding element to internat array
I ran into this problem with structs and arrays today while working in my procedural world.
I got an array of stucts. Each struct contain their own array. The problem occurred inside blueprints. Adding a struct to the first array seem to require that each of the variables or arrays inside the struct also get populated. Fine, I can create the array... but the only available node is "Make Array" and it wants to add an element... (Description : Create an array from a series of items). But I don't want to add any elements yet, or rather, I can't because they don't exist yet.
Funny thing is, I accidentally solved this just now... you can right click on the "in pin" item in the "Make Array" node and choose "remove array element pin". This way, an array can be created without any elements :D But this wasn't very intuitive for me as a new blueprint user (and experienced programmer).
A small change suggestion for the Make Array node :
asked Apr 03 '16 at 04:50 PM in Blueprint Scripting
Yep, thats current behaviour of structs in bp. You can reserve something like -1 for blank spot member and check it before use to separate actually "empty" array from not empty.
answered Apr 03 '16 at 05:47 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here