Blueprint Function Library Custom node Issues

This relates to C++ and blueprints, though I believe this relates more to C++.

So this is Class setup


Actor is the Highest level/ Master Parent


Inventory_BP class is a child to Actor class, InventorySubSections_BP class is a child to Inventory_BP class etc.

I created a blueprint node via the following code, using a Blueprint Function Library (Full credit to and permission from florianbepunkt, original source code: https://forums.unrealengine.com/deve…ut-the-classes - bottom post )

(Public)
CustomNodesPublicHeader.h


#pragma once

#include "Kismet/BlueprintFunctionLibrary.h"
#include "CustomNodesPublicHeader.generated.h"

/**
 *
 */

UCLASS()
class ARPG_V1_API UCustomNodesPublicHeader : public UBlueprintFunctionLibrary
{
       GENERATED_BODY()

public:

       UFUNCTION(BlueprintCallable, meta = (DisplayName = "Get Child Classes", Keywords = "Get Child Classes"), Category = Class)
              static TArray<UClass*> GetClasses(UClass* ParentClass);
};

It works perfectly ONLY if I open up each child blueprint before running the node. Note, this node was developed on an older version.

The below custom node is tided to the inventory_BP actor placed in the map.

(Private)
CustomNodesPublicHeader.cpp


#include "CustomNodesPublicHeader.h"
#include "ARPG_v1.h" //‘ARPG_v1.h’ is my game project’s header file

TArray<UClass*> UCustomNodesPublicHeader::GetClasses(UClass* ParentClass)
{
       TArray<UClass*> Results;

       // get our parent blueprint class
       const FString ParentClassName = ParentClass->GetName();
       UObject* ClassPackage = ANY_PACKAGE;
       UClass* ParentBPClass = FindObject<UClass>(ClassPackage, *ParentClassName);

       // iterate over UClass, this might be heavy on performance, so keep in mind..
       // better suggestions for a check are welcome
       for (TObjectIterator<UClass> It; It; ++It)
       {
              if (It->IsChildOf(ParentBPClass))
              {
                     // It is a child of the Parent Class
                     //make sure we don't include our parent class in the array (weak name check, suggestions welcome)
                     if (It->GetName() != ParentClassName)
                     {
                           Results.Add(*It);
                     }
              }
       }
       return Results;

It works perfectly ONLY if I open up each child blueprint before running the node. Note, this node was developed on an older version of UE4.

The below custom node is tided to the inventory_BP actor placed in the map.

Before opening Children blueprints of ‘QuestItems_BP’. No Child classes detected


After opening Children blueprints of ‘QuestItems_BP’, Working as expected

Any ideas as to why this is happening, why are the child blueprints classes not loading in at all instances, is it because they have yet to be ‘loaded into memory’?

Is there anyway of loading my inventory blueprints ‘into memory’ on games launch?

You should find each blueprint asset and load it to memory first. I think the easiest way to do this is using the asset manager.

Hi Sveitar, apologies I am a new user to this forum and it wouldn’t allow me to update my post (and I didn’t want to double post) but I used the ‘Dynamic Load Content from Path’ custom blueprint library Node source code from:
https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/83433-store-all-textures-within-a-folder-into-an-array
.
I used the above linked source code (The ‘Dynamic Load Content from Path’ node) to make the system load the inventory bp on event beginplay and all children blueprint classes once when the actor is created.
And filtered unwanted ‘glitch’ enters coming from the engine folder that occurs only on the first game launch.
This seems to have solved my issue.