Map In Array
I have been trying to make an array that includes a map with 2 string variables, but apparently that's not possible so I tried to make custom class and make an array with that class, however I keep getting various errors.
I found a function from the engine, so I copied it and changed it a bit, so I came up with this:
That one gives me that class TMap could not be found. However, I included "Map.h".
Making a simple class (without using UCLASS() or GENERATED_BODY()) gives me other errors, but I still can't get it done.
What I am trying to achieve is getting data from MySQL through blueprints. I want to make a map that uses the column name as key and the column data as the value. Then make an array for all rows.
asked May 31 '16 at 12:33 AM in C++ Programming
In your first example the Problem was the TMap parameter. Blueprints are currently unable to do anything with them. So you cant have sit it there in a UFUNCTION. Your Output Log when you compile should tell you that.
Your Example in your Comment works fine I just run the Code and Started the Game. No Crashes. I assume you have the UFUNCTION inside the class body and not outside like in your Comment and also created a implementation even if its empty? But you are on the right path looks like something else causing the Crash. I mean I can even Construct the Object and Call the Function even if does nothing right now. https://gyazo.com/1ce91d59c89d21f980b64d3af872a43f
answered May 31 '16 at 11:27 PM
If TArray of TMaps is all what you need, then you can easily do this like so:
And here's the usage:
Keep in mind, that, TMaps aren't supported by UPROPERTY macros so if you'll add that, the code won't compile.
If you want to get data from this variable in blueprint, you can do that using this function:
Follow this question
Once you sign in you will be able to subscribe for any updates here