I looked at the code that you are referring to and it does appear that, depending on what you are trying to accomplish, it may not do what you want. For something like a counter stat, such as total time played, this should work fine. However, if you are trying to update a list of high scores, then this wouldn’t do what you want.
, you are correct.
I am trying to update a high score list, which I would think would be pretty standard for a leader board.
Now, another problem I may run into is checking if the current high score exceeds the players existing leader board score.
Ideally being able to get and set stats in ue4 code would be ideal, this would eliminate any issues.
I have worked around the problem in my own code by bypassing the ue4 code and going straight to the steam code, which isn’t nice but let’s me work around the issue.
I have submitted a report about the issue that you described (UE-24791). We will look over this segment of code again and see if it can be improved on.
I thought I had seen a Pull Request on GitHub related to this recently, but when I went looking for it today I wasn’t able to find it. I glanced over the fix proposed in the link you provided and I am not sure it would be a complete fix for all possible needs.
It does seem to solve the issue where you would need to replace a previous stat with the current stat if the current stat is larger. However, what if you wanted the stat to track the lowest value (fastest time through a level, for example), or wanted the stat to be cumulative as it is now (total time played, for example)? The proposed fix does not appear to take those options into consideration.
Thank you for letting us know that this issue is still important to you. The ticket that I had entered previously was closed due to an extended period of inactivity. I have re-opened that ticket again. The ticket for Malharhak’s pull request is still open and waiting to be reviewed.
I changed those two lines of code and re-saved the cpp file yet it’s still adding the new value to existing. I also tried restarting the editor. Am I missing something? Any help greatly appreciated!