Tutorial on how to setup a USTRUCT to be used as a key in a TMAP.
https://dev.epicgames.com/community/learning/tutorials/GxZ9/using-custom-c-structs-as-tmap-keys-in-unreal-engine
Thank you SOOO much!
I was getting frustrated trying to figure out, on how to create Default-Values for a TMap.
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(DisplayName = “Spotting Accuracy (Meters)”))
TMap<float,FSpottingAccuracy> SpottingAccuracyMeters
{
{1000,FSpottingAccuracy{
EVisionLevelOfIdentification::EquipmentDetailed,90,100}},
{2000,FSpottingAccuracy{
EVisionLevelOfIdentification::SuspectDetailed,50,100}},
{3000,FSpottingAccuracy{
EVisionLevelOfIdentification::UnknownBasic,10,100}}
};
Tried almost everything prior to your solution, so again: thank you very much for the effort!
Copy/Paste
// (c) blurryroots innovation qanat OÜ – CC BY 4.0
blurryroots? Der Name kommt mir doch bekannt vor
Schöne Grüße aus Göttingen,
RamĂłn Janousch
Aloha Ramon, welch Adleraugen! Beste GrĂĽĂźe auch an dich.
@DaveTheFreak Year it can get quite tricky. Really glad I could help you out with this.
It didn’t compile for me then I looked at the source code for examples and saw they were using “friend”, did the same and it passed compilation.