Wax

Animations

game.Animations: the game's own clips, and animations written as keys in Lua for bones and for things.

The Explorer searches everything on this page, and the classes of the game too.

game.Animations

game.Animations: the game's own clips on anything with a skeleton, and animations written as keys in Lua.

Type name: WaxAnimations.

Open in the Explorer

game.Animations:Play(target?, clip, options?)

Plays one of the game's own montages or sequences on a character or a creature. For the player's own character give { first = path, third = path }: the arms and the body are two skeletons with clips of their own.

game.Animations:Play(target?: any, clip: string|{ first?: string, third?: string }, options?: WaxClipOptions): WaxClipPlay
ParameterTypeDescription
target (optional)anyA character or a creature. game.Me when omitted.
clipstring | { first?: string, third?: string }The path of a montage or a sequence of the game.
options (optional)WaxClipOptions

Returns WaxClipPlay

Open in the Explorer

game.Animations:Define(name, spec)

Makes an animation from keys. Nothing is asked of the game until it plays.

game.Animations:Define(name: string, spec: WaxAnimationSpec): WaxAnimation
ParameterType
namestring
specWaxAnimationSpec

Returns WaxAnimation

Open in the Explorer

game.Animations:Get(name)

The animation of that name, or nil.

game.Animations:Get(name: string): WaxAnimation?
ParameterType
namestring

Returns WaxAnimation?

Open in the Explorer

game.Animations:GetBones(target?)

The names of the bones of a target's skeleton, for writing tracks.

game.Animations:GetBones(target?: any): string[]
ParameterTypeDescription
target (optional)anygame.Me when omitted.

Returns string[]

Open in the Explorer

game.Animations:Find(text)

The paths of the game's montages and sequences whose path holds every word given. At most 200, then how many there were.

game.Animations:Find(text: string): string[], integer
ParameterTypeDescription
textstringWords such as "1st sledge montage".

Returns

  • string[] (paths)
  • integer (total)

Open in the Explorer

game.Animations:StopAll()

Stops every animation your mod is playing.

game.Animations:StopAll()

Returns nothing.

Open in the Explorer

WaxAnimationPlay

An animation that is playing.

You get one from model:Play, animation:Play. Below, play stands for one of these.

Open in the Explorer

PropertyTypeDescription
AnimationWaxAnimationAn animation written as keys, as game.Animations:Define gives it. It can play on any number of targets at once.

play:Stop()

Stops it now. A thing moved by a Self track goes back to where it was.

play:Stop()

Returns nothing.

Open in the Explorer

play:IsPlaying()

play:IsPlaying(): boolean

Returns boolean

Open in the Explorer

play:GetTime()

play:GetTime(): number

Returns number (seconds)

Open in the Explorer

play:SetRate(rate)

play:SetRate(rate: number)
ParameterTypeDescription
ratenumberMore than 0.

Returns nothing.

Open in the Explorer

WaxAnimation

An animation written as keys, as game.Animations:Define gives it. It can play on any number of targets at once.

You get one from game.Animations:Define, game.Animations:Get. Below, animation stands for one of these.

Open in the Explorer

PropertyTypeDescription
Namestring
LengthnumberSeconds.
Loopboolean

animation:Play(target?, options?)

Plays the animation. On a character or a creature its bone tracks move the bones, added to whatever the game is animating at that moment. On a thing of a blueprint or a part, its Self track moves the thing as a whole. On the player's own character it shows on the arms in first person and on the body in third. It costs nothing while nothing plays, and it stops when your mod unloads.

animation:Play(target?: any, options?: WaxAnimationPlayOptions): WaxAnimationPlay
ParameterTypeDescription
target (optional)anyA character, a creature, a thing of a blueprint or a part. game.Me when omitted.
options (optional)WaxAnimationPlayOptions

Returns WaxAnimationPlay

Open in the Explorer

WaxClipPlay

One of the game's clips that was started.

You get one from game.Animations:Play. Below, clip stands for one of these.

Open in the Explorer

clip:Stop(blend?)

clip:Stop(blend?: number)
ParameterTypeDescription
blend (optional)numberSeconds to blend out.

Returns nothing.

Open in the Explorer

clip:IsPlaying()

clip:IsPlaying(): boolean

Returns boolean

Open in the Explorer

WaxAnimationKey

One moment of a track. The first entry is the time in seconds, the second what is added at that time, the third how the way there is eased: "linear", "smooth", "in", "out" or "snap".

