Class QuestController
Manages quest instances for a character including acceptance, objective tracking, completion, turn-in, failure, and abandonment. Syncs state via broadcasts.
public class QuestController : CharacterBehaviour, IQuestController, ICharacterBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourNetworkBehaviourQuestController
- Implements
- Inherited Members
-
NetworkBehaviour.IsSpawnedNetworkBehaviour.ComponentIndexNetworkBehaviour.NetworkObjectNetworkBehaviour.MAXIMUM_NETWORKBEHAVIOURSNetworkBehaviour.UNSET_NETWORKBEHAVIOUR_IDNetworkBehaviour.ToString()NetworkBehaviour.Reset()NetworkBehaviour.OnValidate()NetworkBehaviour.IsBehaviourReconcilingNetworkBehaviour.ClearReplicateCache()NetworkBehaviour.CreateReconcile()NetworkBehaviour.Reconcile_Reader<T>(PooledReader, ref T)NetworkBehaviour.OnStartServerCalledNetworkBehaviour.OnStartClientCalledNetworkBehaviour.WritePayload(NetworkConnection, Writer)NetworkBehaviour.ReadPayload(NetworkConnection, Reader)NetworkBehaviour.OnStartNetwork()NetworkBehaviour.OnStopNetwork()NetworkBehaviour.OnStartServer()NetworkBehaviour.OnStopServer()NetworkBehaviour.OnOwnershipServer(NetworkConnection)NetworkBehaviour.OnSpawnServer(NetworkConnection)NetworkBehaviour.OnDespawnServer(NetworkConnection)NetworkBehaviour.OnStartClient()NetworkBehaviour.OnStopClient()NetworkBehaviour.OnOwnershipClient(NetworkConnection)NetworkBehaviour.ClearBuffedRpcs()NetworkBehaviour.ExcludeOwnerFromUnbufferedObserversRpcsNetworkBehaviour.IsClientOnlyNetworkBehaviour.IsServerOnlyNetworkBehaviour.IsHostNetworkBehaviour.IsClientNetworkBehaviour.IsServerNetworkBehaviour.IsDeinitializingNetworkBehaviour.NetworkManagerNetworkBehaviour.ServerManagerNetworkBehaviour.ClientManagerNetworkBehaviour.ObserverManagerNetworkBehaviour.TransportManagerNetworkBehaviour.TimeManagerNetworkBehaviour.SceneManagerNetworkBehaviour.PredictionManagerNetworkBehaviour.RollbackManagerNetworkBehaviour.NetworkObserverNetworkBehaviour.IsClientInitializedNetworkBehaviour.IsClientStartedNetworkBehaviour.IsClientOnlyInitializedNetworkBehaviour.IsClientOnlyStartedNetworkBehaviour.IsServerInitializedNetworkBehaviour.IsServerStartedNetworkBehaviour.IsServerOnlyInitializedNetworkBehaviour.IsServerOnlyStartedNetworkBehaviour.IsHostInitializedNetworkBehaviour.IsHostStartedNetworkBehaviour.IsOfflineNetworkBehaviour.IsNetworkedNetworkBehaviour.GetIsNetworked()NetworkBehaviour.IsManagerReconcilingNetworkBehaviour.ObserversNetworkBehaviour.IsOwnerNetworkBehaviour.IsControllerNetworkBehaviour.HasAuthorityNetworkBehaviour.OwnerNetworkBehaviour.OwnerIdNetworkBehaviour.ObjectIdNetworkBehaviour.LocalConnectionNetworkBehaviour.OwnerMatches(NetworkConnection)NetworkBehaviour.Despawn(GameObject, DespawnType?)NetworkBehaviour.Despawn(NetworkObject, DespawnType?)NetworkBehaviour.Despawn(DespawnType?)NetworkBehaviour.Spawn(GameObject, NetworkConnection, Scene)NetworkBehaviour.Spawn(NetworkObject, NetworkConnection, Scene)NetworkBehaviour.RemoveOwnership()NetworkBehaviour.GiveOwnership(NetworkConnection)NetworkBehaviour.GetInstance<T>()NetworkBehaviour.TryRegisterInstance<T>(T)NetworkBehaviour.UnregisterInstance<T>()NetworkBehaviour.CanLog(LoggingType)MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.nameObject.hideFlags
Properties
Quests
Read-only accessor for all active quests keyed by template name.
public Dictionary<string, QuestInstance> Quests { get; }
Property Value
Methods
AbandonQuest(string)
Abandons a quest, removing it from the character's quest log.
public bool AbandonQuest(string questName)
Parameters
questNamestringThe name of the quest to abandon.
Returns
- bool
True if the quest was found and removed.
Acquire(QuestTemplate)
Accepts a new quest for the character. Ignored if already acquired.
public void Acquire(QuestTemplate template)
Parameters
templateQuestTemplateThe quest template to accept.
AdvanceObjective(string, int, long)
Advances a specific objective within a quest by the given amount.
public void AdvanceObjective(string questName, int objectiveIndex, long amount)
Parameters
questNamestringThe name of the quest.
objectiveIndexintThe index of the objective to advance.
amountlongThe amount to increment.
FailQuest(string)
Fails an active quest.
public bool FailQuest(string questName)
Parameters
questNamestringThe name of the quest to fail.
Returns
- bool
True if the quest was successfully failed.
OnStartCharacter()
Registers broadcast handlers on the owning client.
public override void OnStartCharacter()
OnStopCharacter()
Unregisters broadcast handlers on the owning client.
public override void OnStopCharacter()
RequestAbandonQuest(int)
Sends a quest abandon request to the server for the given quest.
public void RequestAbandonQuest(int templateID)
Parameters
templateIDint
RequestAcceptQuest(int, long)
Sends a quest accept request to the server for the given quest at the given interactable.
public void RequestAcceptQuest(int templateID, long interactableID)
Parameters
RequestTurnInQuest(int, long)
Sends a quest turn-in request to the server for the given quest at the given interactable.
public void RequestTurnInQuest(int templateID, long interactableID)
Parameters
ResetState(bool)
Resets quest state on the server or client.
public override void ResetState(bool asServer)
Parameters
asServerboolWhether this reset is on the server.
SetQuest(QuestTemplate, QuestStatus, long[])
Sets quest state from broadcast or database load. Used by client-side sync.
public void SetQuest(QuestTemplate template, QuestStatus status, long[] objectiveValues)
Parameters
templateQuestTemplateThe quest template.
statusQuestStatusThe status to set.
objectiveValueslong[]Per-objective progress values.
TryCompleteQuest(string)
Attempts to complete a quest, transitioning it from Active to Complete. Returns false if objectives are not met or the quest is not active.
public bool TryCompleteQuest(string questName)
Parameters
questNamestringThe name of the quest to complete.
Returns
- bool
True if the quest transitioned to Complete.
TryGetQuest(string, out QuestInstance)
Attempts to retrieve a quest instance by template name.
public bool TryGetQuest(string name, out QuestInstance quest)
Parameters
namestringThe name of the quest to look up.
questQuestInstanceThe found quest instance, or null if not found.
Returns
- bool
True if the quest is found, false otherwise.
TurnInQuest(string)
Turns in a completed quest, granting rewards and transitioning to TurnedIn.
public bool TurnInQuest(string questName)
Parameters
questNamestringThe name of the quest to turn in.
Returns
- bool
True if the quest was successfully turned in.