Now I’m using a structure blueprint as dictionary’s value.
I am using break structure nodes to take the values already present in case the find of the key is true, to these results add the incoming values from the loop, and then update them with the make structure node. Even though the new keys not found are all added correctly with their first reference with a count value of 1, (because it would be the first room registered under that key), however I still can’t update the values for array. Where am I going wrong? I have never worked with structures and dictionaries before and I’m seriously going crazy. Is it because the output pin of the set members is not connected? In that case, how should I connect it? Because from the set map the only thing I can do is make map, but then the values would have to be replaced anyway, at least from the last test I ran it seemed to be like that. @3dRaven @ClockworkOcean
Ok now with this setting, the rooms accumulate correctly in the dictionary, I can see it both with the print string and in debugging mode, but the dictionary now only shows me one key at a time, I no longer see the list of all the keys added/found.
Dictionaries do not have duplicate keys. You have to have a different one if you want to save another set of rooms.
The key0 from your screenshot dictates the dictionary key you are setting the values for or during the add process of the dictionary.
I’ve come to this point. That is, in case of true, using a further add rather than set, the old variables for tags are replaced with the new ones, taken from the break, added to the transmitted data and reinserted into the structure with make. So the problem was the set in case of true. Now my question is: before for mesh I was able to access data such as: all its transforms, other components of the same bp etc… I had access to a lot of info, now instead I only see the number of rooms. Is this enough to recover them later to perform interiors spawn actions?
Each time you set the struct you have to pass in all of it’s data. Not just the room count but also the old stuff like the RoomRef from the found by key entry.
However it is strange that the key is 0 as you say because I am using tags as keys. Maybe there is still something I did not understand. The keys should not be those between " "? @3dRaven
but I have transmitted all the old data, I have not only pinned the integer for the counter, but also the actor array. Can I send you a screen? @3dRaven
When I was able to access the other info the code was almost the same. That is, it was the last changes that allowed me to keep all the keys with the updated counters. So before it worked as in that old screen. Also because that is the false branch, in case the key taken was not already contained in the map. So it created a new struct with that array, with value 1 to that key. I repeat it is strange because before that part of the branch was identical, but it returned multiple info. @3dRaven
Are you sure you are not using the same roomRef for all of the operations, clearing it somewhere in the process?
I’d need a full screenshot to track down the logic.
I’m sure because the receiving data is transmitted in call from the bp generator, every time a chosen room passes the test and is actually spawned.
Anyway, this is the line of code now, and it’s very close to the solution.
You are using the tags array as your key provider for the map. Yet you only ever access the 0 array value of the tags => so your key is always the same.
Is this intentional?
But if my keys were always the same, I would have only one type of room in the map, instead I see them all. I sent the screen before. That is, I see all the tags and for each the number of rooms. It is intentional more than anything because to be honest I have never found myself changing the index 0 on a get.
You are passing in RoomRef yet it doesn’t reflect the changes you made to the nested map. Try passing in the outcome directly and then setting room ref, or update room ref earlier with the changes.
I just redid a generation of a map. I’ll send you the screenshot. In theory maybe it’s like you say but partially because otherwise if there was no update I would see the wrong count, that is, value 1. Instead, with a complete map I see the updated counter.
if I find an old screenshot with the old code, where the other info is visible, I’ll send it to you.
I was able to find only this old screen. Here I basically had the problem of the integer counter and the lost keys, but then I had the whole list of references, and from the arrow to the left of the icon, I had access to all the info of its bp. But the reception was practically the same as now. Absurd, very strange.
@3dRaven
Are the rest of the RoomRefs actors still present when you populate it with more than one room? Maybe the passed in references are destroyed / overwritten in some way during generation?
In the earlier screenshot only the last struct has valid room ref.
In theory yes , because the only point where the code cleans up the spawn arrays and destroys the actor is only when there is an overlap of its collision box.
But maybe it gets overwritten between spawns now that I think about it. Because the variable I pass in array gets reset. But before it gets reset, the map should have already received it. It was like that before too.
I can try to force the timing before the reset happens and see what happens in the map, but I find that absurd.