[...]
player.Say("%d", 100 + 10 - 20 - 30); -> 120 (WTF?!?)
[...]
Ohne Klammern rechnet AGS von rechts nach links.
also
20-30 = -10
=> 100 + 10 - (-10)
10- (-10) = 20
=> 100 + 20
100 + 20 = 120
Folglich kommt richtig 120 heraus
Laut Handbuch-Auszug zu Operators:
WARNING: When using operators of equal precedence, AGS by default evaluates them right-to-left. So, the expression a = 5 - 4 - 2;
evaluates as a = 5 - (4 - 2); which is not what you might expect. Always use parenthesis to make it clear what you want.
The "Left-to-right operator precedence" option on the General Settings pane allows you to control this behaviour.