GAME INFORMATION
- GAME BUILD #: 16124732
- GAME PLATFORM: Steam
- OPERATING SYSTEM: Windows 11
ISSUE EXPERIENCED
The playerNumber parameter passed in to the xsEffectAmount function does not apply to the correct player when the scenario is started with players out of order.
FREQUENCY OF ISSUE
- 100% of the time
REPRODUCTION STEPS
- Create a new scenario
- Give player 1 and player 2 one castle each.
- Create a new trigger with the Script Call effect below:
void setP1CastleAttack() {
const int cPierce = 3;
xsEffectAmount(cAddAttribute, 82, cAttack, cPierce*256 + 50, 1);
}
This script call will add 50 pierce attack to player 1’s castle (unit 82)
-
Open the scenario in Single Player. Before starting the game, invert the players so that you are 2 (Red) and the AI is 1 (Blue)
-
When the scenario starts, it will be Player 2 (Red)'s castle that is affected by the script call.
-
Run the scenario again. This time, play as player 1 (Blue)
-
This time, Player 1 (Blue)'s castle will be affected by the script call.
EXPECTED RESULT
In both cases above, the xsEffectAmount call targeting player 1 should be applied to player 1.
In other words, the playerNumber parameter should be based on the actual in-game player number, instead of being based on the order of players in the game settings / lobby page.
Triggers that target player numbers follow the actual player number, so this causes a misalignment with the XS’s “player number” if players switch colors prior to starting the scenario.