Skip to content

Tune auto-attacks

Designer · 20 min · No code

Result: the free auto-attack that runs while you are engaged swings at the speed, reach and rhythm you want, uses your own swing animations, and fills the Talent Gauge at your chosen rate.

Before you start

What decides an auto-attack

What Where
Reach, rhythm, animations, root motion The auto-attack ability, Battle/GA_XenoCore_AutoAttack (party). Enemies have their own, for example Characters/Enemies/Minion/GA_XenoCore_Minion_Attack
Per-weapon-type swings and reach The equipped weapon's type, Weapons/Types/DA_XenoCore_WeaponType_*, Attack category. Filled in, it replaces the ability's Attack Montages, Attack Montages Stationary and Attack Range for that type; empty uses the ability's. The shipped Greatsword type leaves them empty
Damage The attacker's Strength and weapon attack range against the target's Physical Defence (Stats and damage)
Speed The AutoAttackSpeed attribute: 1.0 normal; Slow and Haste change it
Talent charge per hit TalentChargePerHit on the character's stats effect

The cadence is swing length + Swing Recovery, divided by AutoAttackSpeed. Swing length comes from the animation itself, so a longer clip spaces itself out rather than overlapping the next.

The ability's settings

Open Battle/GA_XenoCore_AutoAttack and click Class Defaults. Everything is under XenoCore › AutoAttack unless noted.

Setting Default What it does
Attack Range 300 (the C++ default is 420; the shipped ability overrides it) How far the swing reaches, centre to centre, in cm. A swing only starts inside it
Contact Reach Tolerance (XenoCore › Attack) 60 Extra reach at the moment of contact only, so a target drifting a little during the windup is still hit
Swing Recovery 0.35 Idle seconds between one swing ending and the next starting
Montage Play Rate 1.0 Speeds every swing up (and its hit) without new animations
Attack Montages A, B, C upper-body swings Played in order and looped while moving
Attack Montages Stationary The same swings, full body Played when standing still. Empty = use Attack Montages always
Stationary Speed Threshold 20 Below this ground speed the character counts as standing still
Cancel Full Body On Move on Moving mid-swing hands the swing over to the upper-body copy so the legs can run
Full Body Cancel Blend Out 0.1 Blend for that hand-over
Root Motion When Stationary on Uses the animation's root motion when standing. Shipped clips have none, so this is inert until you add some
Face Target On Attack off Snap to face the target as a swing starts. Meant for enemies
Face Target Turn Rate (XenoCore › Attack) 0 Turn over the swing instead of snapping. 0 = snap
Target Source Target Lock Where the target comes from: the player's lock, or the nearest hostile (enemies)
Requires Arming on Draw the weapon before the first swing. Off for enemies, which have no draw
Damage Effect GE_XenoCore_Damage The effect that runs the damage formula
Additional Effects none Extra effects applied on every landed hit
Talent Charge Effect (XenoCore › Talent) GE_XenoCore_TalentCharge Fills the attacker's gauge on a landed hit

Steps

Make swings faster

Raise Montage Play Rate to 1.25 and lower Swing Recovery to 0.2. Both speed up the whole loop; the play rate also speeds the animation itself.

Make the reach longer

Raise Attack Range. Keep it a little above the target-mode strafe range (400 on GA_XenoCore_TargetMode, see Tune targeting) so the character faces the enemy whenever it is close enough to hit it. Each Art's default Distance is 420 too; change those if you want Arts to match.

Use your own swings

To give one weapon type its own swings, put them on its weapon type asset (Attack Montages, Attack Montages Stationary, Attack Range) instead of the ability; the steps below are the same. To change every party member's default swings, edit the ability.

  1. Make one montage per swing. Put the moving set on the UpperBody slot and, if you want whole-body swings when standing still, a copy of each on FullBody.
  2. On every montage, at the contact frame, add the notify XenoCore Gameplay Event with Event Tag XenoCore.Event.MeleeHit. Copy it from AM_XenoCore_Attack_A.
  3. Set Attack Montages and Attack Montages Stationary to your sets, in the same order.

Fails silently: the swing animates and deals no damage

The hit is the notify. A swing montage without the XenoCore.Event.MeleeHit gameplay-event notify plays and never hits, and nothing is logged. Every montage needs one.

Keep the two sets matched

The moving and stationary sets must be the same animations, same length, same notify times. The hand-over when you start moving jumps to the same position in the other set.

Change how fast the gauge fills

Edit the TalentChargePerHit modifier on the character's stats effect: a percentage of the 0–100 gauge per landed hit. 25 fills in four hits. See Author a character's statline.

Change what Slow and Haste do

They lower or raise AutoAttackSpeed by the percentage the applying Art or skill sends as its Magnitude, or by 30 % (×0.7 / ×1.3) when it sends none. Change the strength on the Art's effect entry rather than in Battle/Status/GE_XenoCore_Status_Slow or _Haste; to change the fallback, duplicate them as your own statuses (Make a status effect).

Test it

  1. Press Play in Maps/L_XenoCore_Gym, lock on to a minion and engage.
  2. Stand still: full-body swings. Walk: the swing carries on in the upper body.
  3. Time five swings before and after your change.
  4. Watch the Talent ring on the palette fill with each hit that lands, not with misses.

If it doesn't work

The character never swings

Out of Attack Range, or still drawing the weapon. To see why, type log LogXenoAttack Verbose in the console: the output log then records why the loop is idle, once each time the reason changes.

Enemies stand next to you and never swing

Their auto-attack has Requires Arming on. Enemies have no draw, so the loop waits forever. Turn it off on enemy auto-attacks.

Swings whiff at the edge of range

Raise Contact Reach Tolerance slightly. It widens only whether a started swing connects, not who gets attacked.

Going further