Skip to main content
reskate.board reads the local skateboard and changes what is drawn of it. reskate.board.motion needs the skater.read permission; every other function needs the board permission. Calling a function without its permission raises an error. See permissions. A plugin changes only what is drawn. The next animation update writes the whole pose again, and what the plugin asked for is written over it every frame, as the pose goes to the renderer. The board itself, its physics and the skater riding it do not change.
set, toss and set_parameter change your own board as your game draws it, and hide does too unless you ask for others. park and fit change every board your game draws, other players’ boards included, but only on your game. scale is the one change other players see without asking: a board’s sizes travel with your skater, held to the session’s limit.

The rig

The board is a rig of 16 bones, numbered 0 to 15. Each bone sits in its parent’s frame. The functions that change bones take 2 to 15. Any other bone number raises an error. ReSkate knows no particular deck. It does nothing with bones 12 to 15 itself, and it does not fit the trucks to a deck. A plugin that ships a deck model of its own does both: it parks the stretches with park and fits every board with fit. The Board Break plugin, which comes inside its deck pack, does this (contrib/plugins/board-break/plugin/main.lua and breaker.lua in the ReSkate repository).

Local and world space

A bone you set is either in "local" space, its own parent’s frame, as the pose holds it and as bones() reads it; or in "world" space, a position and rotation in the world. A world-space bone is written relative to wherever the board’s place (bone 1) is that frame, so it stays put in the world while the board moves. Use world space for a bone that hangs on bone 1.

Reading

reskate.board.motion()

The board’s velocity and spin in the last physics step, and where the board and its deck were last drawn in the world. For effects that follow the board: a deck that sloshes, glows with speed or ripples on a landing.
table or nil
nil without a board.
Needs the skater.read permission.

reskate.board.bones()

The local board’s 16 bones as last drawn, each in its parent’s frame. Only the board the local skater has now: after a map load, nil until that board is drawn.
table or nil
nil without a board. A table indexed 0 to 15 (note the 0: ipairs skips it).
Needs the board permission.

Changing

One plugin holds the local board at a time. The first set, hide or toss takes it; another plugin’s call is refused with "<plugin> holds the board" until the holder clears every bone it set and its tossed piece.

reskate.board.set(bone, pose)

Draws a bone where you say, every frame, until you clear it.
number
required
2 to 15.
table
required
boolean
True when the bone is set.
string
Why not: "<plugin> holds the board" or "a bone's place is finite".
Only the bone’s position and rotation are written; its scale stays as the animation has it.
Needs the board permission.

reskate.board.hide(bone)

Moves a bone out of sight (far below the board), every frame, until you clear it. What hangs on the bone goes with it.
number
required
2 to 15.
table
boolean
True when the bone is hidden.
string
"<plugin> holds the board" when another plugin has it.
Needs the board permission.

reskate.board.scale(bone, size)

Draws a bone bigger or smaller, until you end it. The animation still turns and places the bone; only its size changes, along the bone’s own axes. What hangs on the bone grows with it: a bigger deck mount (bone 2) is a bigger board, trucks and wheels included.
number
required
2 to 15.
number or vector
One number for every axis, or a vector for each axis on its own, each 0.25 to 4. Leave it out to end your size on this bone.
boolean
True when the size is held (or ended).
string
With false: "a bone's size is 0.25 to 4 on each axis", or "<plugin> sizes that bone" while another plugin sizes it.
Unlike set and hide, sizes do not take the board: one plugin sizes a bone at a time, and different plugins can size different bones. clear ends your sizes too, on that bone or on every bone. Sizes show to the other players. They go in the pose your game sends, and a board’s bones are held there as a skater’s resized bones are: a dedicated server holds them to its bone_scale_limit (2 unless its owner changed it), and every game holds a pose it receives to 8. The limit counts down the board’s rig, so a big board with big wheels on it shows within it together, and a board bone never shows past 4. On your own screen the board is as big as you asked.
Needs the board permission. A bone that is not 2 to 15 raises an error. When the plugin stops, its sizes end.

reskate.board.clear(bone)

Gives bones back to the animation.
number
2 to 15: that bone only, set or hidden. Without it: every bone this plugin set or hid, its tossed piece, and its park list.
Returns nothing. Clearing what the plugin does not hold does nothing.
Needs the board permission. When the plugin stops, everything it did to the board is cleared.

reskate.board.park(bones)

