Quest object. More...
Public Member Functions | |
string | GetEditorName () |
void | Initialize () |
Initializes a quest to empty starting values. | |
Quest | Clone () |
Returns a new instance of the quest, including new instances of all subassets such as QuestAction, QuestCondition, and QuestContent subassets. | |
void | SetRuntimeReferences () |
Sets sub-objects' runtime references to this quest. | |
void | AssignQuestGiver (QuestParticipantTextInfo questGiverTextInfo) |
Assigns a quest giver to the quest. | |
void | AssignQuester (QuestParticipantTextInfo questerTextInfo) |
Assigns a quester (e.g., player) to the quest. | |
void | RuntimeStartup () |
Invoke to tell the quest to perform its runtime startup actions. | |
void | SetStartChecking (bool enable) |
Begins checking autostart and offer conditions. | |
void | ResetStartConditions () |
void | BecomeOfferable () |
void | BecomeUnofferable () |
bool | RecheckOfferConditions () |
void | StartCooldown () |
Starts the cooldown period for this quest. | |
void | UpdateCooldown () |
Checks the current game time and updates the cooldown period. | |
QuestState | GetState () |
Gets the quest state. | |
void | SetState (QuestState newState, bool informListeners=true) |
Sets the quest state. | |
void | SetStateRaw (QuestState state) |
Sets the internal state value without performing any state change processing. | |
QuestStateInfo | GetStateInfo (QuestState state) |
Returns the state info associated with a quest state. | |
void | ExecuteStateActions (QuestState state) |
QuestCounter | GetCounter (int index) |
Gets a counter defined in this quest. | |
QuestCounter | GetCounter (string counterName) |
Gets a counter defined in this quest. | |
QuestCounter | GetCounter (StringField counterName) |
Gets a counter defined in this quest. | |
int | GetCounterIndex (string counterName) |
int | GetCounterIndex (StringField counterName) |
QuestNode | GetNode (string questNodeID) |
Looks up a node by its ID. | |
QuestNode | GetNode (StringField questNodeID) |
Looks up a node by its ID. | |
bool | IsSpeakerQuestGiver (QuestParticipantTextInfo speaker) |
bool | HasContent (QuestContentCategory category, QuestParticipantTextInfo speaker=null) |
Checks if there is any UI content for a specific category. | |
List< QuestContent > | GetContentList (QuestContentCategory category, QuestParticipantTextInfo speaker=null) |
Gets the UI content for a specific category. | |
void | AssignContentID (QuestContent content) |
QuestContent | GetContentByID (int contentID) |
void | SetQuestIndicatorState (string entityID, QuestIndicatorState questIndicatorState) |
void | SetQuestIndicatorState (StringField entityID, QuestIndicatorState questIndicatorState) |
QuestIndicatorState | GetQuestIndicatorState (string entityID) |
QuestIndicatorState | GetQuestIndicatorState (StringField entityID) |
void | ClearQuestIndicatorStates () |
void | CompressGeneratedContent () |
If quest is procedurally generated and completed, destroys all content and conditions not needed to show in UIs. | |
Static Public Member Functions | |
static void | DestroyInstance (Quest quest) |
Protected Member Functions | |
QuestContent | FindContentByID (int contentID) |
QuestContent | FindContentByID (int contentID, List< QuestContent > contentList) |
QuestContent | FindContentByIDInStateInfo (int contentID, QuestStateInfo stateInfo) |
QuestContent | FindContentByIDInMainQuest (int contentID) |
QuestContent | FindContentByIDInNodes (int contentID) |
Properties | |
bool | isInstance [get, set] |
Quest is a runtime instance, not an asset file. | |
bool | isAsset [get, set] |
Quest is an asset, not a runtime instance. | |
Quest | originalAsset [get, set] |
If a runtime instance, this is the original asset from which the instance was created. | |
int | fileVersion [get, set] |
bool | isProcedurallyGenerated [get] |
Quest was procedurally generated. | |
TextTable | textTable [get] |
Default text table used when adding new content. | |
StringField | id [get, set] |
Unique identifier for this quest. | |
StringField | title [get, set] |
Title shown in UIs. | |
Sprite | icon [get, set] |
Optional quest icon shown in UIs. | |
StringField | group [get, set] |
Optional group under which to categorize this quest. | |
List< StringField > | labels [get, set] |
Optional labels to assign to this quest for sorting and filtering. | |
StringField | questGiverID [get, set] |
ID of the quest giver that offered this quest. | |
string | questerID [get] |
ID of the quester assigned to this quest. | |
string | greeterID [get, set] |
ID of the quester who is greeting the quest giver. | |
string | greeter [get, set] |
Display name of the quester who is greeting the quest giver. | |
bool | isTrackable [get, set] |
Specifies whether the player is allowed to toggle tracking on and off. | |
bool | showInTrackHUD [get, set] |
Specifies whether to show in the quest tracking HUD. | |
bool | isAbandonable [get, set] |
Specifies whether the player is allowed to abandon the quest. | |
bool | rememberIfAbandoned [get, set] |
Specifies whether to keep in quest journal if abandoned. | |
bool | deleteWhenComplete [get, set] |
Delete when completed even if Quest Journal specifies Remember Completed Quests. | |
QuestConditionSet | autostartConditionSet [get, set] |
If specified, conditions that autostart the quest when true. | |
bool | hasAutostartConditions [get] |
If true, the quest has autostart conditions. | |
QuestConditionSet | offerConditionSet [get, set] |
Conditions that must be true before the quest can be offered. | |
bool | hasOfferConditions [get] |
If true, the quest has offer conditions. | |
bool | canOffer [get] |
If true, the giver can offer the quest. | |
List< QuestContent > | offerConditionsUnmetContentList [get, set] |
Dialogue text to show when the offer conditions are unmet. | |
List< QuestContent > | offerContentList [get, set] |
Dialogue text to show when offering the quest. | |
bool | infinitelyRepeatable [get, set] |
No limit to number of times quest can be accepted. | |
int | maxTimes [get, set] |
Max number of times this quest can be accepted. | |
int | timesAccepted [get, set] |
The number of times the quest has been accepted. | |
float | cooldownSeconds [get, set] |
Minimum duration in seconds that must pass after quest acceptance to offer it again. | |
float | cooldownSecondsRemaining [get, set] |
Seconds remaining until cooldown period is over. | |
bool | noRepeatIfSuccessful [get, set] |
Do not offer again if quester already has successful completion in its journal. | |
bool | saveAllIfWaitingToStart [get, set] |
Save counters, node states, & indicator states if waiting to start. | |
List< QuestStateInfo > | stateInfoList [get, set] |
Info for each state, indexed by the int value of the QuestState enum. | |
List< QuestCounter > | counterList [get, set] |
Counters defined for this quest. | |
List< QuestNode > | nodeList [get, set] |
All nodes in this quest. | |
QuestNode | startNode [get] |
The quest's start node. | |
string | goalEntityTypeName [get, set] |
If this quest was procedurally generated, the goal EntityType's name. | |
int | nextContentID [get, set] |
Used by QuestContent to assign a unique ID number usable by LinkQuestContent. | |
TagDictionary | tagDictionary [get, set] |
Dictionary of tags defined in this quest and their values. | |
Dictionary< string, QuestIndicatorState > | indicatorStates [get, set] |
Current quest state indicator states by entity ID. | |
HashSet< string > | speakers [get, set] |
List of all quest node speakers. | |
QuestParticipantTextInfo | currentSpeaker [get] |
The current speaker's info, if the speaker is different from the quest giver. | |
Events | |
QuestParameterDelegate | questOfferable = delegate { } |
Raised when the quest has become offerable. | |
QuestParameterDelegate | stateChanged = delegate { } |
Raised when the quest's state has changed. | |
Quest object.
May be saved as an asset file in the project or may be a runtime instance in the scene.
|
inline |
|
inline |
Assigns a quester (e.g., player) to the quest.
questerTextInfo | Idenntifying information about the quester. |
|
inline |
Assigns a quest giver to the quest.
questGiverTextInfo | Identifying information about the quest giver. |
|
inline |
|
inline |
|
inline |
|
inline |
Returns a new instance of the quest, including new instances of all subassets such as QuestAction, QuestCondition, and QuestContent subassets.
|
inline |
If quest is procedurally generated and completed, destroys all content and conditions not needed to show in UIs.
|
inlinestatic |
|
inline |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inline |
Gets the UI content for a specific category.
category | The content category (Dialogue, Journal, etc.). |
speaker | The speaker whose content to get, or blank for the quest giver. |
|
inline |
Gets a counter defined in this quest.
index | The index of the counter defined in the quest. |
|
inline |
Gets a counter defined in this quest.
counterName | The name of the counter defined in the quest. |
|
inline |
Gets a counter defined in this quest.
counterName | The name of the counter defined in the quest. |
|
inline |
|
inline |
|
inline |
|
inline |
Looks up a node by its ID.
|
inline |
Looks up a node by its ID.
|
inline |
|
inline |
|
inline |
Gets the quest state.
|
inline |
Returns the state info associated with a quest state.
|
inline |
Checks if there is any UI content for a specific category.
category | The content category (Dialogue, Journal, etc.). |
speaker | The speaker whose content to check, or blank for the quest giver. |
|
inline |
Initializes a quest to empty starting values.
Invoked when object is created by ScriptableObjectUtility.CreateInstance.
|
inline |
|
inline |
|
inline |
|
inline |
Invoke to tell the quest to perform its runtime startup actions.
|
inline |
|
inline |
|
inline |
Sets sub-objects' runtime references to this quest.
|
inline |
Begins checking autostart and offer conditions.
|
inline |
Sets the quest state.
This may also affect the states of the quest's nodes.
newState | The new quest state. |
|
inline |
Sets the internal state value without performing any state change processing.
|
inline |
Starts the cooldown period for this quest.
|
inline |
Checks the current game time and updates the cooldown period.
|
getset |
If specified, conditions that autostart the quest when true.
|
get |
If true, the giver can offer the quest.
|
getset |
Minimum duration in seconds that must pass after quest acceptance to offer it again.
|
getset |
Seconds remaining until cooldown period is over.
|
getset |
Counters defined for this quest.
|
get |
The current speaker's info, if the speaker is different from the quest giver.
If the quest giver is speaking, this property will be null.
|
getset |
Delete when completed even if Quest Journal specifies Remember Completed Quests.
|
getset |
|
getset |
If this quest was procedurally generated, the goal EntityType's name.
|
getset |
Display name of the quester who is greeting the quest giver.
For quests that can be accepted by quester A and turned in by quester B, this is the name of quester B.
|
getset |
ID of the quester who is greeting the quest giver.
For quests that can be accepted by quester A and turned in by quester B, this is the ID of quester B.
|
getset |
Optional group under which to categorize this quest.
|
get |
If true, the quest has autostart conditions.
The quest will start automatically when the conditions are met.
|
get |
If true, the quest has offer conditions.
The giver should not offer the quest until the conditions are met.
|
getset |
Optional quest icon shown in UIs.
|
getset |
Unique identifier for this quest.
|
getset |
Current quest state indicator states by entity ID.
|
getset |
No limit to number of times quest can be accepted.
|
getset |
Specifies whether the player is allowed to abandon the quest.
|
getset |
Quest is an asset, not a runtime instance.
|
getset |
Quest is a runtime instance, not an asset file.
|
get |
Quest was procedurally generated.
|
getset |
Specifies whether the player is allowed to toggle tracking on and off.
|
getset |
Optional labels to assign to this quest for sorting and filtering.
|
getset |
Max number of times this quest can be accepted.
|
getset |
Used by QuestContent to assign a unique ID number usable by LinkQuestContent.
|
getset |
All nodes in this quest.
|
getset |
Do not offer again if quester already has successful completion in its journal.
|
getset |
Conditions that must be true before the quest can be offered.
|
getset |
Dialogue text to show when the offer conditions are unmet.
|
getset |
Dialogue text to show when offering the quest.
|
getset |
If a runtime instance, this is the original asset from which the instance was created.
|
get |
ID of the quester assigned to this quest.
If this is an asset or it hasn't been accepted yet, questerID will be empty;
|
getset |
ID of the quest giver that offered this quest.
Typically set on the quester's runtime instance of the quest when the quester accepts a quest. If this is an asset or it hasn't been accepted yet, questGiverID will be empty.
|
getset |
Specifies whether to keep in quest journal if abandoned.
|
getset |
Save counters, node states, & indicator states if waiting to start.
Normally omitted to reduce save file size/time.
|
getset |
Specifies whether to show in the quest tracking HUD.
|
getset |
List of all quest node speakers.
|
get |
The quest's start node.
|
getset |
Info for each state, indexed by the int value of the QuestState enum.
|
getset |
Dictionary of tags defined in this quest and their values.
|
get |
Default text table used when adding new content.
|
getset |
The number of times the quest has been accepted.
|
getset |
Title shown in UIs.
QuestParameterDelegate PixelCrushers.QuestMachine.Quest.questOfferable = delegate { } |
Raised when the quest has become offerable.
QuestParameterDelegate PixelCrushers.QuestMachine.Quest.stateChanged = delegate { } |
Raised when the quest's state has changed.