x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

TMultiMap not allowed as a UPROPERTY

I have been developing a hex map for my game and I'd like to be able to store the map as a Multimap so that I can access it through offset and cubic coordinates.However, when I tried to define it as a UPROPERTY, the UE4 side of Visual Studio throws out an error saying "Unrecognized Type 'TMultiMap' - type must be a UCLASS, USTRUCT, UENUM'.

I tried playing with it a bit, and UE4 has no problem allowing TArrays and TMaps as UPROPERTY, but TMultiMap is not allowed. Is there some kind of inner limitation with how the reflection system is designed that prevents me from making a TMultiMap UPROPERTY or is this a bug?

Product Version: UE 4.15
Tags:
more ▼

asked Apr 13 '17 at 01:49 AM in C++ Programming

avatar image

Zecknaal
16 6 9 8

avatar image MarekArtist Apr 15 '17 at 09:04 PM

Would be a nice to hear the response from Epic about this topic... Im struggling with this too.

avatar image Zecknaal Apr 15 '17 at 11:48 PM

Well, I think Muelas nailed it with his comment that it just isn't supported yet. Maybe they could provide an ETA on the release it would be supported in?

If this is a necessity, you might be able to wrap the TMultiMap inside of a struct, and have the struct be a UPROPERTY. I think I've seen that workaround used for other cases, like nested TArrays.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Not really a bug, more of a missing feature. Until 4.15 only TArray was supported in Blueprints. In 4.15 they added TMap and TSet, but no TMultiMap yet.
What exactly do you need to do with a MultiMap? Maybe there is some workaround for it. I don't totally see how "access it through offset and cubic coordinates" applies to MultiMaps.

more ▼

answered Apr 13 '17 at 02:16 AM

avatar image

Muelas.Aitzol
322 10 4 13

avatar image Zecknaal Apr 13 '17 at 02:30 AM

Yeah I derped! On second thought I really don't need it to be a MultiMap, just a regular Map is fine. In my head I couldn't have duplicate values with a TMap, though I realize now MultiMap is based around duplicate keys, not duplicate values.

I didn't know that support was only just added for TMap! You're right, it's probably more of a feature request than a bug. Thanks for shedding some light on that.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question