Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

Routine

The steps of one routine, one method each, in the order it runs them.

new Routine(): Routine

Routine

do(name, data?): Routine

Emits RoutineActionRequestedEvent on the NPC with name and data, and goes on: a step a game’s own system answers, such as ringing a bell, opening a gate or handing over a key.

Parameter Type Default value
name string undefined
data string ""

Routine


face(point?): Routine

Turns on the spot toward point, by its x and z in metres, its height left out; with none, toward the player’s character nearest to it: the one who came close or pressed its prompt. The routine goes on at once while it turns, and a point where it stands keeps its facing.

Parameter Type
point? RoutePoint

Routine


on(event, name): Routine

Starts the routine name on event, only while in this routine.

Parameter Type
event RoutineEvent
name string

Routine


play(clip, options?): Routine

Plays clip for seconds, two by default: one of its poses, such as idle, or, on an NPC that wears a model, a clip of the model’s file by the file’s own name, such as "CharacterArmature|Interact".

Parameter Type
clip string
options RoutinePlayOptions

Routine


resume(): Routine

Goes back to the routine an event interrupted, at the step it was on, once the last step is done: how a routine an event starts ends when it names no other way out.

Routine


say(line): Routine

Shows line over its head for a few seconds, and goes on.

Parameter Type
line string

Routine


then(name): Routine

Goes to the routine name once the last step is done.

Parameter Type
name string

Routine


turn(degrees): Routine

Turns on the spot by degrees, left for a positive number, the short way round, at its movement’s standTurnRate.

Parameter Type
degrees number

Routine


wait(seconds): Routine

Stands for seconds, or for a roll { between: [min, max] }.

Parameter Type
seconds WaitSeconds

Routine


walk<Point>(route, walkOptions?): Routine

Walks route once, pausing where pause says, and repeat more times; the step ends with the last pass.

Type Parameter Default type
Point extends string never
Parameter Type
route Route<Point>
walkOptions WalkOptions<NoInfer<Point>>

Routine


walkToTarget(walkToTargetOptions?): Routine

Walks to the target setWalkTarget gives the NPC, an entity or a point, and the step ends there; with none, it stands until one is set. It sets off again as the target moves, and clears the target as it ends.

Parameter Type
walkToTargetOptions WalkToTargetOptions

Routine