Where to store information about items

Hello!

I am currently working on a first person shooter game. It has an inventory system which should allow you to select the specific items you want to use in a menu before you spawn. For managing this I would need some place to store an array which contains information about all accessible items, like their Blueprint classes. Ideally that would be some kind of asset which I can easily modify within the editor.

Does someone know a way to do that?

Thanks!

Hey,

A while back I was looking for such a system as well and I ended up using the following setup:

  • C++ class inheriting from UObject with a array of a structs containing all necessary information (like thumbnails and classes)
  • Blueprint class inheriting from the C++ class which can be filled with all information inside the editor

Now you can access this data by loading a refernece the blueprint class in C++ and do something like:

static ConstructorHelpers::FObjectFinder Blueprint(TEXT(“SomeBlueprintAddress’”));
if (Blueprint.Object)
{
ReferenceToYourItemLibrary= (UClass*)Blueprint.Object->GeneratedClass;
}

TSubclassOf ItemClass = ReferenceToYourItemLibrary.GetDefaultObject()->Items[0].Class;

Hope that helps!