Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Runtime classServer APIGenerated

Marker

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

Replicated ground marker handle.

new Marker(id): Marker

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

Creates a script wrapper for an existing marker with this ID; use Marker.place() to draw one.

number

Network entity identifier.

Marker

Entity.constructor

remove(): void

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

Removes this marker from every client that can see it, after emitting markerRemove.

void


setVirtualWorld(world): void

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

Moves this entity into another virtual world.

number

Virtual-world identifier used to partition replication and visibility.

void

Entity.setVirtualWorld


setVisibleTo(player): void

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

Restricts replication of this entity to one owning connection while preserving normal range and visibility checks.

Entity | null

Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.

void

Entity.setVisibleTo


toString(): string

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

Formats this marker handle for logging and debugging.

string

The marker ID, its material and its size.

Entity.toString


static all(virtualWorld?): Marker[]

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

Lists every replicated marker the server currently has.

number

Optional virtual world to list; omitted lists every one of them.

Marker[]

One handle per live marker, in no particular order.


static getById(id): Marker | null

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

Looks a replicated marker up by its network entity ID.

number

Network entity identifier.

Marker | null

The marker’s handle, or null when no live marker has that ID.


static list(prefix?): string[]

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

Every decal material the shipped game preloads, in order. Mined from the game’s own material folder at build time, so it is the same list the client has.

string

Keep only the names starting with this, e.g. materials/decals/burglar.

string[]

The matching names.


static place(material, position?, options?, virtualWorld?): Marker

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

Puts a marker in the world and leaves it there. It is a replicated entity, so the interest grid streams it to whoever comes near and takes it away again when they leave – which is what a zone or a checkpoint needs and what a one-shot message cannot do. How far it streams is taken from its own extent, between 50 and 400 metres.

string

Decal material to project, spelled as the game’s own data spells it – materials/decals/chalk_cross. Marker.list() is the whole vocabulary.

Vector3 | Partial<Vector3>

Optional world-space position; omitted components default to zero.

shape picks what it is made of – decal projects onto the surface under it, the rest stand in the world as meshes and can be seen from below a ridge. rotation aims it, so a marker laid on a wall is the same call with a different rotation; size and height are its extent in metres; spin and bob give a mesh marker motion; color tints it.

number

number

number

Vector3 | Quaternion

"decal" | "cylinder" | "sphere" | "chevron" | "cube" | "plane"

number

number

boolean

number

Optional virtual world the marker belongs to; omitted puts it in the global one.

Marker

The newly drawn marker handle.


static removeAll(virtualWorld?): number

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

Removes markers, emitting markerRemove for each one.

number

Optional virtual world to clear; omitted clears every one of them.

number

How many markers were removed.

bob: number

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

How far the marker rises and falls from its resting height, in metres, up to 4; 0 stands still. Played on each client’s own clock. Ignored by decal, which cannot leave the surface it projects onto.


color: number

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

Packed 0xRRGGBBAA tint, or 0 for the material as it ships. The shipped material is shared by everything that names it, so a tint is a private clone rather than a write to the original – which is why assignment rebuilds the marker.


readonly group: string

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

Subfolder the material came out of under materials/decals/, empty at the top level.


height: number

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

How tall a mesh marker stands, in metres, from 0.25 to 64. Ignored by decal, sphere and plane, which are sized by width alone.


readonly id: number

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

Immutable network entity identifier.

Entity.id


readonly material: string

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

Decal material this marker is drawn with, e.g. materials/decals/chalk_cross. Read-only: a decal node reads its material once, so a marker is the one it was placed as.


position: Vector3

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

Authoritative world-space position; assignment forces replicated state.

Entity.position


rotation: Vector3 | Quaternion

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

Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.

Entity.rotation


readonly shape: string

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

What the marker is made of: decal for the projected one, or cylinder, sphere, chevron, cube or plane for a mesh standing in the world. Read-only: changing it is a rebuild, so place a new marker instead.


size: number

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

How wide the marker is, in metres, from 0.25 to 64; a value outside that is clamped into it. Assignment restates it in place rather than rebuilding, and widens how far the marker streams.


spin: number

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

Degrees per second the marker turns about its own up axis, from -720 to 720; 0 stands still. Played on each client’s own clock, so two players need not see it at the same angle. Ignored by decal.


readonly state: StateBag

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

Arbitrary key/value state carried by this entity. The server writes it and every client that can see the entity receives it; see StateBag.

Entity.state


trigger: boolean

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

Whether clients watch the local player against this marker’s volume and report crossings, which is what raises markerEnter and markerExit. Off by default: a marker nobody listens to should cost nothing but its draw.


readonly virtualWorld: number

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

Current virtual-world identifier.

Entity.virtualWorld