Download

Stuck with index arrays and changing values

I’m having trouble setting a array element value. No matter what I do in a function. The variable in the blueprint does not update. In the blueprint, there is a array named quests with several variables including quest name and a array of objectives progress containing a structure with a objective name and progress integer. As a progress structure. In a function to update progression. I loop through the quest with a foreach which uses the ref. Then I loop through the objectives. I use a quest name and objective name input to find the index of the objective.
When a match is found it updates. I tried creating a progress structure with objective name with new progress using a set element by reference. It looked like it work but when going back to the array. Nothing changed.
When I tried removing the objective element from the array. Then add a new progression structure with a name and progress value. It looked like it work but if I call the array again nothing change.
Lastly, I tried getting the element by reference then breaking it then increasing the progress value.
I am at a lost. In c++, I can just get that specific objective by referencing as the structure. Then update the values as needed.

Try the node “Set Members in XYZ” where XYZ is the name of your struct.
If that does not work, you need to re-add the struct you changed into the array (array.Add) with the given index.

I tried the latter first. I posted a screenshoot of everything on imgur. I’ll try the other method too and post screeenshoots. I think I’m doing it correctly. I’m not sure why the quest doesn’t update in characterbp correctly. :-/