Changing Attack/Armor Of A Unit For A Class That A Unit Does Not Have By Default Does not Work

:arrow_forward: GAME INFORMATION

  • GAME BUILD #: 101.101.47820.0 6624001
  • GAME PLATFORM: Steam
  • OPERATING SYSTEM: Windows 10

:arrow_forward: ISSUE EXPERIENCED

In the Scenaro Editor,
The effects Change Object Attack/Armor and the Modify Attribute effect for the attributes Attack/Armour cannot change the attack/armor of a class that the unit does not have by default.

Other, related bugs:

effect_amount in RM Scripting and xsEffectAmount in XS Scripting also suffer from the same bug when trying to change the attack/armor of a unit.

For example, trying to give militia 100 attack on the attack class 5 (War Elephants) does not give them 100 damage against war elephants.

Trying to give militia 0 armor on the armor class 5 (War Elephants) does not make halberdiers deal 28 extra damage to them

Note that the effect works correctly when the armor/attack class being modified is already possessed by the unit.

:arrow_forward: FREQUENCY OF ISSUE

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

:arrow_forward: REPRODUCTION STEPS

Here are the steps to reproduce the issue:

Using XS Scripts:

  1. Write the following code in an XS Script:
const int SET_ATTRIBUTE = 0;
const int MILITIA = 74;
const int ATTR_ARMOR = 8;
const int ATTR_ATTACK = 9;
const int WAR_ELEPHANT_CLASS = 5;

void main() {
    xsEffectAmount(SET_ATTRIBUTE, MILITIA, ATTR_ARMOR, WAR_ELEPHANT_CLASS*256+0);
    xsEffectAmount(SET_ATTRIBUTE, MILITIA, ATTR_ATTACK, WAR_ELEPHANT_CLASS*256+100);
}
  1. Add the XS Script to a scenario or RMS (skip step 3 in case of an RMS)
  2. Add an effect in the scenario to call the main function via the Script Call effect
  3. Place down a militia, an enemy war elephant and a halberdier.
  4. When tested, the militia does not gain 100 attack against the war elephant nor does the halberdier deal the additional 28 damage that it should to the militia.

Using The Scenario Editor

Using The Modify Attribute Effect
  1. Create the following two effects in a trigger in the editor:
Modify Attribute
	Quantity: 0
    Armour/Attack Type: 5
	Object: Militia
	Source Player: Player 1
	Operation: Set
	Object Attributes: Armor
Modify Attribute
	Quantity: 100
    Armour/Attack Type: 5
	Object: Militia
	Source Player: Player 1
	Operation: Set
	Object Attributes: Attack
  1. Place a militia, an enemy halberdier and a war elephant.
  2. Test the scenario
Using The Change Object Attack/Armor effects
  1. Create the following effects in a trigger in the scenario editor:
Change Object Armour
	Quantity: 0
    Armour/Attack Type: 5
	Object: Militia
	Source Player: Player 1
	Operation: Set
Change Object Attack
	Quantity: 100
    Armour/Attack Type: 5
	Object: Militia
	Source Player: Player 1
	Operation: Set
  1. Place a militia, an enemy halberdier and a war elephant.
  2. Test the scenario

:arrow_forward: EXPECTED RESULT

The militia should deal 100 additional damage to the war elephant, and it should receive 28 additional damage from the halberdier

:arrow_forward: GAME FILES (SAVE / RECORDING)

Since .aoe2scenario is not an allowed extension, I’ve renamed them to be record files but they are actually scenario editor files. Simply rename them to have the .aoe2scenario extension and you should be able to use them in the editor to test the bug mentioned above.

Using Modify Attribute:
modify attribute.aoe2record (909 Bytes)

Using Change Object Attack/Armor
change object attack or armor.aoe2record (912 Bytes)

Using XS Script:
xs.aoe2record (931 Bytes)

1 Like