StonePile
Defined in: server/api.d.ts:6146
Replicated handle for a pile of hurling stones on a battlement.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new StonePile(
id):StonePile
Defined in: server/api.d.ts:6151
Creates a script wrapper for an existing stone pile with this ID; use StonePile.spawn() to place one.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”StonePile
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”destroy()
Section titled “destroy()”destroy():
void
Defined in: server/api.d.ts:6182
Removes the pile on every client after emitting stonePileDestroy. A stone already thrown still lands.
Returns
Section titled “Returns”void
setVirtualWorld()
Section titled “setVirtualWorld()”setVirtualWorld(
world):void
Defined in: server/api.d.ts:8797
Moves this entity into another virtual world.
Parameters
Section titled “Parameters”number
Virtual-world identifier used to partition replication and visibility.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”setVisibleTo()
Section titled “setVisibleTo()”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.
Parameters
Section titled “Parameters”player
Section titled “player”Entity | null
Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”toString()
Section titled “toString()”toString():
string
Defined in: server/api.d.ts:6177
Formats this pile handle for logging and debugging.
Returns
Section titled “Returns”string
The pile ID and the stones it has left.
Inherited from
Section titled “Inherited from”
staticall(virtualWorld?):StonePile[]
Defined in: server/api.d.ts:6198
Lists the stone piles the server has.
Parameters
Section titled “Parameters”virtualWorld?
Section titled “virtualWorld?”number
Optional virtual world to list; omitted lists every one.
Returns
Section titled “Returns”StonePile[]
One handle per pile, in no particular order.
destroyAll()
Section titled “destroyAll()”
staticdestroyAll(virtualWorld?):number
Defined in: server/api.d.ts:6212
Removes stone piles, emitting stonePileDestroy for each one.
Parameters
Section titled “Parameters”virtualWorld?
Section titled “virtualWorld?”number
Optional virtual world to clear; omitted clears every one.
Returns
Section titled “Returns”number
How many were removed.
getById()
Section titled “getById()”
staticgetById(id):StonePile|null
Defined in: server/api.d.ts:6205
Looks a pile up by its network entity ID.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”StonePile | null
The pile’s handle, or null when no live pile has that ID.
spawn()
Section titled “spawn()”
staticspawn(position,rotation?,virtualWorld?):StonePile
Defined in: server/api.d.ts:6191
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.
Parameters
Section titled “Parameters”position
Section titled “position”Where the thrower stands on the walk, behind the parapet.
rotation?
Section titled “rotation?”Its facing: forward is the way the stones go, over the wall. A Quaternion, or a Vector3 of Euler angles in degrees.
virtualWorld?
Section titled “virtualWorld?”number
Optional virtual world the pile belongs to; omitted puts it in the global one.
Returns
Section titled “Returns”StonePile
The new pile’s handle.
Properties
Section titled “Properties”damage
Section titled “damage”damage:
number
Defined in: server/api.d.ts:6166
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
Section titled “damageRadius”damageRadius:
number
Defined in: server/api.d.ts:6171
How far from where a stone comes down anyone is hurt, in metres, up to 10. 1.5 to start with.
readonlyid:number
Defined in: server/api.d.ts:8765
Immutable network entity identifier.
Inherited from
Section titled “Inherited from”position
Section titled “position”position:
Vector3
Defined in: server/api.d.ts:8775
Authoritative world-space position; assignment forces replicated state.
Inherited from
Section titled “Inherited from”rotation
Section titled “rotation”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.
Inherited from
Section titled “Inherited from”
readonlystate: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.
Inherited from
Section titled “Inherited from”stones
Section titled “stones”stones:
number
Defined in: server/api.d.ts:6156
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
Section titled “usable”usable:
boolean
Defined in: server/api.d.ts:6161
Whether players are offered the game’s own prompt at the pile. On by default.
virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: server/api.d.ts:8770
Current virtual-world identifier.