How to properly add new structure item to its array?

I created simple structure called “Quests” to be used for game’s journal.

49893-2015-07-11_16-00-36.png

And I added struct array for it in blueprint. Now I’m trying to add new item to this array. Nothing works.

I’ve seen many threads about not working struct arrays. Most of them are very old, some points that struct array weren’t working at the time (but 4.8 supposed to patch it up). So… is there currently any way to make struct arrays working? If yes, how I do it? Simple adding new struct to array doesn’t seem to work - at least printing values from new item returns empty values.

Assuming you’re trying to add a data type to the proper array type there should be no issues. Are you receiving any errors? What indicates that your process isn’t working?

I made a demo project in 4.8 and it’s working as expected.

Yeah, it works in simple setup.
But looks like it got messy when I put array of structs into another structure. And then I put in another struct :smiley:

I put array of Objective structs into Quest struct. Then I put array of Quest structs into Episode structures. In bp Episode struct is also save as array.

Editor even doesn’t allow me to “make” such array with sub-array, it throws warnings at me :wink:

Actually it does work if I add new “Episode” element together with sub-arrays (few quests).
It doesn’t work, if I try to add new sub-array element (“Quest”) into existing “Episode” element.

Any ideas are welcome :slight_smile:

I tried every which way I could think of to perform what you want and I just couldn’t do it. I’m thinking it’s not possible in blueprints. Honestly though, you definitely do not want to create your game this way. Arrays of arrays of arrays is a super scary and inefficient way to sort through data. Consider breaking it down into multiple arrays/structures and using indexing; similar to a SQL database.

Well, it sounds reasonable. I’ll do that :slight_smile:

Thanks for your time, Distul!