Are TMaps accessible from blueprints?

Just wondering if TMaps are accessible from blueprints yet. I’ve read a lot of information and nothing seems to point to them being available but I wanted to double-check. If it’s at all possible to create/expose a TMap to blueprints via C++ I’d be keen to know more. I am looking to create a word game that requires an array with 20,000 entries in it (the dictionary) and figured that TMaps are the best way to go about checking if an entry exists in that list. Or would TArrays be able to help me?

Hello,

Currently, TMaps are not accessible from blueprints. There is a feature request in our system, UE-2114, for the ability to access TMaps in blueprints; however, the developers are currently focusing their efforts on high-priority crash and showstopper bugs, so it may be some time before this is investigated.

Have a great day

Thanks for letting me know. Can you think of an alternative way (via blueprints) to handle something like checking if a word exists within an extremely large list of words? For example, if the word “dog” exists within a list of 20,000+ entries. Creating an array that had to be iterated over would surely be taxing on performance, right? Or not? Please enlighten me :slight_smile:

You can create a BP exposed Function that access your TMap and just returns you the result in your case a bool. The limit is just that you cant access a TMap directly.

In your case however you might want to consider a algorithm to use. Whats the best suitable for you is up to you and it goes out of Scope of the Question you asked. In case you dont know how a allgorithm like that would work here is a simple to understand example CS50 Lectures - The famous PhoneBook - Video Clip - YouTube you should also look up Big O Notations to know how performant your search is.

Good Luck and have Fun

Thanks. Now that you mention it, I don’t actually need to change anything in the TMap from blueprints, I just need to get the bool out of it. So what you mentioned would probably suit me. If I just create the function that will accept the word to check and is able to check it against the TMap then I should be good. One side question, if I may: when setting up a C++ class for this kind of thing, would it make sense to use a base class such as Player Controller or Actor to access the function?

Thats totally up to you. If you want to have a TMap and this Function accross Multiple Actors without a common base Class, a AActorComponent is another Option for you.