Skip to content

Get Sansar

Script API

ObjectiveDefinition

Where: Client
More page actions

For the complete documentation index, see llms.txt. This page is also available as Markdown.

Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 34.7.0

The ObjectiveDefinition stores the data that is used to create quest objective instances for users.

public class ObjectiveDefinition : Sansar.Script.InstanceInterface

Members at a glance

KindMembers
PropertiesDescription · InitialState · Ready · RequiredCount · Title
MethodsGetObjective · ToString · Update

Properties

Description

Added in 34.7.0
public string Description { get; }

The objective description.

Remarks

Returns null if Ready is false because the objective definition is not ready.

InitialState

Added in 36.0.1
public ObjectiveState InitialState { get; }

The initial state that this objective will have when a user starts the quest

Remarks

Returns None if Ready is false, because the objective definition is not ready.

Ready

Added in 34.7.0
public bool Ready { get; }

If the QuestDefinition data is ready.

Remarks

Returns false until the data has been fetched from the quest service. Once it returns true it will always return true.

RequiredCount

Added in 36.3.0
public int RequiredCount { get; }

The required count to complete the objective.

Remarks

Returns -1 if Ready is false because the objective definition is not ready.

Title

Added in 34.7.0
public string Title { get; }

The objective title.

Remarks

Returns null if Ready is false because the objective definition is not ready.

Methods

GetObjective

Added in 34.7.0
public void GetObjective(Sansar.Script.SessionId agent)

Get the state of this objective for a particular user.

ParameterTypeDescription
agentSansar.Script.SessionIdThe SessionId of the user.
Added in 34.7.0
public void GetObjective(AgentPrivate agent)

Get the state of this objective for a particular user.

ParameterTypeDescription
agentAgentPrivateObtain the objective state for this user.
Added in 34.7.0
public void GetObjective(     Sansar.Script.SessionId agent,     Action<ObjectiveDefinition.GetObjectiveData> handler )

Get the state of this objective for a particular user.

ParameterTypeDescription
agentSansar.Script.SessionIdThe SessionId of the user.
handlerAction<ObjectiveDefinition.GetObjectiveData>Handler to be called when the event completes.
Added in 34.7.0
public void GetObjective(     AgentPrivate agent,     Action<ObjectiveDefinition.GetObjectiveData> handler )

Get the state of this objective for a particular user.

ParameterTypeDescription
agentAgentPrivateObtain the objective state for this user.
handlerAction<ObjectiveDefinition.GetObjectiveData>Handler to be called when the event completes.

ToString

Added in 34.7.0
public override string ToString()

A string representation of this object.

Returns: string — A string representation of this object.

Remarks

The format of this string may change between releases.

Update

Added in 34.7.0
public void Update()

Update the ObjectiveDefinition data.

Remarks

Use in a WaitFor to wait for the data for the QuestDefinition to be ready. Once data is retrieved and Ready is true it will never again be false.

Added in 34.7.0
public void Update(     Action<Sansar.Script.OperationCompleteEvent> handler )

Update the ObjectiveDefinition data.

ParameterTypeDescription
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

Use in a WaitFor to wait for the data for the QuestDefinition to be ready. Once data is retrieved and Ready is true it will never again be false.

Used in examples

Generated from the Sansar 47.10.0 client ScriptApi snapshot.