Am I doing something wrong, or is this Map:Dictionary not saving my data?
I am attempting to store a list of squads, each with 9 members, with varying stats on each squad member. I found the Map:Dictionary feature for variables and figured it would be a great way to create a tree of variables.
When the attached screenshot is run, the first print string outputs 211, while the second print string outputs 0. This tells me that the 211 is not being added properly. If a default variable is set for 'AllSquads' variable, then both print strings output that default variable. This is obviously not the behavior that I have intended either and both seem to be a bug.
Either way, can someone point me in a direction that might solve this problem?
asked Apr 11 '17 at 05:42 AM in Blueprint Scripting
I figured out the issue with map. It wasn't a bug at lest in my case. I didn't notice that in blueprint you can set variables being passed to a function to be passed through as copy or as a reference to the actual variable just like is c++. Once i enabled pass as reference everything worked again. If i remember correctly this occurs when passing variables into functions and you can find the pass as reference option by single clicking on the function you are passing the variable through and looking at the details pane. If you have issues send me a private message with a link to your repository and ill take a look.
answered Apr 13 '19 at 01:35 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here