RATools
RATools copied to clipboard
Rich Presence: incorrect code when summing values in expression
16124-RATools.txt Here's a script demonstrating the issue. Look at line 545. This is a testing condition thing where the last value's expression sums a value with itself. The intended result is to get an AddSource in the expression and get the summed value, but instead it just chains them together with no operator. Try to make an RP out of this, there'll be a line where the expression is just chaining the same line twice. There's another function on line 582 which I want to sum properly, but I can't do that because this happens.
If you put a measured before it it works fine, whoops
The intended result is to get an AddSource in the expression and get the summed value, but instead it just chains them together with no operator.
This is actually correct. The legacy format for leaderboard values is just addition via underscores: https://docs.retroachievements.org/Value-Definition/#legacy-syntax
There's another function on line 582 which I want to sum properly, but I can't do that because this happens.
This is line 582:
rich_presence_value("Number", (ExpertModeTable(Region, TrialTables[CharID], 1) + ExpertModeTable(Region, TrialTables[CharID], 2)))
Which generates @Number(0xK1f4778_0xK1f4779)
, and K
is the size for bitcount
, so that seems correct to me.
Please clarify what you think is actually a problem here.
but instead it just chains them together with no operator
Are you just saying that it looks wrong because it's using the legacy format?
0xK1f4778_0xK1f4779
is the same as A:0xK1f4778_M:0xK1f4779
in the same way that 0xH1f4778*10_0xH1f4779
is the same as A:0xH1f4778*10_M:_0xK1f4779
.
As long as the expression is just addition and multiplication, the legacy format will be generated.