Bug with modifying attack and armor with xs script after Jan 31 patch

:arrow_forward: GAME INFORMATION

:point_down: These details are CRITICAL; DO NOT skip them or your issue may not be reviewed.

  • GAME BUILD #: 58259
  • GAME PLATFORM: Steam
  • OPERATING SYSTEM: Windows 10

:arrow_forward: ISSUE EXPERIENCED

:point_down: DESCRIBE THE ISSUE IN DETAIL (below). LIMIT TO ONE BUG PER THREAD.
Before the 58259 update, in order to change a unit’s attack (or armor) through xs script, the function was:
xsEffectAmount(cSetAttribute, UNIT_ID, cAttack, ARMOR_CLASS*256 + VALUE, PLAYER);
After the patch, instead of 256, the multiplying factor must be 65536, but just for cSetAttribute. For cAddAttribute or cMulAttribute, it still needs to be 256. I suppose that the intended behaviour was to update this factor to 65536 for every attack/armor manipulation, not just cSetAttribute.

:arrow_forward: FREQUENCY OF ISSUE

:point_down: How often does the issue occur? CHOSE ONE; DELETE THE REST!

  • 100% of the time / matches I play (ALWAYS)

:arrow_forward: REPRODUCTION STEPS

:point_down: List CLEAR and DETAILED STEPS we can take to reproduce the issue ourselves… Be descriptive!

Here’s the steps to reproduce the issue:

  1. Create a custom scenario, and place a test unit for player 1 (e.g. Skirmisher) and the same unit also for player 2
  2. Create a new trigger with a Script Call effect and use this in the message box:
void mod_attribute(){
xsEffectAmount(cSetAttribute, 7, cArmor, 4*65536 + 10, 1);
xsEffectAmount(cSetAttribute, 7, cArmor, 4*256 + 10, 2);
}
  1. When the scenario is tested, it is possible to see that the melee armor of blue’s skirmisher is increased to 10, while red’s skirmisher stays at 0 melee armor.
  2. Now back to the editor, edit the Script Call message to this one which is almost the same, but replacing cSet by cAdd:
void mod_attribute(){
xsEffectAmount(cAddAttribute, 7, cArmor, 4*65536 + 10, 1);
xsEffectAmount(cAddAttribute, 7, cArmor, 4*256 + 10, 2);
}
  1. When the scenario is tested, it is possible to see that this time around the melee armor of blue’s skirmisher remains unchanged, while red’s skirmisher has 10 melee armor. The same applies to multiply attribute, i.e. the factor 256 must be used.

:arrow_forward: EXPECTED RESULT

:point_down: What was SUPPOSED to happen if the bug you encountered were not present?
In both tests, only the blue skirmisher should receive 10 armor, either by setting or by adding the attribute, since the multiplying factor was supposedly updated from 256 to 65536.

:arrow_forward: IMAGE

:point_down: ALWAYS attach a PICTURE (.jpg, .png, .gif) or VIDEO (.mp4, YouTube link) that highlights the problem.

:arrow_forward: GAME FILES (SAVE / RECORDING)

:point_down: Attach a SAVE GAME (.aoe2spgame) or GAME RECORDING (.aoe2record) of the match where you encountered the issue. Link it below if using an external file service.

2 Likes

Hi @abutre11 !

Sorry for the delay. We are now tracking this issue!

Hi,the officials,I want to make the smiliar effect like the Sicilian silver tech – The first crusade that can spawn some units from the TownCenter.But I cannot find and reach the effect through XS,can you tell me how to write the parameters of the xsEffectAmount() in order to take it work?Thank you.