I just resolved a bug I had in my code which was driving me crazy for 3 weeks.
The lack of the suggestion I want to make below caused me to suspect the wrong nodes for causing the problem
and I think if this simple feature is added it would have saved me a lot of headache.
The problem in short was:
- For 3 weeks I was getting the wrong data written into sav files via the save to slot node.
- First I thought it was the reference variable I was creating right after the save game object node so
that resulted in me not creating one but rather long spaghetti lines all over my event graph. - Then the problem became worse when I ran my laptop in battery mode.
- The problem also became worse right after a Windows update.
So first I thought the issue was the reference variable so I stopped using that.
Then I thought it was running UE4 in battery mode on my laptop.
Then I thought the problem was Windows update that broke something.
I spent a lot of time updating and adding to Visual Studio installs because I thought that might have something to do with it.
Then I thought the save game to slot node was bad and I was jumping from one BP to another trying to figure out why its not working
and why I am getting wrong data written into wrong slots.
Well … after 3 weeks of intermittent pain I finally figured it out.
It was none of the above actually.
It was a for each loop node (macro) where I was using the wrong output pin.
I was coming out of the loop body output pin and not completed output pin.
So as the speed of my machine was affected the loop was either completed or not.
And it was never consistent because the speed of my machine wasn’t so that makes sense to me now.
Now that I understand what was going on.
The bad thing was and I believe this added feature would be a great help, that the for each loop
node does not tell you if it completed its loop or not.
That killed me.
It was just getting the wrong information (not catching the latest updated info) from a variable in another BP.
Because it never completed the loop.
I was totally unaware of this and this let me to believe that all those other issues mentioned above might be the problem.
Below I am making a suggestion that would take care of this problem.
By simply adding a warning like you have on the casting node.
That would simply warn you that your loop did not complete and that you should
rather use the completed output pin.
I really think this would be a great addition.
TY