Skip to content

tes3actionData⚓︎

A substructure of mobile actors that provides information about the current or previous action.

Properties⚓︎

aiBehaviorState⚓︎

The behavior state. This maps to values in tes3.aiBehaviorState namespace.

Returns:


animationAttackState⚓︎

The actor's animation state. Maps to values in tes3.animationState namespace.

Returns:


attackSwing⚓︎

When attacking, this value represents how much the weapon has been pulled back. The value ranges from [0.0 - 1.0].

Returns:

  • result (number)

blockingState⚓︎

A state index that indicates an actor's blocking state. It is zero when not blocking and non-zero when blocking. A value of 1 indicates a state transition from non-blocking to blocking, while a value of 2 means blocking is active (where the block animation is currently playing and should not be interrupted).

Returns:

  • result (number)

currentAnimationGroup⚓︎

Actor's current animation group. Maps to values in tes3.animationGroup namespace.

Returns:


hitTarget⚓︎

The actor's attack target. The target will be saved in hitTarget field until a new attack is made. Missing an attack will clear hitTarget field.

Returns:


lastBarterHoursPassed⚓︎

A 16-bit hourstamp of the last time a merchant's barter gold was at its base level. It is used as a timer for resetting barter gold, which happens on interacting with a merchant at hourstamp lastBarterHoursPassed + GMST fBarterGoldResetDelay or later. Barter gold can also reset when a mobile expires.

Returns:

  • result (number)

nockedProjectile⚓︎

The currently nocked projectile the associated actor is using. It is available while charging a projectile attack, before releasing the projectile. This can be modified, but can only be set to nil, which will remove the projectile without consuming ammo.

Returns:


physicalAttackType⚓︎

A number from the tes3.physicalAttackType enumeration identifying the physical attack type. Can be tes3.physicalAttackType.slash, .chop, .thrust, .projectile, .creature1, .creature2, or .creature3.

Proper time to change the attack direction is the attackStart event. See the example below to see how.

Returns:

Example: Changing axe attack direction
-- In this example, we force the attack
-- direction for axes to always be chop

---@param e attackStartEventData
local function onAttackStart(e)
    local mobile = e.reference.mobile
    if not mobile then return end

    local weapon = mobile.readiedWeapon.object --[[@as tes3weapon]]

    if weapon.type == tes3.weaponType.axeOneHand
    or weapon.type == tes3.weaponType.axeTwoHand then
        -- Now actually change the attack direction
        e.attackType = tes3.physicalAttackType.chop
    end
end

event.register(tes3.event.attackStart, onAttackStart)

physicalDamage⚓︎

When attacking, this is the value of the weapon damage that was rolled. This value takes into account the actor's strength, attack swing and weapon condition, but it doesn't include difficulty nor target's armor. This value is updated on an attack. After the attack this value will still contain the damage rolled. It will be refreshed on a new attack.

Returns:

  • result (number)

stolenFrom⚓︎

No description yet available.

Returns:


target⚓︎

The actor's attack target, stored until the actor attacks successfully again. In contrast to hitTarget, target property isn't cleared on missed attack.

Returns:


walkDestination⚓︎

If moving to a location, this is the position to be walked to.

Returns: