Connecting component pointers to arrays inside other components in blueprint

I have a blueprint thats an object in my level that has a bunch of custom components called ULocation (derived from UBoxComponent). Inside each ULocation is an array of ULocation* called ConnectedLocations.

In my blueprint i want to add elements to the array by draging the components in the blueprint into the array elements.

Example in my blueprint i have the following:

Root = X

Component ULocation Alpha
[INDENT]TArray<>ConnectedLocations
[INDENT]element 0: Location Beta[/INDENT]
[/INDENT]
Component ULocation Beta
Component ULocation Charlie

Is this possible? I want to be able to drag and drop the components like you can in Unity

Thanks

There has to be a way to do this right?

outbof curious, what happen if you need to have 100 locations(connected or not)?

i don’t know what you are trying to achieve in game, so it’s kinda hard to have a proper answer.

i’m making a board game (think arkham horror) that has locations (places where the player can move to) each location can connect to other locations (not all locations are connected) so I my GameBoard blueprint. in this blueprint i have 20 custom components (ULocation) that contain an array of its type TArray<ULocation*> ConnectedLocations. In the components tab i want to be able to add existing locations to the components arrays

So if i have ULocation Alpha it would have an array with 1 element which would be a pointer to Location Beta so in code or the blueprint i can do ULocation->GetConnectedLocations()->whateverFunction. In order to do fast iterations and change up the connections i need to be able to go to a component, add an array element and then add the ULocation that’s in the blueprint to it.

Think in Unity you have an object with an array of GameObjects. In the editor you can add any object that’s in the scene to that array by dragging the object to the array. That’s what i want to be able to do in my blueprint.

So that Connected Location Reference drop down list i want to have it populated with the other components you see if the list and be able to have it get added as the pointer for the array element. Right now it just shows the class type to create a new instance

It’s not entirely different so I strongly suggest that you check this thread. (please also check his 1.0 thread.)
Map Generator 2.0 - Please Critique! - Blueprint Visual Scripting - Unreal Engine Forums!

Essentially, the more flexible method for you is to have a manager type of object that does all the connection and such during game begin.
that way you can just treat each map tile as editable object and then place it in actual map editor instead of being a component of one mega object.

I know this is not a direct answer to your approach, but I do believe that the method they provided in map generator thread is better.(you don’t need to go procedural, connection would still be relevant.)

Yea looks like i just can’t do it in a blueprint. I changed the components to AActor and now I can attach them to each other when they are actors in the level. Oh well no big deal, would have just been nice from a organization stand point if everything was self contained in the blueprint.

Thanks for the help!!!