I need to have a UPROPERTY(EditAnywhere, BlueprintReadWrite) with a data type similar to an array, but referred to by a name/string rather than an index. Not sure what the best way to go about this is.
In the blueprint editor I should be able to make a bunch of FMeshItem 's and give them a name and USkeletalMesh*, for example “Sword” and then chuck the sword skeletal mesh in there. This becomes a lot more important when I change the character’s sword item and it’s why I don’t want to refer to it as an array. This way when I break the array/list/whatever it’ll give me “Sword” or other.
TMap will do what you want, as well as a TArray of FMeshItems like you’ve come up with. However, TMap cannot be a property and is therefore not blueprint compatible, and using an array as-is will require you to manually iterate through it to find the mesh item you want.
I would go with the TArray, but use FName instead of FString for this kind of thing (faster compares). Then create yourself some helper methods that handle finding and returning the mesh: