I am currently working on a Roguelike game and have run into a road block that is driving me crazy.
Simply put, I need to spawn in randomly selected rooms based on some inputs (size, style, point of interests, key features, etc…). To do this I have made some Packed Level Instance blueprints that act as prefabs for these rooms. These prefabs are to be stored somehow in a collection that I can access in C++ code and spawn instances of where needed with some initializing parameters.
After some research it seems overriding the Asset Manager and having some Data Asset Blueprints derived from a C++ Primary Data Asset class act as containers for these prefabs is the way to go. My problem is that I cannot for the life of me figure out how to even get started with this. I have looked at examples and watched videos on the subject, but I am struggling to get it working.
In the project settings I have set it up according to the documentation on Asset Management, and I have made a Primary Data Asset for my prefabs and tried deriving Data Assets from that, then used the ScanPathForPrimaryAssets function to search the directory for the Primary Data Asset, but it turns up nothing.
It feels like finding all Blueprint classes of a specified type in a directory and then spawning them in runtime should be fairly trivial, so I can’t help to think that I’m missing something obvious and it’s driving me crazy.
Does anyone have any pointers or good sources for this?
I am on engine version 5.1 if that matters.
Cheers!
SH