How can I dynamically create an array within a Blueprint Function?

Hello friends,

I have run across a strange limitation in Blueprint Function scripting. I am putting together a simple Blueprint Function Library that contains various building blocks to aid me with procedural content generation.

These functions would basically revolve around a concept of taking constraint inputs and outputting lists of locations that I can use to spawn assets or do something else.

A simple example is this function, similar to the procedural grass found in the Blueprint Office content example,
It takes an input origin, a set of bounds, and a target amount of locations to output. I should be able to run a “Do N” loop to find a random location X amount of times and store all of these locations in a single list that the function spits out.

However, because I cannot manage arrays internally, I am left to only using the “Make Array” function upon output, but Make Array is insufficient, as you must manually add pins to create new items to store in my output array.

How come I cannot dynamically size an array on output so that my function may export a user-defined amount of locations ? This seems like a strange limitation as it takes away a lot of the basic power that Blueprint Functions would provide

Any help, ideas or workarounds would be incredibly appreciatted

  1. Create a local array vector inside the function.
  2. Create a loop for number of random locations that you need
  3. Use Add() function to add elements to array
  4. When the loop is done, link the array to output

:open_mouth: I knew i had to be missing something simple! Thank you so much!! I will try this now and will report if i can get it to work!

Absolutely perfect, this is exactly what I needed, thank you so much!!