Routine
The steps of one routine, one method each, in the order it runs them.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Routine():
Routine
Returns
Section titled “Returns”Routine
Methods
Section titled “Methods”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.
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
name |
string |
undefined |
data |
string |
"" |
Returns
Section titled “Returns”Routine
face()
Section titled “face()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
point? |
RoutePoint |
Returns
Section titled “Returns”Routine
on(
event,name):Routine
Starts the routine name on event, only while in this routine.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event |
RoutineEvent |
name |
string |
Returns
Section titled “Returns”Routine
play()
Section titled “play()”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".
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
clip |
string |
options |
RoutinePlayOptions |
Returns
Section titled “Returns”Routine
resume()
Section titled “resume()”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.
Returns
Section titled “Returns”Routine
say(
line):Routine
Shows line over its head for a few seconds, and goes on.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
line |
string |
Returns
Section titled “Returns”Routine
then()
Section titled “then()”then(
name):Routine
Goes to the routine name once the last step is done.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
Returns
Section titled “Returns”Routine
turn()
Section titled “turn()”turn(
degrees):Routine
Turns on the spot by degrees, left for a positive number, the
short way round, at its movement’s standTurnRate.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
degrees |
number |
Returns
Section titled “Returns”Routine
wait()
Section titled “wait()”wait(
seconds):Routine
Stands for seconds, or for a roll { between: [min, max] }.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
seconds |
WaitSeconds |
Returns
Section titled “Returns”Routine
walk()
Section titled “walk()”walk<
Point>(route,walkOptions?):Routine
Walks route once, pausing where pause says, and repeat more
times; the step ends with the last pass.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Point extends string |
never |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
route |
Route<Point> |
walkOptions |
WalkOptions<NoInfer<Point>> |
Returns
Section titled “Returns”Routine
walkToTarget()
Section titled “walkToTarget()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
walkToTargetOptions |
WalkToTargetOptions |
Returns
Section titled “Returns”Routine