PixelCrushers.DialogueSystem.QuestLog Class Reference

A static class that manages a quest log. More...

Classes

class  QuestWatchItem
 The quest watch item class is used internally by the QuestLog class to manage Lua observers on quest states. More...
 

Public Member Functions

delegate void QuestChangedDelegate (string questName, QuestState newState)
 Quest changed delegate.
 

Static Public Member Functions

static void RegisterQuestLogFunctions ()
 
static void AddQuest (string questName, string description, string successDescription, string failureDescription, QuestState state)
 Adds a quest to the Lua Item[] table.
 
static void AddQuest (string questName, string description, QuestState state)
 Adds a quest to the Lua Item[] table.
 
static void AddQuest (string questName, string description)
 Adds a quest to the Lua Item[] table, and sets the state to Unassigned.
 
static void DeleteQuest (string questName)
 Deletes a quest from the Lua Item[] table.
 
static QuestState GetQuestState (string questName)
 Gets the quest state.
 
static string CurrentQuestState (string questName)
 Gets the quest state.
 
static string DefaultCurrentQuestState (string questName)
 Default built-in version of CurrentQuestState.
 
static void SetQuestState (string questName, QuestState state)
 Sets the quest state.
 
static void SetQuestState (string questName, string state)
 Sets the quest state, using the override delegate if assigned; otherwise using the default method DefaultSetQuestState.
 
static void DefaultSetQuestState (string questName, string state)
 Default built-in method to set quest state.
 
static void InformQuestStateChange (string questName)
 
static void InformQuestEntryStateChange (string questName, int entryNumber)
 
static bool IsQuestUnassigned (string questName)
 Reports whether a quest is unassigned.
 
static bool IsQuestActive (string questName)
 Reports whether a quest is active.
 
static bool IsQuestSuccessful (string questName)
 Reports whether a quest was successfully completed.
 
static bool IsQuestFailed (string questName)
 Reports whether a quest ended in failure.
 
static bool IsQuestAbandoned (string questName)
 Reports whether a quest was abandoned (i.e., in the Abandoned state).
 
static bool IsQuestDone (string questName)
 Reports whether a quest is done, either successful or failed.
 
static bool IsQuestInStateMask (string questName, QuestState stateMask)
 Reports whether a quest's current state is one of the states marked in a state bit mask.
 
static bool IsQuestEntryInStateMask (string questName, int entryNumber, QuestState stateMask)
 Reports whether a quest entry's current state is one of the states marked in a state bit mask.
 
static void StartQuest (string questName)
 Starts a quest by setting its state to active.
 
static void CompleteQuest (string questName)
 Marks a quest successful.
 
static void FailQuest (string questName)
 Marks a quest as failed.
 
static void AbandonQuest (string questName)
 Marks a quest as abandoned (i.e., in the Abandoned state).
 
static QuestState DefaultStringToState (string s)
 Converts a string representation into a state enum value.
 
static string DefaultStateToString (QuestState state)
 
static string GetQuestTitle (string questName)
 Gets the localized quest display name.
 
static string GetQuestDescription (string questName)
 Gets a quest description, based on the current state of the quest (i.e., SuccessDescription, FailureDescription, or just Description).
 
static string GetQuestDescription (string questName, QuestState state)
 Gets the localized quest description for a specific state.
 
static void SetQuestDescription (string questName, QuestState state, string description)
 Sets the quest description for a specified state.
 
static string GetQuestAbandonSequence (string questName)
 Gets the quest abandon sequence.
 
static void SetQuestAbandonSequence (string questName, string sequence)
 Sets the quest abandon sequence.
 
static int GetQuestEntryCount (string questName)
 Gets the quest entry count.
 
static void AddQuestEntry (string questName, string description)
 Adds a quest entry to a quest.
 
static string GetQuestEntry (string questName, int entryNumber)
 Gets the localized quest entry description.
 
static void SetQuestEntry (string questName, int entryNumber, string description)
 Sets the localized quest entry description.
 
static QuestState GetQuestEntryState (string questName, int entryNumber)
 Gets the state of the quest entry.
 
static string CurrentQuestEntryState (string questName, double entryNumber)
 Gets the state of the quest entry.
 
static string DefaultCurrentQuestEntryState (string questName, int entryNumber)
 Default built-in implementation of CurrentQuestEntryState.
 
static void SetQuestEntryState (string questName, int entryNumber, QuestState state)
 Sets the state of the quest entry.
 
static void SetQuestEntryState (string questName, double entryNumber, string state)
 Sets the state of a quest entry.
 
static void DefaultSetQuestEntryState (string questName, int entryNumber, string state)
 Default built-in method to set quest entry state.
 
