Static struct in C++ and Blueprint

I have a Pickup C++ and its derived Blueprint. I want to have various types of pickups where only a handful of key parameters change (content value and appearance for example). Value is a float, appearance at the moment is an enumeration type, and the enumeration will help choose what material the pickup’s mesh will use. (all meshes the same)

So I created a USTRUCT(BlueprintType) etc. , let’s call it PickupType, with 2-3 of these members, as part of defining my pickup class in C++. The pickup class has a member filed of type struct (let’s call it MyType).
Now: I want to define a few static structs with predefined parameters. For example a Gold type will be a blueprint Pickup actor whose struct will have values of 100 and an enum to help indicate the metal_gold material (e.g. MaterialEnum::Gold etc.) I want this so that if I ever need to use in code I can go: PickupType::Gold and refer to that struct and essentially define a pickup type.

I get errors when I try to compile declaring and defining these static structs from within the struct definition itself. I found a workaround with making the static structs in the pickup’s constructor, but can’t get them to be blueprint-exposed.

My goal is that I want to be able to drag my pickup blueprint in the editor and be able in the details panel to set its type (through its MyType variable? or any other way - I don’t care) to one of the static/global structs that I have predefined. Something like a drop-down list so I can say this pickup is Gold, or Steel etc. The aspiration is that this will also refresh the material in the editor so visually I know I have achieved placing a specific pickup in my scene.

I have blueprint-exposed the individual struct members so I know I can set them (and with the material I can forget about enums and just select the material I want each time) but doing that multiple times can be error prone. I also understand I can just duplicate my pickup blueprint X amount of times for each type and fix the properties as appropriate each time, but that doesn’t seem so clean or elegant either? Essentially this is the “Typed Object” design pattern that I want to implement. Any ideas welcome. Thanks.

You might want to parent your struct to FTableRowBase

struct FMyPickupSettings : public FTableRowBase
{
	GENERATED_USTRUCT_BODY()
public:
<some var declaractions>
}

Then in the Editor you’ll be able to create DataTable based on your struct. Each variable is going to be a column and each row is your static struct. Also it’s a good way to store and categorize data as each row name is unique and you can use it as a key exactly like you would use in a Map type.

Accessing data table in bluerpints is straightforward, so i’m not going to stop on that too much, just use GetDataTableRow node.
In c++ you’ll have to Load it from a reference path in your Content folder:

UDataTable* data_table = LoadObject<UDataTable>(outer, datatable_name);

here datatable_name is something like TEXT(“DataTable’/Game/MyCharDataTable.MyCharDataTable’”).
Here /Game/ is a Content folder and MyCharDataTable is an asset of type DataTable located in Content folder.
Then, to access data you’ll have to know rowname. For that there’s a FDataTableRowHandle structure, which is commonly used to pass and access any data table data.

Thank you for getting back. Interesting proposal, a bit more complicated than I had hoped but it certainly is worth exploring. This is for a game jam and right now I decided to just go with a simple blueprint hierarchy and create different versions of those pickups with their fixed properties. But the above solution could be something elegant that I should use in the future so will check it out. (or maybe even for this game jam if I have enough time by the end!)