The ObjectiveDefinition stores the data that is used to create quest objective instances for users.
public class ObjectiveDefinition : Sansar.Script.InstanceInterfaceMembers at a glance
| Kind | Members |
|---|---|
| Properties | Description · InitialState · Ready · RequiredCount · Title |
| Methods | GetObjective · ToString · Update |
Properties
Description
public string Description { get; }The objective description.
Remarks
Returns null if Ready is false because the objective definition is not ready.
InitialState
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
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
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
public string Title { get; }The objective title.
Remarks
Returns null if Ready is false because the objective definition is not ready.
Methods
GetObjective
public void GetObjective(Sansar.Script.SessionId agent)Get the state of this objective for a particular user.
| Parameter | Type | Description |
|---|---|---|
agent | Sansar.Script.SessionId | The SessionId of the user. |
public void GetObjective(AgentPrivate agent)Get the state of this objective for a particular user.
| Parameter | Type | Description |
|---|---|---|
agent | AgentPrivate | Obtain the objective state for this user. |
public void GetObjective(
Sansar.Script.SessionId agent,
Action<ObjectiveDefinition.GetObjectiveData> handler
)Get the state of this objective for a particular user.
| Parameter | Type | Description |
|---|---|---|
agent | Sansar.Script.SessionId | The SessionId of the user. |
handler | Action<ObjectiveDefinition.GetObjectiveData> | Handler to be called when the event completes. |
public void GetObjective(
AgentPrivate agent,
Action<ObjectiveDefinition.GetObjectiveData> handler
)Get the state of this objective for a particular user.
| Parameter | Type | Description |
|---|---|---|
agent | AgentPrivate | Obtain the objective state for this user. |
handler | Action<ObjectiveDefinition.GetObjectiveData> | Handler to be called when the event completes. |
ToString
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
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.
public void Update(
Action<Sansar.Script.OperationCompleteEvent> handler
)Update the ObjectiveDefinition data.
| Parameter | Type | Description |
|---|---|---|
handler | Action<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
- ScriptLibrary/Quest/QuestObject.cs
- ScriptLibrary/Quest/QuestObjectBase.cs
- ScriptLibrary/Quest/QuestObjectInteraction.cs
- ScriptLibrary/Quest/QuestObjectTrigger.cs
- ScriptLibrary/Quest/QuestVisibility.cs
Generated from the Sansar 47.10.0 client ScriptApi snapshot.