Quest
Defined in: server/api.d.ts:4989
Replicated journal quest handle.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Quest(
id):Quest
Defined in: server/api.d.ts:4994
Creates a script wrapper for an existing quest with this ID; use Quest.give() to write one.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”Quest
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”objectives()
Section titled “objectives()”objectives():
object[]
Defined in: server/api.d.ts:5068
Reads the quest’s objectives back.
Returns
Section titled “Returns”object[]
One entry per objective, in journal order. position is present only on an objective that has one.
remove()
Section titled “remove()”remove():
void
Defined in: server/api.d.ts:5040
Takes this quest out of every journal it was written into.
Returns
Section titled “Returns”void
setObjective()
Section titled “setObjective()”setObjective(
index,objective,announce?):void
Defined in: server/api.d.ts:5055
Rewrites one line of the quest in place.
Parameters
Section titled “Parameters”number
Which objective to rewrite, counting from zero. An index past the end is ignored.
objective
Section titled “objective”string | { optional?: boolean; position?: Vector3; progress?: "done" | "failed" | "active"; text: string; }
The line, as text or as an object carrying its state.
announce?
Section titled “announce?”boolean
Whether to raise the quest-updated toast; defaults to true.
Returns
Section titled “Returns”void
setObjectives()
Section titled “setObjectives()”setObjectives(
objectives,announce?):void
Defined in: server/api.d.ts:5062
Replaces the quest’s objective list.
Parameters
Section titled “Parameters”objectives
Section titled “objectives”(string | { optional?: boolean; position?: Vector3; progress?: "done" | "failed" | "active"; text: string; })[]
The whole list, at most eight entries; anything past that is dropped.
announce?
Section titled “announce?”boolean
Whether to raise the quest-updated toast; defaults to true.
Returns
Section titled “Returns”void
setProgress()
Section titled “setProgress()”setProgress(
progress,announce?):void
Defined in: server/api.d.ts:5047
Moves the quest on. There is no way back to unstarted: a quest nobody should see any more is removed.
Parameters
Section titled “Parameters”progress
Section titled “progress”"done" | "failed" | "active"
Where the quest now stands.
announce?
Section titled “announce?”boolean
Whether to raise the game’s quest-updated toast; defaults to true. Pass false for a correction the player should not be told about.
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:5035
Formats this quest handle for logging and debugging.
Returns
Section titled “Returns”string
The quest ID, its key, its state and how many objectives it carries.
Inherited from
Section titled “Inherited from”track()
Section titled “track()”track(
player?):number
Defined in: server/api.d.ts:5075
Makes the game follow this quest, exactly as the journal’s track button does: it is listed in the HUD tracker, and every active objective that has a position is drawn as the game’s own quest marker on the map and the compass. It is an instruction, not a lock – the player can untrack it from the journal – and the outcome arrives as questTrackingChanged like any other change. A quest given a moment ago can be tracked at once; the client waits for it to arrive.
Parameters
Section titled “Parameters”player?
Section titled “player?”number
Network id of the player who should follow the quest. Omitted, everyone who has the quest follows it: its one owner, or every player in its world.
Returns
Section titled “Returns”number
How many clients were told. Zero when the player does not have this quest.
untrack()
Section titled “untrack()”untrack(
player?):number
Defined in: server/api.d.ts:5082
Makes the game stop following this quest, which takes its markers off the map and the compass. The outcome arrives as questTrackingChanged.
Parameters
Section titled “Parameters”player?
Section titled “player?”number
Network id of the player who should stop following the quest. Omitted, everyone who has the quest stops.
Returns
Section titled “Returns”number
How many clients were told.
staticall(virtualWorld?):Quest[]
Defined in: server/api.d.ts:5099
Lists every replicated quest the server currently has.
Parameters
Section titled “Parameters”virtualWorld?
Section titled “virtualWorld?”number
Optional virtual world to list; omitted lists every one of them.
Returns
Section titled “Returns”Quest[]
One handle per live quest, in no particular order.
find()
Section titled “find()”
staticfind(key,virtualWorld?,player?):Quest|null
Defined in: server/api.d.ts:5108
Looks a quest up by its key.
Parameters
Section titled “Parameters”string
The key the quest was given under.
virtualWorld?
Section titled “virtualWorld?”number
Optional virtual world to search; omitted searches every one of them.
player?
Section titled “player?”number
Network id of the player whose copy to find. Keys are unique per recipient, so this is how one player’s errand is told from another’s.
Returns
Section titled “Returns”Quest | null
The quest’s handle, or null when no live quest has that key.
getById()
Section titled “getById()”
staticgetById(id):Quest|null
Defined in: server/api.d.ts:5115
Looks a replicated quest up by its network entity ID.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”Quest | null
The quest’s handle, or null when no live quest has that ID.
give()
Section titled “give()”
staticgive(key,title,options?,virtualWorld?):Quest
Defined in: server/api.d.ts:5092
Writes a quest into the game’s own journal. It is a replicated entity, so a player who joins late, reloads or walks away still finds it in their log – which is what a quest needs and what a one-shot notification cannot do. What the player sees is the game’s quest UI: its journal row, its diary page, its objective tracker and its quest-updated toast, all reading a quest node the client builds with the game’s own constructor.
Parameters
Section titled “Parameters”string
What the quest is filed under: up to 64 letters, digits, underscores or dashes, unique within its virtual world.
string
The line the journal row shows.
options?
Section titled “options?”description is the diary page, type the journal section, objectives the lines under it – each with an optional world position the game marks on the map and compass while the quest is followed – player the network id of the one player it belongs to, announce whether to raise the toast, and track whether its recipients start following it.
announce?
Section titled “announce?”boolean
description?
Section titled “description?”string
objectives?
Section titled “objectives?”(string | { optional?: boolean; position?: Vector3; progress?: "done" | "failed" | "active"; text: string; })[]
player?
Section titled “player?”number
track?
Section titled “track?”boolean
"main" | "side" | "activity" | "event" | "micro" | "racing"
virtualWorld?
Section titled “virtualWorld?”number
Optional virtual world the quest belongs to; omitted puts it in the global one.
Returns
Section titled “Returns”Quest
The newly written quest handle.
removeAll()
Section titled “removeAll()”
staticremoveAll(virtualWorld?):number
Defined in: server/api.d.ts:5122
Takes quests out of every journal they were written into.
Parameters
Section titled “Parameters”virtualWorld?
Section titled “virtualWorld?”number
Optional virtual world to clear; omitted clears every one of them.
Returns
Section titled “Returns”number
How many quests were removed.
Properties
Section titled “Properties”description
Section titled “description”description:
string
Defined in: server/api.d.ts:5009
The body of the journal’s diary page for this quest. Assignment is silent.
readonlyid:number
Defined in: server/api.d.ts:8765
Immutable network entity identifier.
Inherited from
Section titled “Inherited from”
readonlykey:string
Defined in: server/api.d.ts:4999
The key the quest is filed under, and the name the game knows the quest node by. Read-only: it is the quest’s identity.
objectiveCount
Section titled “objectiveCount”
readonlyobjectiveCount:number
Defined in: server/api.d.ts:5029
How many objectives the quest carries, up to eight.
player
Section titled “player”
readonlyplayer:number
Defined in: server/api.d.ts:5024
Network id of the one player this quest was written for, or 0 when it went to everyone in the world. Read-only: who a quest belongs to is decided when it is given.
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”progress
Section titled “progress”progress:
string
Defined in: server/api.d.ts:5019
active, done or failed. Assignment announces the change; setProgress can do it quietly.
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”title:
string
Defined in: server/api.d.ts:5004
The line the journal row and the quest toast show. Assignment is silent; it does not raise a toast.
readonlytype:string
Defined in: server/api.d.ts:5014
Which section of the journal the quest files under. Read-only: it is decided when the quest is given.
virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: server/api.d.ts:8770
Current virtual-world identifier.