Coldwave Read the docs

animation#

Part of the scripting reference, written by the engine so it matches your frost. Start with your first game if you are new.

Use when animating sprites or models, playing clips and poses, tweening fields, emitting particles or handling animation events.

In a scriptDoes
bone(entity, "joint")World x, y, z, qx, qy, qz, qw of a unique model node, including this step's writes, without drawing; E0574 for a missing/ambiguous joint or invalid rig. See Bone
emit(entity, n)Emits n specks with the entity's Emitter look; returns one Burst. E0560: over 4096 alive at once; E0561: no Emitter; E0562: n is not a whole number from 1
tween(entity, "Transform", "x", to, seconds, { ease = "out_quad" })Takes one number field of an entity from what it is to to over seconds, a little each step, and returns the tween (an entity: despawn it to stop). Options: ease, from, loop ("restart", "pingpong"), done (an event sent when it ends). See Animation

Animation#

Two components move things without a line of script per step. Both are stepped after the scripts, so what a script decides in a step is on the frame drawn after it.

ComponentFieldTypeDefaultMeaning
Clipnametext""The clip to play, by its name under [clips] in the project file. Empty plays nothing
Cliptimenumber0Seconds into the clip. Set it to 0 to start again
Clipspeednumber1How fast time passes: 0 holds the frame, 2 plays twice as fast. Less than 0 is 0
Clipframewhole number0The frame showing, counted from 0. Written by the engine: read it, do not write it
Tweenslotwhole number0With generation, the entity whose field changes. tween() fills both
Tweengenerationwhole number0See slot
Tweencomponenttext""The component that holds the field
Tweenfieldtext""The field: a number or a whole number (which gets the nearest)
Tweenfromnumber0The value it starts from
Tweentonumber0The value it ends on, exactly
Tweentimenumber0Seconds since it began
Tweensecondsnumber1How long it takes. 0 or less is at once
Tweeneasetext"linear"How it gets there: see Easings
Tweenlooptext"""" once, "restart" from the start again for ever, "pingpong" there and back for ever
Tweendonetext""The event sent, about the changed entity, when it ends. Empty sends none
  • Clips. A clip is a run of frames on one picture, equal cells from left to right, declared once in the project file: run = { image = "art/hero.png", frame = [16, 16], at = [0, 16], count = 6, fps = 12 }. An entity with a Sprite and Clip = { name = "run" } shows it: the engine writes the sprite's src_x, src_y, src_w, src_h (and its image, when the clip names one) each step. A clip loops unless it says loop = false; then it stays on its last frame. To change clip, set name and set time to 0; setting only name carries on from the same moment, which is how a run and a run-with-sword stay in step. A name that is no clip stops the step with E1001.

  • Clip events. A clip may send events as frames come up: events = [{ frame = 2, name = "footstep" }] sends footstep about the entity, with the frame as its value, each time frame 2 comes up. end = "landed" on a clip that does not loop sends landed once, when its last frame has had its time. Scripts read them with events("footstep") in the next step, since animation runs after scripts.

  • Tweens. A tween changes one number of one entity from a value to another over a time. Start one with tween(entity, "Transform", "x", 200, 0.5, { ease = "out_quad" }) (see the script API). It is an entity of its own with a Tween, so an entity can have several at once, they are in the checksum, and despawn on what tween returned stops one. When it ends it writes to, sends its done event if it names one, and is gone. A tween whose entity is gone goes too. Two tweens on one field both write, and the later-made one wins.

  • Easings. linear, in_quad, out_quad, in_out_quad, in_cubic, out_cubic, in_out_cubic, out_back (past the end, then back) and out_bounce. in starts slow, out ends slow. Another name stops the step with E1002.

Scripted joints#

A 3D Bone overrides a model node after clip blending, or its rest without Pose. Ordinary set writes it in Luau and C#; removing it restores clip/rest. Overrides are world components: checksum, snapshots and replay keep them. bone(thing, "hand") reads the world pose; world.bone reads it over the protocol. Parent.joint attaches a tool using its Transform as the socket offset. Unevenly scaled turns have Parent's usual shear limitation. fixtures/pose has a script-only arm, held box and tip light.

Things with overrides or joint attachments advance their model clips before scripts; their clip events are therefore readable then. They draw the exact pose before shadows, without crowd rounding or rest-box culling. First adding one during a step holds its clip clock until the next step. Other clips retain their normal stage. Reads see all writes made so far; later scripts, tweens, Spin or Follow can still move things.

TOML
# Optional: animation clips, which an entity plays with `Clip = { name = "run" }`. A clip
# is `count` frames of `frame` image pixels each, left to right from `at` on `image`
# (left out: the sprite's own picture), shown at `fps` a second (left out: 10). It loops
# unless `loop = false`. `events` are sent as a frame comes up, and `end` when a clip
# that does not loop is over. See Animation.
[clips]
run = { image = "art/hero.png", frame = [16, 16], at = [0, 16], count = 6, fps = 12, events = [{ frame = 2, name = "footstep" }] }
land = { frame = [16, 16], at = [0, 32], count = 3, loop = false, end = "landed" }
TOML
# Optional: what a model's clip sends as a 3D thing's `Pose` plays it, by the clip's name:
# each event's name and the moment of the clip it is sent at (`at`, in seconds), about the
# thing, with the moment as its value; read by scripts in the next step with
# `events("step")`, in Luau and C# alike (a script plays a sound on it). `seconds` is the
# clip's length in the model (`assets.picture` lists it), and `loop` whether it goes round
# (left out: true; one that does not sends nothing once it holds its end), in every model
# the game loads with a clip of that name, whatever the cook found: a model's clip goes
# round when each joint ends within a millimetre, two degrees and a thousandth of its size
# of where it began, and is bent so it ends there exactly (no tick as it starts again). A game that loads a model whose clip of that name lasts another length
# is refused (E0486). `frost check` says (W0461) of a clip a `Pose` plays that holds its end
# though it nearly goes round (no joint off by more than ten times that), which joint and
# how far: a cycle exported a little off, which a line here has go round.
[poses]
walk = { seconds = 1.0, events = [{ at = 0.25, name = "step" }, { at = 0.75, name = "step" }] }
ComponentFieldTypeDefaultMeaning
Parentjointtext""Local to this model node of of; empty keeps ordinary parenting. E0574 for a missing or ambiguous joint. Uses the current pose, including Bone overrides
Boneoftext""Skinned thing's name. One override entity per joint; give it Parent.of too to despawn it with that thing
Bonejointtext""Unique model node name, including unweighted sockets; duplicates or matrix-only nodes are refused (E0574)
Boneqxnumber0Absolute local quaternion x; finite components, nonzero quaternion, normalised when sampled
Boneqynumber0Quaternion y
Boneqznumber0Quaternion z
Boneqwnumber1Quaternion w
Bonetranslationtrue or falsefalseOverride local translation too; otherwise keep the clip/rest translation
Bonexnumber0Absolute local translation x, metres; finite
Boneynumber0Translation y
Boneznumber0Translation z
Spinratenumber0Degrees a second, anticlockwise seen from the end of its axis. In 2D it turns Rotation.angle, kept from 0 to 360
Spinaxis_xnumber0In 3D, the axis it turns about, in its own frame: x
Spinaxis_ynumber0Its y
Spinaxis_znumber1Its z: about its own z, the way a 2D thing turns
Posecliptext""The clip, by its name in the model (assets.picture lists them). Set it to play another: set(thing, "Pose", "clip", "run"), read it to know which plays. Empty, or a name the model has not, is the rest
Posetimenumber0Seconds into the clip. Set it to 0 to start again; left, a new clip goes on from the same moment. A clip that ends where it began goes round (each joint within a millimetre, two degrees and a thousandth of its size; [poses] loop says otherwise), any other holds its end, in the picture and in the joints bone reads and a Parent.joint hangs from alike
Posespeednumber1How fast its time passes: 0 holds it. Less than 0 is 0
Posefadenumber0Seconds a change of clip mixes the pose it was in into the new one; 0 changes at once
Posefromtext""Written by the engine: the clip a fade is from, empty when none runs
Posefrom_timenumber0Written by the engine: that clip's time, going on under the fade
Poseblendnumber1Written by the engine: how far the fade has gone, 1 done
Posewastext""Written by the engine: the clip it played last step, which a change is seen against
Posethennumber0Written by the engine: the time it ended the last step at, which a fade starts from
Gaitidletext"idle"The clip below walk_at
Gaitwalktext"walk"The clip from walk_at
Gaitruntext"run"The clip from run_at
Gaitwalk_atnumber0.3Metres a second from which it walks
Gaitrun_atnumber3Metres a second from which it runs
Gaitwalk_speednumber1.4Metres a second the walk clip was made to go at
Gaitrun_speednumber4Metres a second the run clip was made to go at
Gaitfadenumber0.2Seconds each change of clip fades over
Gaitxnumber0Written by the engine: where it was last step, across
Gaitznumber0Written by the engine: and in depth
Gaitseentrue or falsefalseWritten by the engine: whether it has been seen a step yet
Gaitspeednumber0Written by the engine: metres a second it went over the ground this step
Emitterfiredwhole number0Engine-written total specks emitted, used to number them. Game state, in the checksum
Emitterseedwhole number0Picks speck directions and speeds: equal seeds emit equal patterns
Emitterlifenumber1Seconds a speck lives
Emitterspeednumber3Initial speck speed, units a second: between half and all of this value
Emitterspreadnumber30Maximum degrees from the thing's up at emission: either side in 2D, all around in 3D. 180: every way
Emittergravitynumber0Units a second squared a speck falls by along y: below 0 falls
Emittersizenumber0.2Initial speck width and height, in units
Emittersize_endnumber0Its size at the end of its life, grown or shrunk evenly to it
Emitteraddnumber12D light addition versus covering, 0 to 1; 3D specks always add
Emittercolorwhole number0xffd080Its colour as it leaves
Emittercolor_endwhole number0x000000Final colour: black fades an added speck out
Emitterlayerwhole number02D speck draw layer
Burstfirstwhole number0First speck's number: emitter's fired at emission
Burstcountwhole number0Speck count
Burstseedwhole number0The emitter's seed
Bursttimenumber0Seconds since emission, engine-written
Burstlifenumber1Emitter's life at emission
Burstspeednumber3Emitter's speed at emission
Burstspreadnumber30Emitter's spread at emission
Burstgravitynumber0Emitter's gravity at emission
Burstsizenumber0.2Emitter's size at emission
Burstsize_endnumber0Emitter's size_end at emission
Burstaddnumber1Emitter's add at emission
Burstcolorwhole number0xffd080Emitter's color at emission
Burstcolor_endwhole number0x000000Emitter's color_end at emission
Burstlayerwhole number0Emitter's layer at emission

Generated from Coldwave 0.0.1 r289, 2026-11-30 by the binary itself: do not edit by hand.