Open in the Explorer

FieldTypeDescription
any other key ([1])numberThe time, in seconds from the start.
any other key ([2])WaxAnimationValuesWhat is added to the bone or the thing at that time.

WaxAnimationValues

What a key adds. Everything is an offset from where the bone or the thing is without the animation, so a key of {} means "as the game has it".

Open in the Explorer

FieldTypeDescription
Pitch (optional)numberDegrees about the character's right: positive tips back, negative leans forward.
Yaw (optional)numberDegrees about up: positive turns to the right.
Roll (optional)numberDegrees about forward.
X (optional)number
Y (optional)number
Z (optional)number
Scale (optional)number1 leaves the size as it is.

WaxAnimationSpec

What game.Animations:Define makes an animation from.

Used by game.Animations:Define.

Open in the Explorer

FieldTypeDescription
trackstable<string, WaxAnimationKey[]>What moves, by name: a bone ("RightShoulder", or the name its skeleton gives it), or Self for the thing as a whole.
third (optional)table<string, WaxAnimationKey[]>Tracks for the player's body seen in third person, when they should differ from tracks.
reach (optional)table<string, WaxAnimationKey[]|WaxReach>Where the end of a limb goes: RightHand, LeftHand, RightFoot or LeftFoot. The two bones above it are bent to get it there.
reach_from (optional)"hand" | "shoulder""hand" (when omitted): a reach key adds to where the limb's end is. "shoulder": a key says where it is, forward, right and up of the limb's root, and the reach comes in from the game's pose and goes back to it.
reach_blend (optional)number | number[]With reach_from = "shoulder": the seconds a reach takes to come in from the game's pose, and to go back. One number for both, or { in, out }. 0.15 when omitted.
length (optional)numberHow long it runs, in seconds. The time of the last key when omitted.
loop (optional)booleanTrue starts it again when it ends.
ease (optional)"linear" | "smooth" | "in" | "out" | "snap"How keys are eased when a key does not say. "smooth" when omitted.
events (optional){ [1]: number, [2]: fun(play: WaxAnimationPlay) }[]Functions that run when the animation passes a time.

WaxReach

A reach that also turns the end of the limb.

Open in the Explorer

FieldTypeDescription
keysWaxAnimationKey[]X, Y and Z say where the end goes. Pitch, Yaw and Roll say how it is turned.
pin (optional)booleanTrue holds the limb's end where the game has it, in place and in turn, whatever the bones above it do: a foot stays flat on the ground while the hips sink and turn. Keys are not needed then.
bend (optional){ X: number, Y: number, Z: number } | number[]Which way the elbow or the knee points: forward, right and up.
bones (optional)string[]The limb's own three bones, from its root to its end, for a skeleton that is not a person's.
straight (optional)booleanTrue moves the end in straight lines between keys. When omitted it moves on a curve through them.
from (optional)"hand" | "shoulder"What this limb's keys are measured from, when it differs from the animation's reach_from.
turn (optional)booleanTrue uses Pitch, Yaw and Roll: with reach_from = "shoulder" they are the turn of what the hand holds, as the character stands. Otherwise they are added.

WaxAnimationPlayOptions

What animation:Play takes besides the target.

Used by model:Play, animation:Play.

Open in the Explorer

OptionTypeDescription
ratenumberHow fast it runs. 1 when omitted.
loopbooleanOverrides the animation's own loop.
weightnumberHow much of the movement is added. 1 when omitted.
keepbooleanTrue leaves a thing where its Self track put it when the animation ends.
donefun(play: WaxAnimationPlay)Runs when the animation has run to its end. Not when it is stopped.
view"first" | "third"On the player's own character: the one view it shows in. Both when omitted.

WaxClipOptions

What game.Animations:Play takes besides the clip.

Used by game.Animations:Play.

Open in the Explorer

OptionTypeDescription
ratenumberHow fast it plays. 1 when omitted.
blendnumberSeconds to blend in and out. 0.15 when omitted.
startnumberWhere in the clip it starts, in seconds.
slotstringThe slot a single sequence plays in. "DefaultSlot" when omitted.
loopsintegerHow often a single sequence plays. 1 when omitted.
partstring | { first?: string, third?: string }The part of a montage to play, by its name in the game, such as "Action_0".
matchbooleanWith first and third given: false lets each clip run at its own length. When omitted the body's clip is paced to last as long as the arms'.

On this page