calcMoveSpeed⚓︎
This event is called when an actor’s movement speed is calculated. The event allows modification of this value, to dehardcode actor movement speeds. Invoked after all other movement speed events are finished.
The movement event flow is described below:
- Walking: calcWalkSpeed -> calcMoveSpeed
- Running: calcWalkSpeed -> calcRunSpeed -> calcMoveSpeed
- Swimming: calcWalkSpeed -> calcSwimSpeed -> calcMoveSpeed
- Swimming (while running): calcWalkSpeed -> calcSwimSpeed -> calcSwimRunSpeed -> calcMoveSpeed
- Flying: calcFlySpeed -> calcMoveSpeed
--- @param e calcMoveSpeedEventData
local function calcMoveSpeedCallback(e)
end
event.register(tes3.event.calcMoveSpeed, calcMoveSpeedCallback)
Tip
An event can be claimed by setting e.claim
to true
, or by returning false
from the callback. Claiming the event prevents any lower priority callbacks from being called.
Event Data⚓︎
mobile
(tes3mobileActor): Read-only. The mobile actor whose speed is being calculated.reference
(tes3reference): Read-only. mobile’s related reference.speed
(number): The previous speed calculated, starting with the base engine values.type
(number): Read-only. The type of movement that was calculated. This is always 0 for this event.
Examples⚓︎
Example: 20% Faster Player Movement
local function onCalcMoveSpeed(e)
if (e.reference == tes3.player) then
e.speed = e.speed * 1.2
end
end
event.register(tes3.event.calcMoveSpeed, onCalcMoveSpeed)
Related events⚓︎
calcMoveSpeedcalcWalkSpeedcalcRunSpeedcalcFlySpeedcalcSwimSpeedcalcSwimRunSpeed