Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Global objectServer APIGenerated

Appearances

const Appearances: object

Defined in: server/api.d.ts:7406

The game’s own character-component catalog: every face, hairstyle, beard and skin a player’s body can be given.

Everyone on a fresh server is Henry, because a body with nothing chosen is the one the game hands out. This is where the alternatives come from; player.setAppearance is what puts one on somebody.

beards(head?, gender?): AppearanceOption[]

The beards that face can actually grow.

A beard is modelled against one head’s mesh and stored under that head’s own folder, so asking for one the artists never made for the face wearing it does nothing at all – no error, no beard, a body that comes back clean-shaven. The owning client refuses such a pair outright, so filter a chooser through this rather than through options("beard").

The 164 generic faces carry 24 each, Henry’s face carries the 15 the game’s own barber offers, and 14 faces carry none.

string

The face to ask about – a name from Appearances.options("head"). Omitted or empty means the face a body nobody has chosen one for wears.

"male" | "female"

Which half of the catalog the head came from; male by default.

AppearanceOption[]

The wearable beards, in the catalog’s own order. Empty for a female body, for a face with none, and for a name the catalog does not carry.

find(part, name, gender?): AppearanceOption | null

Looks one component name up, so a resource can check a name is real before handing it to a player.

"head" | "body" | "hair" | "beard"

Which part the name is for.

string

The component name to look up.

"male" | "female"

Which half of the catalog to look in; male by default.

AppearanceOption | null

What the catalog says about it, or null for a name it does not carry.

options(part, gender?): AppearanceOption[]

Every option the game ships for one part. The male tree has 212 faces, 262 hairstyles, 51 beards and 47 skins; the female tree has 61, 71, none and 41.

The hairstyle count is large because the game ships each style once per colour rather than colouring one. Group by option.group to get the styles back.

The 51 beards are the whole catalog, not what any one body can wear: a beard is modelled per face and only exists for the faces it was modelled for. Appearances.beards is the list to show somebody.

"head" | "body" | "hair" | "beard"

Which part to list.

"male" | "female"

Which half of the catalog to read; male by default.

AppearanceOption[]

The options, in the catalog’s own order.

random(gender?): Appearance

Picks one option for every part, which is the cheapest way to stop a server full of Henrys. Hand the result straight to player.setAppearance.

Uniform over the catalog rather than over what looks good together: the game’s own faces and hairstyles are authored for particular NPCs, so a random body is recognisably random. The beard is drawn after the face and only from what that face can wear, so the result is always one a client will accept.

"male" | "female"

Which half of the catalog to draw from; male by default.

Appearance

A complete appearance. beard is empty for a female one, which the catalog has none of, and for the fourteen male faces no beard was modelled for.