For the system I’m trying to make, what works the best is to have an enum who’s values are a custom struct. Then in this enum, I can populate the values of each “struct value” individually.
I’m not sure if that explains it well, but here’s the bottom line: I want my item system to contain a struct that dictates the value of each item.
Example
Base Item Struct
Name:
Value:
And from that, I create an “enum” that contains my items:
Enum BP
[
Red Coin Item
Name: RedCoin
Value: 5
Blue Coin Item
Name: BlueCoin
Value: 10
]
Now I understand that enums work with just a name for each value (maybe), so if there’s a way to accomplish this sytem with another type (or better) of data structure I’d appreciate some insight.
So what you want here isn’t an Enum OR a struct… You should use a Data Asset!
There isn’t a lot of documentation or official tutorials here on the Epic Dev Community for Blueprint, but youtube will have a good amount to cover it! I once saw a video where someone used Data Assets to make a pokedex using their fake Pokemon. Stats, height, weight etc. included in said asset along with identifying # and name.
They used to require C++ but do not any longer.
If that’s not what you’re looking for, you can also go with Data Tables!
Disclaimer: This link is not affiliated with Epic Games, Unreal Engine, or their partners.
I was initially using Data Assets, but I was storing all the items inside one data asset instead of making multiple of them, ala prefab. This was what I needed, cheers!