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. 

Structure blueprint doesn't show map values correctly

Blueprint editor seems to have a bug in regard to displaying the contents of a struct blueprint that is a map. To reproduce,

1) create a struct blueprint MyMap (in editor content browser Add New -> Blueprints -> Structure) 2) open MyMap in blueprint editor 3) change member (MemberVar_0) type to string 4) change from a single string to a map 5) change value of map to some valid type, e.g., boolean 6) save 7) create another blueprint (MyMapTest) and create a variable of type MyMap 8) Add logic to MyMapTest event graph to de-reference the map variable and print out the length and each key. 9) compile and run. Will get length = 0 10) now edit MyMap and add three unique entries, say, keys of "one", "two", "three" 11) compile and run. Will get length = 3 and values "one", "two", and "three" 12) now delete the "two" entry from MyMap 13) compile and run. Will still get length = 3 and values "one", "three", and "two" 14) change the name of the MyMap "three" key to "four" 13) compile and run. Will get length = 4 and values "one", "four", "three", and "two"

Even if you delete all values in MyMap, they will still be visible to MyMapTest.

Perhaps I'm doing something fundamentally wrong here, but it looks like a bug to me.

alt text alt text

Product Version: UE 4.18
Tags:
mymap.png (36.7 kB)
mymaptest.png (109.1 kB)
more ▼

asked Jul 11 '18 at 07:58 PM in Blueprint Scripting

avatar image

robotnicbw
19 2 4

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

1 answer: sort voted first

This is not a bug. This is a Feature!

Maps are sorted containers. This mean that map is kept sorted by the "key" value all the time. There is never a guarantee that he last element will be the last element you've inserted. In fact it is guaranteed that the last element will be the one with the highest "key" value. Have you noticed that the words "one", "four", "three" and "two" are in alphabetical order? This increases the search speed tremendously when you are working with large maps. (although it decreases the insertion speed)

I hope this clears out the things a bit ;)

more ▼

answered Jul 11 '18 at 08:19 PM

avatar image

dZh0
1.3k 6 5 9

avatar image robotnicbw Jul 11 '18 at 08:50 PM

You've totally missed the point. The blueprint editor does not show all the values in the map and deleting values from the map does not truly remove them, although they disappear from the editor display. Renaming the key in the editor creates a whole new node instead of replacing the existing key/value pair.

avatar image dZh0 Jul 11 '18 at 11:18 PM

Sorry about that. I guess I'm loosing focus. I'll check it again later step by step.

avatar image robotnicbw Jul 12 '18 at 05:35 PM

No problem. An interesting extra tidbit is that the blueprint editor works properly for a map if it's a variable within the test blueprint in regards to adding, deleting, and changing key values. It's only when it's in a blueprint structure component that it exhibits these problems.

(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