Get all Child Blueprints of Parents (not just those already spawned)(Blueprint)

You can not do this with blueprints atm.
But you can create some c++ functions which is able to find all child classes of a given class.
Maybe this one will help:
https://answers.unrealengine.com/questions/92651/get-blueprint-class-by-string-in-c.html

Hello! Here follows my first Answer-hub question :slight_smile:

Question

So I’ve been trying to get through all my problems by figuring it out myself, but this one really has me stumped:
I would like to know if there is a way to automatically create an array (at run-time) of all the children of a parent class (which in my case would be the base item class for all the items in game). Ideally, I would like to be able to iterate through all child classes of a parent class regardless if they are spawned or not. Seeing as there is no way to actually reference a non instanced object, I thought it might be intelligent to place all my item actors in a content editor folder, and then iterate through all classes within that directory. However, I’m not sure how to go about that either.


Background

I’m in the process of designing our crafting system, and I’ve hit a little(big) issue. Currently, you cannot edit data table entries for actors in editor. This wouldn’t be a problem if I’m only handling a couple entries (I could get the reference directory to each asset and place that into the .csv). However, the issue is that the data table will have hundreds of entries; and to copy each manually would be a pain. Instead, I have set up a simple blueprint function that creates an array of all children of a parent class and compares their name with an input string - returning the first item that shares the same name and breaks the loop. This way, instead of actor references, the data table can contain string references. However, because I’m using the ‘Get All Actors of Class’ node, it only returns an array of already spawned actors. This actually had me fooled for a while, because in the beginning, I had all the necessary actors already spawned (output item and all the ingredients). But once I started making recipe that required actor class references that were not in the current level, it began causing problems.

P.S For anyone wondering, the crafting recipe data structure contains an string reference for the output, an integer detailing the number of outputs, a string array for the ingredients, and a material type enum which describes the output material so that we can sort the UI/restrict character access to certain tiers of crafting. I would like to replace the string references with actor references so as to avoid having silly spelling errors cause problems. However, without having the ability to edit those in-editor with a simple drop down menu, it would become too cumbersome.

Thank you so much for taking the time to read this long winded question. I wasn’t sure how much information to provide, so I tried to provide it all haha!

Amine Sebastian

Suburban Digital

Beautiful! Thank you so much. I don’t mind doing it in C++ as long as I can expose it as a blueprint node afterwards. So I would just run a FObjectFinder<***> where *** would be my Item class, and then add them all to a UE4 dynamic array and return that array? Could I do that without supplying a parameter ‘Class Name’?