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

StonePile

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

Replicated handle for a pile of hurling stones on a battlement.

new StonePile(id): StonePile

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

Creates a script wrapper for an existing stone pile with this ID; use StonePile.spawn() to place one.

number

Network entity identifier.

StonePile

Entity.constructor

destroy(): void

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

Removes the pile on every client after emitting stonePileDestroy. A stone already thrown still lands.

void


setVirtualWorld(world): void

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

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:9896

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:7036

Formats this pile handle for logging and debugging.

string

The pile ID and the stones it has left.

Entity.toString


static all(virtualWorld?): StonePile[]

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

Lists the stone piles the server has.

number

Optional virtual world to list; omitted lists every one.

StonePile[]

One handle per pile, in no particular order.


static destroyAll(virtualWorld?): number

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

Removes stone piles, emitting stonePileDestroy for each one.

number

Optional virtual world to clear; omitted clears every one.

number

How many were removed.


static getById(id): StonePile | null

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

Looks a pile up by its network entity ID.

number

Network entity identifier.

StonePile | null

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


static spawn(position, rotation?, virtualWorld?): StonePile

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

Places the game’s own battlement pile of hurling stones, the Nebakov and Suchdol defenders’ heap. Its prompt, the lift and the heave over the wall are the game’s stone throwing; each stone is a real rigid body that falls where it falls.

Vector3 | Partial<Vector3>

Where the thrower stands on the walk, behind the parapet.

Vector3 | Quaternion

Its facing: forward is the way the stones go, over the wall. A Quaternion, or a Vector3 of Euler angles in degrees.

number

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

StonePile

The new pile’s handle.

damage: number

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

Health taken from anyone at the point a stone comes down, up to 1000; a quarter of it reaches the edge of damageRadius. 60 to start with; a player has 100.


damageRadius: number

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

How far from where a stone comes down anyone is hurt, in metres, up to 10. 1.5 to start with.


readonly id: number

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

Immutable network entity identifier.

Entity.id


position: Vector3

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

Authoritative world-space position; assignment forces replicated state.

Entity.position


rotation: Vector3 | Quaternion

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

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

Entity.rotation


readonly state: StateBag

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

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


stones: number

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

Stones left to throw; each throw takes one, and a pile with none offers nothing. Players see at most nine in the heap. -1, the default, never runs out; any negative value means the same.


usable: boolean

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

Whether players are offered the game’s own prompt at the pile. On by default.


readonly virtualWorld: number

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

Current virtual-world identifier.

Entity.virtualWorld