Keeps these bones out of sight on every board your game draws, other players’ too. It is meant for a breakable deck’s stretches (12 to 15): the game draws a deck’s layers so that stretches left inside the deck would show through as cracks. ReSkate does not park them for you: a plugin that ships such a deck parks them as it starts, as Board Break does.
table
required
A list of 0 to 16 bone numbers, each 2 to 15. It replaces this plugin’s list; an empty list {} parks nothing.
Returns nothing. Every plugin has its own list; a bone is parked while any list has it. park does not take the board, so it works while another plugin holds it.
Needs the board permission.

reskate.board.toss(bones, motion)

A piece of the board comes off: these bones leave together from where they are drawn, fly, fall, land flat on the ground height you give, slide a little and lie there until you clear them. The bones should hang on bone 1 (the deck’s mount and what is on it, or a deck’s stretches).
table
required
A list of 1 to 16 bone numbers, each 2 to 15.
table
required
boolean
True when the piece is tossed.
string
Why not: "<plugin> holds the board", "a piece leaves at most 50 m/s, turning at most 50 rad/s" or "asked more than 4 times in a second".
A plugin has one piece at a time: a new toss replaces the last. clear() without a bone takes the piece away.
Needs the board permission (and world.raycast for the example’s raycast). Shares the budget of 4 control calls a second with skater.noclip, boost, freeze, camera.follow, ai.spawn, animation.play and outfit.set.

Fitting every board

reskate.board.fit(fit)

Fits every board your game draws, other players’ included, to a deck model that is not the game’s own: its trucks’ baseplates held on the deck as the trucks steer, and its wheels as far apart as the deck’s trucks have them. Use it when your mod replaces the game’s deck model.
table or nil
required
nil ends your fit, and the boards are drawn as the game has them.
boolean
True when the boards are fitted, or your fit has ended.
string
Why not: "a board's axle spread is 0.8 to 1.6 (1: the game's own)", or "<plugin> fits the boards" while another plugin’s fit holds.
One plugin fits the boards at a time. The first fit takes them; another plugin’s is refused until the holder calls fit(nil) or stops. Calling fit again replaces your own fit. A fit of {} (no plates, axle 1) changes nothing, but still holds the boards. fit does not take the board: it works while another plugin holds the local board with set, hide or toss, and clear() does not end it.
Needs the board permission. An axle that is not a number raises an error. When the plugin stops, its fit ends.

Shader parameters

Each part of your board is drawn by its own material, and each holds a few shader values of its own. The renderer takes them for your board alone. A plugin can read all of them, and hold a colour or a number there, for example to make the deck’s graphic glow with speed or pulse on a landing. The game keeps no names for these values. Each one is known by its key, 16 hex digits. Two colours are known by what they colour, and you can use their names as keys: To find what any other key does, read the part’s parameters, change one, and watch your board.
Only colours and numbers can be set. An integer or a switch picks how the board is drawn, and some of those choose looks the store sells (the foil decks), so plugins can only read them. Nothing of your board’s items changes, and nobody else sees what you set: other players draw your board from its cosmetics, as they are.

reskate.board.parameters(part)

The part’s parameters as its material holds them now.
string
required
"deck", "grip", "trucks" or "wheels".
table or nil
nil without a board in play. A list; empty when the part has no material of its own.
Needs the board permission.

reskate.board.set_parameter(part, key, value)

Holds a colour or a number on the part, written every frame until you clear it. A new value for the same key replaces the last one, so you can set it every tick to animate it.
string
required
"deck", "grip", "trucks" or "wheels".
string
required
16 hex digits, "graphic" or "base". A key that is not one raises an error.
table or number
required
For a colour, {r = , g = , b = }, each 0 to 1. For a number, a number from -100 to 100. A value that is not finite, or a colour without all three channels, raises an error.
boolean
True when the value is held.
string
Why not, for example "there is no board in play", "the wheels has no parameter 873f48af36e50d59", "b00abec403499469 is an integer, which picks how the board is drawn; plugins only read it", "a colour's channels are 0 to 1", "<plugin> holds the grip's 873f48af36e50d59" or "a plugin holds at most 32 board parameters".
A part only has the keys its material holds now (the deck and grip about eight, the trucks and wheels three). A key it does not have is refused. One plugin holds a key of a part at a time: another plugin’s set_parameter on it is refused until the holder clears it or stops. Changing the board’s cosmetics gives the parts new materials; what you hold is written onto them too.
Needs the board permission.

reskate.board.clear_parameter(part, key)

Lets go of what you hold, and the board’s own value comes back.
string
That part only. Without it: every part.
string
That key only. Without it: every key of the part (or of every part).
Returns nothing. A value the game changed since you set it is left as the game has it.
Needs the board permission. When the plugin stops, everything it holds is let go.