Hardpoints are the mechanism through which units wield weapons.
For a unit to deal damage, they must have a weapon assigned to one of its, and it is this weapon that deals damage, not the unit. Think of these hardpoints as "weapon slots" where the unit can equip a weapon.
The stats of each of these weapons are contained in a single refenced file, allowing multiple units to reference and "wield" the same weapon.
Spearman Hardpoint Example
The steps below will continue with the spearman example, working with hardpoints to manipulate the spearman's weapon damage and attack characteristics.
1) Open the Hardpoints Node
With your unit selected, open the combat_ext node for that unit.
Then, navigate to: hardpoints > 1.hardpoint > weapon_table to access a list of weapons for the unit.
Units can possess up to 4 weapons, listed as 1.weapon, 2.weapon, 3.weapon, and 4.weapon. Most units, like the spearman, only possess a single weapon. It is not recommended you change the order of weapons for a unit, as it has a high likelihood of breaking the unit's functionality.
Navigate to 1.weapon > non_entity_weapon_wrapper. This is where the statistics for the weapon are located.
In the example below, the highlighted reference is to the spearman's basic weapon blueprint. This weapon blueprint will contain all the combat stats for the spearman's weapon.
2) Access the Weapon Blueprint
To change the data being fed to the spearman's weapon you need to open the file that contains this data.
Right-Click the non_entity_weapon_wrapper for the weapon and select Go to Reference from the menu.
This will open the weapon data file.
3) Clone the Weapon
To edit a weapon, you need to clone it and navigate to its stats. This process involves several steps, detailed below.
1- Open the Weapon Viewer
In the Main Menu, open the Attributes tab and select Weapons
This will take you to the main weapons render view.
2 - Open the Common Weapons
Navigate to Attributes > Races > Common > Melee
3 - Clone the Target Common Weapon
Then, find weapon_spearman_1 in the list, Right-Click and Clone it.
Your new cloned weapon will now appear under your mod and be ready to edit.
4) Change the Weapon Damage
Select your new cloned weapon and navigate to weapon_bag > damage.
Unit damage is listed here in a minimum and a maximum, which is the range of damage the unit deals with each attack.
By default, units in Age of Empires 4 possess identical min and max damage values as there is no damage variance in the core game, but these values can be set to whatever range you wish.
Change the weapon damage for the spearman to 7 in both the min and max fields. The weapon damage for the spearman's spear will now be set to 7.
To continue this tutorial, proceed to: Example 6 - Weapons Masterclass