static string GetEntryFieldName (int entryNumber)
 
static string GetEntryStateFieldName (int entryNumber)
 
static bool IsQuestTrackingAvailable (string questName)
 Determines if quest tracking is available (that is, if the quest has a "Trackable" field).
 
static void SetQuestTrackingAvailable (string questName, bool value)
 Specifies whether quest tracking is available (that is, if the quest has a "Trackable" field).
 
static bool IsQuestTrackingEnabled (string questName)
 Determines if tracking is enabled for a quest.
 
static void SetQuestTracking (string questName, bool value)
 Sets quest tracking on or off (by setting the Track field).
 
static bool IsQuestAbandonable (string questName)
 Determines if a quest is abandonable (that is, is has a field named "Abandonable" that's true.)
 
static bool IsQuestVisible (string questName)
 Returns true if quest has a field named "Visible" that is currently true or doesn't have the field.
 
static void SetQuestVisibility (string questName)
 Sets a quest's Visible field true or false.
 
static bool WasQuestViewed (string questName)
 Returns true if quest has a field named "Viewed" that is currently true.
 
static void MarkQuestViewed (string questName)
 Marks a quest as viewed (i.e., in the quest log window).
 
static string GetQuestGroup (string questName)
 Gets the group that a quest belongs to.
 
static string GetQuestGroupDisplayName (string questName)
 
static string[] GetAllGroups ()
 Gets all quest group names.
 
static string[] GetAllGroups (QuestState flags)
 Gets all quest group names.
 
static string[] GetAllGroups (QuestState flags, bool sortByGroupName)
 Gets all quest group names.
 
static string[] GetAllQuests ()
 Gets an array of all active quests.
 
static string[] GetAllQuests (QuestState flags)
 Gets an array of all quests matching the specified state bitmask.
 
static string[] GetAllQuests (QuestState flags, bool sortByName)
 Gets an array of all quests matching the specified state bitmask.
 
static string[] GetAllQuests (QuestState flags, bool sortByName, string group)
 Gets an array of all quests matching the specified state bitmask and in the specified group.
 
static QuestGroupRecord[] GetAllGroupsAndQuests (QuestState flags, bool sort=true)
 Gets all quests (including their group names) in a specified state.
 
static void AddQuestStateObserver (string questName, LuaWatchFrequency frequency, QuestChangedDelegate questChangedHandler)
 Adds a quest state observer.
 
static void AddQuestStateObserver (string questName, int entryNumber, LuaWatchFrequency frequency, QuestChangedDelegate questChangedHandler)
 Adds a quest state observer.
 
static void RemoveQuestStateObserver (string questName, LuaWatchFrequency frequency, QuestChangedDelegate questChangedHandler)
 Removes a quest state observer.
 
static void RemoveQuestStateObserver (string questName, int entryNumber, LuaWatchFrequency frequency, QuestChangedDelegate questChangedHandler)
 Removes a quest state observer.
 
static void RemoveAllQuestStateObservers ()
 Removes all quest state observers.
 
static void UpdateQuestIndicators (string questName)
 Updates all quest state listeners who are listening for questName.
 

Static Public Attributes

const string UnassignedStateString = "unassigned"
 Constant state string for unassigned quests.
 
const string ActiveStateString = "active"
 Constant state string for active quests.
 
const string SuccessStateString = "success"
 Constant state string for successfully-completed quests.
 
const string FailureStateString = "failure"
 Constant state string for quests ending in failure.
 
const string AbandonedStateString = "abandoned"
 Constant state string for quests that were abandoned.
 
const string GrantableStateString = "grantable"
 Constant state string for quests that are grantable.
 
const string ReturnToNPCStateString = "returnToNPC"
 Constant state string for quests that are waiting to return to NPC.
 
const string DoneStateString = "done"
 Constant state string for quests that are done, if you want to track done instead of success/failure.
 
static StringToQuestStateDelegate StringToState = DefaultStringToState
 You can reassign this delegate method to override the default conversion of strings to QuestStates.
 
static QuestStateToStringDelegate StateToString = DefaultStateToString
 
static CurrentQuestStateDelegate CurrentQuestStateOverride = null
 You can assign a method to override the default CurrentQuestState.
 
static SetQuestStateDelegate SetQuestStateOverride = null
 You can assign a method to override the default SetQuestState.
 
static CurrentQuestEntryStateDelegate CurrentQuestEntryStateOverride = null
 You can assign a method to override the default CurrentQuestEntryState.
 
static SetQuestEntryStateDelegate SetQuestEntryStateOverride = null
 You can assign a method to override the default SetQuestEntryState.
 
static bool trackOneQuestAtATime = false
 Set true to allow only one quest to be tracked at a time.
 

Detailed Description

A static class that manages a quest log.

It uses the Lua "Item[]" table, where each item in the table whose 'Is Item' field is false represents a quest. This makes it easy to manage quests in Chat Mapper by adding, removing, and modifying items in the built-in Item[] table. The name of the item is the title of the quest. (Note that the Chat Mapper simulator doesn't have a quest system, so it treats elements of the Item[] table as items.)

This class uses the following fields in the Item[] table, which is also aliased as Quest[]:

  • Display Name: (optional) Name to use in UIs. If blank or not present, UIs use Name field.
  • State (if using Chat Mapper, add this custom field or use the Dialogue System template project)
    • Valid values (case-sensitive): unassigned, active, success, failure, or done
  • Description: The description of the quest
  • Success Description (optional): The description to be displayed when the quest has been successfully completed
  • Failure Description (optional): The description to be displayed when the quest has ended in failure

Note: done is essentially equivalent to success. In the remainder of the Dialogue System's documentation, either done or success may be used in examples, but when using the QuestLog class, they both correspond to the same enum state, QuestState.Success.

As an example, you might define a simple quest like this:

  • Item["Kill 5 Rats"]
    • State = "unassigned"
    • Description = "The baker asked me to bring him 5 rat corpses to make a pie."
    • Success Description = "I brought the baker 5 dead rats, and we ate a delicious pie!"
    • Failure Description = "I freed the Pied Piper from jail. He took all the rats. No pie for me...."

This class provides methods to add and delete quests, get and set their state, and get their descriptions.

Note that quest states are usually updated during conversations. In most cases, you will probably set quest states in Lua code during conversations, so you may never need to use many of the methods in this class.

The UnityQuestLogWindow provides a quest log window using Unity GUI. You can use it as-is or use it as a template for implementing your own quest log window in another GUI system such as NGUI.

Member Function Documentation

◆ AbandonQuest()

static void PixelCrushers.DialogueSystem.QuestLog.AbandonQuest ( string  questName)
inlinestatic

Marks a quest as abandoned (i.e., in the Abandoned state).

Parameters
questNameName of the quest.

◆ AddQuest() [1/3]

static void PixelCrushers.DialogueSystem.QuestLog.AddQuest ( string  questName,
string  description 
)
inlinestatic

Adds a quest to the Lua Item[] table, and sets the state to Unassigned.

Parameters
questNameName of the quest.
descriptionDescription of the quest.

QuestLog.AddQuest("Kill 5 Rats", "The baker asked me to bring 5 rat corpses.");

◆ AddQuest() [2/3]

static void PixelCrushers.DialogueSystem.QuestLog.AddQuest ( string  questName,
string  description,
QuestState  state 
)
inlinestatic

Adds a quest to the Lua Item[] table.

Parameters
questNameName of the quest.
descriptionDescription of the quest.
stateQuest state.

QuestLog.AddQuest("Kill 5 Rats", "The baker asked me to bring 5 rat corpses.", QuestState.Unassigned);

◆ AddQuest() [3/3]

static void PixelCrushers.DialogueSystem.QuestLog.AddQuest ( string  questName,
string  description,
string  successDescription,
string  failureDescription,
QuestState  state 
)
inlinestatic

Adds a quest to the Lua Item[] table.

Parameters
questNameName of the quest.
descriptionDescription of the quest when active.
successDescriptionDescription of the quest when successfully completed.
failureDescriptionDescription of the quest when completed in failure.
stateQuest state.

QuestLog.AddQuest("Kill 5 Rats", "The baker asked me to bring 5 rat corpses.", QuestState.Unassigned);

◆ AddQuestEntry()

static void PixelCrushers.DialogueSystem.QuestLog.AddQuestEntry ( string  questName,
string  description 
)
inlinestatic

Adds a quest entry to a quest.

Parameters
questNameName of the quest.
entryNumberEntry number.
descriptionThe quest entry description.

◆ AddQuestStateObserver() [1/2]

static void PixelCrushers.DialogueSystem.QuestLog.AddQuestStateObserver ( string  questName,
int  entryNumber,
LuaWatchFrequency  frequency,
QuestChangedDelegate  questChangedHandler 
)
inlinestatic

Adds a quest state observer.

Parameters
questNameName of the quest.
entryNumberThe entry number (1...Entry Count) in the quest.
frequencyFrequency to check the quest state.
questChangedHandlerDelegate to call when the quest state changes. This should be in the form:
void MyDelegate(string questName, QuestState newState) {...}
QuestState
Quest state is a bit-flag enum that indicates the state of a quest.
Definition QuestState.cs:12

◆ AddQuestStateObserver() [2/2]

static void PixelCrushers.DialogueSystem.QuestLog.AddQuestStateObserver ( string  questName,
LuaWatchFrequency  frequency,
QuestChangedDelegate  questChangedHandler 
)
inlinestatic

Adds a quest state observer.

Parameters
questNameName of the quest.
frequencyFrequency to check the quest state.
questChangedHandlerDelegate to call when the quest state changes. This should be in the form:
void MyDelegate(string questName, QuestState newState) {...}

◆ CompleteQuest()

static void PixelCrushers.DialogueSystem.QuestLog.CompleteQuest ( string  questName)
inlinestatic

Marks a quest successful.

Parameters
questNameName of the quest.

◆ CurrentQuestEntryState()

static string PixelCrushers.DialogueSystem.QuestLog.CurrentQuestEntryState ( string  questName,
double  entryNumber 
)
inlinestatic

Gets the state of the quest entry.

Returns
The quest entry state.
Parameters
questNameName of the quest.
entryNumberEntry number.

◆ CurrentQuestState()

static string PixelCrushers.DialogueSystem.QuestLog.CurrentQuestState ( string  questName)
inlinestatic

Gets the quest state.

Parameters
questNameName of the quest.
Returns
The quest state string ("unassigned", "success", etc.).

◆ DefaultCurrentQuestEntryState()

static string PixelCrushers.DialogueSystem.QuestLog.DefaultCurrentQuestEntryState ( string  questName,
int  entryNumber 
)
inlinestatic

Default built-in implementation of CurrentQuestEntryState.

◆ DefaultCurrentQuestState()

static string PixelCrushers.DialogueSystem.QuestLog.DefaultCurrentQuestState ( string  questName)
inlinestatic

Default built-in version of CurrentQuestState.

◆ DefaultSetQuestEntryState()

static void PixelCrushers.DialogueSystem.QuestLog.DefaultSetQuestEntryState ( string  questName,
int  entryNumber,
string  state 
)
inlinestatic

Default built-in method to set quest entry state.

◆ DefaultSetQuestState()

static void PixelCrushers.DialogueSystem.QuestLog.DefaultSetQuestState ( string  questName,
string  state 
)
inlinestatic

Default built-in method to set quest state.

◆ DefaultStateToString()

static string PixelCrushers.DialogueSystem.QuestLog.DefaultStateToString ( QuestState  state)
inlinestatic

◆ DefaultStringToState()

static QuestState PixelCrushers.DialogueSystem.QuestLog.DefaultStringToState ( string  s)
inlinestatic

Converts a string representation into a state enum value.

Returns
The state (e.g., QuestState.Active).
Parameters
sThe string representation (e.g., "active").

◆ DeleteQuest()

static void PixelCrushers.DialogueSystem.QuestLog.DeleteQuest ( string  questName)
inlinestatic

Deletes a quest from the Lua Item[] table.

Use this method if you want to remove a quest entirely. If you just want to set the state of a quest, use SetQuestState.

Parameters
questNameName of the quest.

QuestLog.RemoveQuest("Kill 5 Rats");

◆ FailQuest()

static void PixelCrushers.DialogueSystem.QuestLog.FailQuest ( string  questName)
inlinestatic

Marks a quest as failed.

Parameters
questNameName of the quest.

◆ GetAllGroups() [1/3]

static string[] PixelCrushers.DialogueSystem.QuestLog.GetAllGroups ( )
inlinestatic

Gets all quest group names.

Returns
The group names for active quests, sorted by name.

◆ GetAllGroups() [2/3]

static string[] PixelCrushers.DialogueSystem.QuestLog.GetAllGroups ( QuestState  flags)
inlinestatic

Gets all quest group names.

Returns
The group names, sorted by name.
Parameters
flagsFlags for the quest states to filter.

◆ GetAllGroups() [3/3]

static string[] PixelCrushers.DialogueSystem.QuestLog.GetAllGroups ( QuestState  flags,
bool  sortByGroupName 
)
inlinestatic

Gets all quest group names.

Returns
The group names.
Parameters
flagsFlags for the quest states to filter.
sortByGroupNameIf set to true sort by group name.

◆ GetAllGroupsAndQuests()

static QuestGroupRecord[] PixelCrushers.DialogueSystem.QuestLog.GetAllGroupsAndQuests ( QuestState  flags,
bool  sort = true 
)
inlinestatic

Gets all quests (including their group names) in a specified state.

Returns
An array of QuestGroupRecord elements.
Parameters
flagsA bitmask of QuestState values.
flagsSort by group and name.

◆ GetAllQuests() [1/4]

static string[] PixelCrushers.DialogueSystem.QuestLog.GetAllQuests ( )
inlinestatic

Gets an array of all active quests.

Returns
The names of all active quests, sorted by Name.

string[] activeQuests = QuestLog.GetAllQuests();

◆ GetAllQuests() [2/4]

static string[] PixelCrushers.DialogueSystem.QuestLog.GetAllQuests ( QuestState  flags)
inlinestatic

Gets an array of all quests matching the specified state bitmask.

Returns
The names of all quests matching the specified state bitmask, sorted by Name.
Parameters
flagsA bitmask of QuestState values.

string[] completedQuests = QuestLog.GetAllQuests( QuestState.Success | QuestState.Failure );

◆ GetAllQuests() [3/4]

static string[] PixelCrushers.DialogueSystem.QuestLog.GetAllQuests ( QuestState  flags,
bool  sortByName 
)
inlinestatic

Gets an array of all quests matching the specified state bitmask.

Returns
The names of all quests matching the specified state bitmask.
Parameters
flagsA bitmask of QuestState values.
sortByNameIf true, sorts the names by name.

string[] completedQuests = QuestLog.GetAllQuests( QuestState.Success | QuestState.Failure, true );

◆ GetAllQuests() [4/4]

static string[] PixelCrushers.DialogueSystem.QuestLog.GetAllQuests ( QuestState  flags,
bool  sortByName,
string  group 
)
inlinestatic

Gets an array of all quests matching the specified state bitmask and in the specified group.

Returns
The names of all quests matching the specified state bitmask.
Parameters
flagsA bitmask of QuestState values.
sortByNameIf true, sorts the names by name.
groupIf not null, return only quests in the specified group.

string[] completedQuests = QuestLog.GetAllQuests( QuestState.Success | QuestState.Failure, true );

◆ GetEntryFieldName()

static string PixelCrushers.DialogueSystem.QuestLog.GetEntryFieldName ( int  entryNumber)
inlinestatic

◆ GetEntryStateFieldName()

static string PixelCrushers.DialogueSystem.QuestLog.GetEntryStateFieldName ( int  entryNumber)
inlinestatic

◆ GetQuestAbandonSequence()

static string PixelCrushers.DialogueSystem.QuestLog.GetQuestAbandonSequence ( string  questName)
inlinestatic

Gets the quest abandon sequence.

The QuestLogWindow plays this sequence when the player abandons a quest.

Returns
The quest abandon sequence.
Parameters
questNameQuest name.

◆ GetQuestDescription() [1/2]

static string PixelCrushers.DialogueSystem.QuestLog.GetQuestDescription ( string  questName)
inlinestatic

Gets a quest description, based on the current state of the quest (i.e., SuccessDescription, FailureDescription, or just Description).

Returns
The quest description.
Parameters
questNameName of the quest.

GUILayout.Label("Objective: " + QuestLog.GetQuestDescription("Kill 5 Rats"));

◆ GetQuestDescription() [2/2]

static string PixelCrushers.DialogueSystem.QuestLog.GetQuestDescription ( string  questName,
QuestState  state 
)
inlinestatic

Gets the localized quest description for a specific state.

Returns
The quest description.
Parameters
questNameName of the quest.
stateState to check.

◆ GetQuestEntry()

static string PixelCrushers.DialogueSystem.QuestLog.GetQuestEntry ( string  questName,
int  entryNumber 
)
inlinestatic

Gets the localized quest entry description.

Returns
The quest entry description.
Parameters
questNameName of the quest.
entryNumberEntry number.

◆ GetQuestEntryCount()

static int PixelCrushers.DialogueSystem.QuestLog.GetQuestEntryCount ( string  questName)
inlinestatic

Gets the quest entry count.

Returns
The quest entry count.
Parameters
questNameName of the quest.

◆ GetQuestEntryState()

static QuestState PixelCrushers.DialogueSystem.QuestLog.GetQuestEntryState ( string  questName,
int  entryNumber 
)
inlinestatic

Gets the state of the quest entry.

Returns
The quest entry state.
Parameters
questNameName of the quest.
entryNumberEntry number.

◆ GetQuestGroup()

static string PixelCrushers.DialogueSystem.QuestLog.GetQuestGroup ( string  questName)
inlinestatic

Gets the group that a quest belongs to.

Returns
The quest group name, or empty string if no group.
Parameters
questNameQuest name.

◆ GetQuestGroupDisplayName()

static string PixelCrushers.DialogueSystem.QuestLog.GetQuestGroupDisplayName ( string  questName)
inlinestatic

◆ GetQuestState()

static QuestState PixelCrushers.DialogueSystem.QuestLog.GetQuestState ( string  questName)
inlinestatic

Gets the quest state.

Returns
The quest state.
Parameters
questNameName of the quest.

if (QuestLog.QuestState("Kill 5 Rats") == QuestState.Active) { Smith.Say("Killing rats, eh? Here, take this hammer."); }

◆ GetQuestTitle()

static string PixelCrushers.DialogueSystem.QuestLog.GetQuestTitle ( string  questName)
inlinestatic

Gets the localized quest display name.

Returns
The quest title (display name) in the current language.
Parameters
questNameName of the quest.

◆ InformQuestEntryStateChange()

static void PixelCrushers.DialogueSystem.QuestLog.InformQuestEntryStateChange ( string  questName,
int  entryNumber 
)
inlinestatic

◆ InformQuestStateChange()

static void PixelCrushers.DialogueSystem.QuestLog.InformQuestStateChange ( string  questName)
inlinestatic

◆ IsQuestAbandonable()

static bool PixelCrushers.DialogueSystem.QuestLog.IsQuestAbandonable ( string  questName)
inlinestatic

Determines if a quest is abandonable (that is, is has a field named "Abandonable" that's true.)

Returns
true if the quest is abandonable; otherwise, false.
Parameters
questNameQuest name.

◆ IsQuestAbandoned()

static bool PixelCrushers.DialogueSystem.QuestLog.IsQuestAbandoned ( string  questName)
inlinestatic

Reports whether a quest was abandoned (i.e., in the Abandoned state).

Returns
true if the quest was abandoned; otherwise, false.
Parameters
questNameName of the quest.

◆ IsQuestActive()

static bool PixelCrushers.DialogueSystem.QuestLog.IsQuestActive ( string  questName)
inlinestatic

Reports whether a quest is active.

Returns
true if the quest is active; otherwise, false.
Parameters
questNameName of the quest.

◆ IsQuestDone()

static bool PixelCrushers.DialogueSystem.QuestLog.IsQuestDone ( string  questName)
inlinestatic

Reports whether a quest is done, either successful or failed.

Returns
true if the quest is done; otherwise, false.
Parameters
questNameName of the quest.

◆ IsQuestEntryInStateMask()

static bool PixelCrushers.DialogueSystem.QuestLog.IsQuestEntryInStateMask ( string  questName,
int  entryNumber,
QuestState  stateMask 
)
inlinestatic

Reports whether a quest entry's current state is one of the states marked in a state bit mask.

Returns
true if the quest entry's current state is in the state bit mask.
Parameters
questNameName of the quest.
entryNumberQuest entry number.
stateMaskA QuestState bit mask (e.g., QuestState.Success | QuestState.Failure).

◆ IsQuestFailed()

static bool PixelCrushers.DialogueSystem.QuestLog.IsQuestFailed ( string  questName)
inlinestatic

Reports whether a quest ended in failure.

Returns
true if the quest ended in failure; otherwise, false.
Parameters
questNameName of the quest.

◆ IsQuestInStateMask()

static bool PixelCrushers.DialogueSystem.QuestLog.IsQuestInStateMask ( string  questName,
QuestState  stateMask 
)
inlinestatic

Reports whether a quest's current state is one of the states marked in a state bit mask.

Returns
true if the quest's current state is in the state bit mask.
Parameters
questNameName of the quest.
stateMaskA QuestState bit mask (e.g., QuestState.Success | QuestState.Failure).

◆ IsQuestSuccessful()

static bool PixelCrushers.DialogueSystem.QuestLog.IsQuestSuccessful ( string  questName)
inlinestatic

Reports whether a quest was successfully completed.

Returns
true if the quest was successfully completed; otherwise, false.
Parameters
questNameName of the quest.

◆ IsQuestTrackingAvailable()

static bool PixelCrushers.DialogueSystem.QuestLog.IsQuestTrackingAvailable ( string  questName)
inlinestatic

Determines if quest tracking is available (that is, if the quest has a "Trackable" field).

Returns
true if quest tracking is available; otherwise, false.
Parameters
questNameQuest name.

◆ IsQuestTrackingEnabled()

static bool PixelCrushers.DialogueSystem.QuestLog.IsQuestTrackingEnabled ( string  questName)
inlinestatic

Determines if tracking is enabled for a quest.

Returns
true if tracking enabled on the specified quest; otherwise, false.
Parameters
questNameQuest name.

◆ IsQuestUnassigned()

static bool PixelCrushers.DialogueSystem.QuestLog.IsQuestUnassigned ( string  questName)
inlinestatic

Reports whether a quest is unassigned.

Returns
true if the quest is unassigned; otherwise, false.
Parameters
questNameName of the quest.

◆ IsQuestVisible()

static bool PixelCrushers.DialogueSystem.QuestLog.IsQuestVisible ( string  questName)
inlinestatic

Returns true if quest has a field named "Visible" that is currently true or doesn't have the field.

◆ MarkQuestViewed()

static void PixelCrushers.DialogueSystem.QuestLog.MarkQuestViewed ( string  questName)
inlinestatic

Marks a quest as viewed (i.e., in the quest log window).

Generally only set/used when QuestLogWindow.newQuestText is not blank.

Parameters
questName

◆ QuestChangedDelegate()

delegate void PixelCrushers.DialogueSystem.QuestLog.QuestChangedDelegate ( string  questName,
QuestState  newState 
)

Quest changed delegate.

◆ RegisterQuestLogFunctions()

static void PixelCrushers.DialogueSystem.QuestLog.RegisterQuestLogFunctions ( )
inlinestatic

◆ RemoveAllQuestStateObservers()

static void PixelCrushers.DialogueSystem.QuestLog.RemoveAllQuestStateObservers ( )
inlinestatic

Removes all quest state observers.

◆ RemoveQuestStateObserver() [1/2]

static void PixelCrushers.DialogueSystem.QuestLog.RemoveQuestStateObserver ( string  questName,
int  entryNumber,
LuaWatchFrequency  frequency,
QuestChangedDelegate  questChangedHandler 
)
inlinestatic

Removes a quest state observer.

To be removed, the questName, frequency, and delegate must all match.

Parameters
questNameName of the quest.
entryNumberThe entry number (1...Entry Count) in the quest.
frequencyFrequency that the quest state is being checked.
questChangedHandlerQuest changed handler delegate.

◆ RemoveQuestStateObserver() [2/2]

static void PixelCrushers.DialogueSystem.QuestLog.RemoveQuestStateObserver ( string  questName,
LuaWatchFrequency  frequency,
QuestChangedDelegate  questChangedHandler 
)
inlinestatic

Removes a quest state observer.

To be removed, the questName, frequency, and delegate must all match.

Parameters
questNameName of the quest.
frequencyFrequency that the quest state is being checked.
questChangedHandlerQuest changed handler delegate.

◆ SetQuestAbandonSequence()

static void PixelCrushers.DialogueSystem.QuestLog.SetQuestAbandonSequence ( string  questName,
string  sequence 
)
inlinestatic

Sets the quest abandon sequence.

The QuestLogWindow plays this sequence when the player abandons a quest.

Parameters
questNameQuest name.
sequenceSequence to play when the quest is abandoned.

◆ SetQuestDescription()

static void PixelCrushers.DialogueSystem.QuestLog.SetQuestDescription ( string  questName,
QuestState  state,
string  description 
)
inlinestatic

Sets the quest description for a specified state.

Parameters
questNameName of the quest.
stateSet the description for this state (i.e., regular, success, or failure).
descriptionThe description.

◆ SetQuestEntry()

static void PixelCrushers.DialogueSystem.QuestLog.SetQuestEntry ( string  questName,
int  entryNumber,
string  description 
)
inlinestatic

Sets the localized quest entry description.

Parameters
questNameName of the quest.
entryNumberEntry number.
descriptionThe quest entry description.

◆ SetQuestEntryState() [1/2]

static void PixelCrushers.DialogueSystem.QuestLog.SetQuestEntryState ( string  questName,
double  entryNumber,
string  state 
)
inlinestatic

Sets the state of a quest entry.

Parameters
questNameName of the quest.
entryNumberEntry number.
stateState.

◆ SetQuestEntryState() [2/2]

static void PixelCrushers.DialogueSystem.QuestLog.SetQuestEntryState ( string  questName,
int  entryNumber,
QuestState  state 
)
inlinestatic

Sets the state of the quest entry.

Parameters
questNameName of the quest.
entryNumberEntry number.
stateState.

◆ SetQuestState() [1/2]

static void PixelCrushers.DialogueSystem.QuestLog.SetQuestState ( string  questName,
QuestState  state 
)
inlinestatic

Sets the quest state.

Parameters
questNameName of the quest.
stateNew state.

if (PiedPiperIsFree) { QuestLog.SetQuestState("Kill 5 Rats", QuestState.Failure); }

◆ SetQuestState() [2/2]

static void PixelCrushers.DialogueSystem.QuestLog.SetQuestState ( string  questName,
string  state 
)
inlinestatic

Sets the quest state, using the override delegate if assigned; otherwise using the default method DefaultSetQuestState.

Parameters
questNameName of the quest.
stateNew state.

◆ SetQuestTracking()

static void PixelCrushers.DialogueSystem.QuestLog.SetQuestTracking ( string  questName,
bool  value 
)
inlinestatic

Sets quest tracking on or off (by setting the Track field).

If turning on tracking and tracking is currently not available (Trackable field is false), this also sets the Trackable field true.

Parameters
questNameQuest name.
valueIf set to true, tracking is enabled.

◆ SetQuestTrackingAvailable()

static void PixelCrushers.DialogueSystem.QuestLog.SetQuestTrackingAvailable ( string  questName,
bool  value 
)
inlinestatic

Specifies whether quest tracking is available (that is, if the quest has a "Trackable" field).

Parameters
questNameQuest name.
valueTrackable or not.

◆ SetQuestVisibility()

static void PixelCrushers.DialogueSystem.QuestLog.SetQuestVisibility ( string  questName)
inlinestatic

Sets a quest's Visible field true or false.

◆ StartQuest()

static void PixelCrushers.DialogueSystem.QuestLog.StartQuest ( string  questName)
inlinestatic

Starts a quest by setting its state to active.

Parameters
questNameName of the quest.

StartQuest("Kill 5 Rats");

◆ UpdateQuestIndicators()

static void PixelCrushers.DialogueSystem.QuestLog.UpdateQuestIndicators ( string  questName)
inlinestatic

Updates all quest state listeners who are listening for questName.

◆ WasQuestViewed()

static bool PixelCrushers.DialogueSystem.QuestLog.WasQuestViewed ( string  questName)
inlinestatic

Returns true if quest has a field named "Viewed" that is currently true.

Used if QuestLogWindow.newQuestText is not blank.

Member Data Documentation

◆ AbandonedStateString

const string PixelCrushers.DialogueSystem.QuestLog.AbandonedStateString = "abandoned"
static

Constant state string for quests that were abandoned.

◆ ActiveStateString

const string PixelCrushers.DialogueSystem.QuestLog.ActiveStateString = "active"
static

Constant state string for active quests.

◆ CurrentQuestEntryStateOverride

CurrentQuestEntryStateDelegate PixelCrushers.DialogueSystem.QuestLog.CurrentQuestEntryStateOverride = null
static

You can assign a method to override the default CurrentQuestEntryState.

◆ CurrentQuestStateOverride

CurrentQuestStateDelegate PixelCrushers.DialogueSystem.QuestLog.CurrentQuestStateOverride = null
static

You can assign a method to override the default CurrentQuestState.

◆ DoneStateString

const string PixelCrushers.DialogueSystem.QuestLog.DoneStateString = "done"
static

Constant state string for quests that are done, if you want to track done instead of success/failure.

This is essentially the same as success, and corresponds to the same enum value, QuestState.Success

◆ FailureStateString

const string PixelCrushers.DialogueSystem.QuestLog.FailureStateString = "failure"
static

Constant state string for quests ending in failure.

◆ GrantableStateString

const string PixelCrushers.DialogueSystem.QuestLog.GrantableStateString = "grantable"
static

Constant state string for quests that are grantable.

This state isn't used by the Dialogue System, but it's made available for those who want to use it.

◆ ReturnToNPCStateString

const string PixelCrushers.DialogueSystem.QuestLog.ReturnToNPCStateString = "returnToNPC"
static

Constant state string for quests that are waiting to return to NPC.

This state isn't used by the Dialogue System, but it's made available for those who want to use it.

◆ SetQuestEntryStateOverride

SetQuestEntryStateDelegate PixelCrushers.DialogueSystem.QuestLog.SetQuestEntryStateOverride = null
static

You can assign a method to override the default SetQuestEntryState.

◆ SetQuestStateOverride

SetQuestStateDelegate PixelCrushers.DialogueSystem.QuestLog.SetQuestStateOverride = null
static

You can assign a method to override the default SetQuestState.

◆ StateToString

QuestStateToStringDelegate PixelCrushers.DialogueSystem.QuestLog.StateToString = DefaultStateToString
static

◆ StringToState

StringToQuestStateDelegate PixelCrushers.DialogueSystem.QuestLog.StringToState = DefaultStringToState
static

You can reassign this delegate method to override the default conversion of strings to QuestStates.

◆ SuccessStateString

const string PixelCrushers.DialogueSystem.QuestLog.SuccessStateString = "success"
static

Constant state string for successfully-completed quests.

◆ trackOneQuestAtATime

bool PixelCrushers.DialogueSystem.QuestLog.trackOneQuestAtATime = false
static

Set true to allow only one quest to be tracked at a time.

◆ UnassignedStateString

const string PixelCrushers.DialogueSystem.QuestLog.UnassignedStateString = "unassigned"
static

Constant state string for unassigned quests.


The documentation for this class was generated from the following file: