RATools icon indicating copy to clipboard operation
RATools copied to clipboard

Rich Presence: incorrect code when summing values in expression

Open PopovMark opened this issue 11 months ago • 3 comments

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.

PopovMark avatar Mar 09 '24 04:03 PopovMark

If you put a measured before it it works fine, whoops

PopovMark avatar Mar 09 '24 04:03 PopovMark

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.

Jamiras avatar Mar 17 '24 21:03 Jamiras

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.

Jamiras avatar May 15 '24 20:05 Jamiras