Skip to content
ASArcaneMP Scripting APIScripting reference
Global objectClient APIGenerated

Creator

const Creator: object

Defined in: client/api.d.ts:2712

Live edits to the local player’s look, for a resource’s own character-creator UI.

applyPatch(patch): number

Queues one apply per entry and returns how many were queued. An entry that is malformed on its face is refused, logged and NOT counted: an unknown category, a bad “#rrggbb”, a color or an empty string where the category takes none. A well-formed id the game does not know is still queued and dropped on the game thread: each queued entry raises its own creatorChanged, whose change.ok says whether it applied. An EMPTY string clears the category, which only glasses, facialHair and facialHairColor support. hairColour, browColour and eyeColour also take a “#rrggbb” color, and browColour “hair” to follow the hair; a later preset of that category or a full-body preset replaces it. preset is applied FIRST because it can switch gender. Throws without an active session.

Record<string, string>

category -> option id, e.g. { hairStyle: “DA_HairMale012” }.

number

begin(options?): boolean

Claims the editing session and snapshots the appearance, so cancel() can restore it. Returns false if another resource already holds it — check before showing your UI.

Reserved; a session always starts from the current look today.

boolean

boolean

cancel(): boolean

Discards the edits and restores the snapshot taken by begin(). False if you don’t hold the session.

boolean

commit(): boolean

Keeps the edits: settles the look into its persistable form and releases the snapshot. False if you don’t hold the session. Queued patches are guaranteed to be applied BEFORE the settle – but this RETURNS IMMEDIATELY, it does not wait for the game to finish. Do not read the look off the back of it; wait for the server’s playerAppearanceChanged instead.

boolean

exportLook(): LookJson | null

The local player’s look as plain ids under the creator’s category names: what a person can read, edit, share and hand back to importLook or the server’s player.setLook. null when there is no live character. Never includes a transmog.

LookJson | null

getCapabilities(): CreatorCapabilities

What this build’s Creator API supports: version, whether a session is held and by whom, and a flag per feature. Branch on these rather than on the mod version.

CreatorCapabilities

getSchema(): CreatorSchema | null

Every category and the stable option ids it accepts. null until built (begin() primes it). GENDER-SCOPED: a full-body preset switches gender and re-resolves every category, so re-read after one.

CreatorSchema | null

getState(): CreatorState | null

The current selections, face gear, facial hair, voice and name. Refreshed after each applyPatch, so read it on creatorChanged rather than immediately after patching.

CreatorState | null

importLook(look): boolean

Applies a look given as ids to the local player. Validated synchronously: false, with the reason logged, when a field is malformed (a gear id without GA_, an unknown category, a newer version). True means it was QUEUED; the apply runs on the game thread and an id the game does not know is dropped there. Watch creatorChanged for the result.

string | LookJson

A look from exportLook, the server’s player.getLook or a stored copy, or its JSON text.

boolean

isActive(): boolean

Whether any resource holds a creator session.

boolean

previewVoice(): boolean

Plays the game creator’s voice sample line in the voice and pitch currently set, as its own creator does at every voice change. Queued after any setVoice before it, so call it right after one. Each call cuts off a sample still playing, so the newest voice is the one heard; it can start up to half a second late while the cut one fades out. Plays even under an Audio dialogue policy muting the player. Returns true once queued. Requires an active session.

boolean

setName(first, last?): boolean

Sets the character name. Requires an active session.

string

Given name.

string

Family name.

boolean

setVoice(voice): boolean

Sets the voice. Not a preset category, so it cannot ride applyPatch. Returns whether anything was queued; read the result back on creatorChanged. Requires an active session.

tone 0/1 = the creator’s VOICE ONE/TWO; pitch -2..+2, 0 = default.

number

number

boolean