Animation

Group
player
Methods
9
Fields
None

Getting one

client:loadAnimation(…)

Methods

MethodReturnsDescription
getId()numberThe animation's id, numbered as Actor:getAnimation() and AnimationID number them.
isMayaAnim()booleanWhether it is a skeletal ("maya") animation, whose frame is a count of client ticks, not a keyframe.
getNumFrames()numberHow many frames it has: a skeletal animation's length in client ticks, else how many keyframes (not its length in ticks: sum `getFrameLengt…
getDuration()numberHow many frames it lasts: a skeletal animation's length in client ticks, else how many frame lengths it has (1 for one with none).
getFrameStep()numberHow many frames it goes back when it loops; -1 for one that does not loop.
getRestartMode()numberWhat starting the animation again while it plays does: 1 starts it over, 2 (the value of an animation that sets none) only starts its loop…
getLeftHandItem()numberThe item (ItemID) the animation puts in the left hand while it plays; -1 when it puts none there (it leaves the hand alone, or empties it…
getRightHandItem()numberThe item (ItemID) the animation puts in the right hand while it plays; -1 when it puts none there.
getFrameLengths(){number}?How many client ticks each keyframe lasts, in frame order (a copy); nil for a skeletal animation.

Returned by

MethodReturnsDescription
Client.loadAnimationAnimation?Sequence id, for ClientObject:setAnimation; nil for one with no frames that is not skeletal.
DynamicObject.getAnimationAnimation?The animation it plays now, read when asked; nil when it plays none, or once its loc is gone. getAnimation():getId() is the id `GameObj…
Projectile.getAnimationAnimation?The animation it plays (its spot animation's), nil when it plays none.

Method details

getId

getId: (Animation) -> number

The animation's id, numbered as Actor:getAnimation() and AnimationID number them.

isMayaAnim

isMayaAnim: (Animation) -> boolean

Whether it is a skeletal ("maya") animation, whose frame is a count of client ticks, not a keyframe.

getNumFrames

getNumFrames: (Animation) -> number

How many frames it has: a skeletal animation's length in client ticks, else how many keyframes (not its length in ticks: sum getFrameLengths() for that).

getDuration

getDuration: (Animation) -> number

How many frames it lasts: a skeletal animation's length in client ticks, else how many frame lengths it has (1 for one with none).

getFrameStep

getFrameStep: (Animation) -> number

How many frames it goes back when it loops; -1 for one that does not loop.

getRestartMode

getRestartMode: (Animation) -> number

What starting the animation again while it plays does: 1 starts it over, 2 (the value of an animation that sets none) only starts its loop count over (Actor:getAnimationLoopCount()), anything else changes nothing.

getLeftHandItem

getLeftHandItem: (Animation) -> number

The item (ItemID) the animation puts in the left hand while it plays; -1 when it puts none there (it leaves the hand alone, or empties it).

getRightHandItem

getRightHandItem: (Animation) -> number

The item (ItemID) the animation puts in the right hand while it plays; -1 when it puts none there.

getFrameLengths

getFrameLengths: (Animation) -> {number}?

How many client ticks each keyframe lasts, in frame order (a copy); nil for a skeletal animation.