The Dialogue System Trigger is a general-purpose trigger that can execute most Dialogue System functions such as starting conversations, barks, alerts, sequences, and Lua code. More...
Classes | |
class | SendMessageAction |
class | SetAnimatorStateAction |
class | SetComponentEnabledAction |
class | SetGameObjectActiveAction |
Public Types | |
enum | BarkSource { None , Conversation , Text } |
Public Member Functions | |
virtual void | Awake () |
virtual void | Start () |
void | OnBarkStart (Transform actor) |
void | OnBarkEnd (Transform actor) |
void | OnConversationStart (Transform actor) |
void | OnConversationEnd (Transform actor) |
void | OnSequenceStart (Transform actor) |
void | OnSequenceEnd (Transform actor) |
void | OnSequenceEnd () |
void | OnUse (Transform actor) |
void | OnUse (string message) |
void | OnUse () |
void | OnTriggerEnter (Collider other) |
void | OnTriggerExit (Collider other) |
void | OnTriggerEnter2D (Collider2D other) |
void | OnTriggerExit2D (Collider2D other) |
void | OnCollisionEnter2D (Collision2D collision) |
void | OnCollisionExit2D (Collision2D collision) |
void | OnCollisionEnter (Collision collision) |
void | OnCollisionExit (Collision collision) |
void | OnEnable () |
void | OnDisable () |
void | OnLevelWillBeUnloaded () |
void | OnApplicationQuit () |
void | OnDestroy () |
void | TryStart (Transform actor) |
virtual void | TryStart (Transform actor, Transform interactor) |
Sets the quest status if the condition is true. | |
virtual void | Fire (Transform actor) |
void | ResetBarkHistory () |
Resets the bark history to the beginning of the list of bark lines. | |
void | OnRecordPersistentData () |
Listens for the OnRecordPersistentData message and records the current bark index. | |
void | OnApplyPersistentData () |
Listens for the OnApplyPersistentData message and retrieves the current bark index. | |
Public Attributes | |
DialogueSystemTriggerEvent | trigger = DialogueSystemTriggerEvent.OnUse |
The trigger that this component listens for. | |
Condition | condition |
The conditions under which the trigger will fire. | |
bool | setQuestState = true |
If true , set the quest state. | |
string | questName |
The name of the quest. | |
QuestState | questState |
The new state of the quest when triggered. | |
bool | setQuestEntryState = false |
If true , set the quest entry state. | |
int | questEntryNumber = 1 |
The quest entry number whose state to change. | |
QuestState | questEntryState |
The new state of the quest entry when triggered. | |
bool | setAnotherQuestEntryState = false |
int | anotherQuestEntryNumber = 1 |
QuestState | anotherQuestEntryState |
string | luaCode = string.Empty |
The lua code to run. | |
string | sequence = string.Empty |
Transform | sequenceSpeaker |
The speaker to use for the sequence (or null if no speaker is needed). | |
Transform | sequenceListener |
The listener to use for the sequence (or null if no listener is needed). | |
bool | waitOneFrameOnStartOrEnable = true |
string | alertMessage |
An optional gameplay alert message. | |
TextTable | textTable |
An optional localized text table to use for the alert message. | |
float | alertDuration = 0 |
SendMessageAction[] | sendMessages = new SendMessageAction[0] |
Targets and messages to send when the trigger fires. | |
BarkSource | barkSource = BarkSource.None |
string | barkConversation = string.Empty |
The title of the bark conversation. | |
int | barkEntryID = -1 |
Dialogue entry to bark. | |
string | barkEntryTitle |
Bark entry with this Title. | |
string | barkText = string.Empty |
Text to bark. | |
string | barkTextSequence = string.Empty |
Optional sequence to play when barking text. | |
Transform | barker |
The barker. | |
Transform | barkTarget |
The target of the bark. | |
BarkOrder | barkOrder = BarkOrder.Random |
Specifies the order to run through the list of barks. | |
bool | allowBarksDuringConversations = false |
Are barks allowed during conversations? | |
bool | skipBarkIfNoValidEntries |
Skip bark if no valid entries. | |
bool | cacheBarkLines = false |
If ticked, bark info is cached during the first bark. | |
string | conversation = string.Empty |
The title of the conversation to start. | |
Transform | conversationConversant |
The conversant of the conversation. | |
Transform | conversationActor |
The actor to converse with. | |
int | startConversationEntryID = -1 |
string | startConversationEntryTitle |
GameObject | overrideDialogueUI = null |
bool | exclusive = false |
Only start if no other conversation is active. | |
bool | replace = false |
Stop other conversation if one is active. | |
bool | queue = false |
If another conversation is active and simultaneous conversations aren't allowed, queue this conversation to start as soon as active one ends. | |
bool | skipIfNoValidEntries = false |
If this is true and no valid entries currently link from the start entry, don't start the conversation. | |
bool | preventRestartOnSameFrameEnded = false |
bool | stopConversationOnTriggerExit = false |
Set true to stop the conversation if the actor leaves the trigger area. | |
float | marginToAllowTriggerExit = 0.2f |
bool | stopConversationIfTooFar = false |
float | maxConversationDistance = 5f |
float | monitorConversationDistanceFrequency = 1f |
bool | showCursorDuringConversation = false |
bool | pauseGameDuringConversation = false |
SetGameObjectActiveAction[] | setActiveActions = new SetGameObjectActiveAction[0] |
SetComponentEnabledAction[] | setEnabledActions = new SetComponentEnabledAction[0] |
SetAnimatorStateAction[] | setAnimatorStateActions = new SetAnimatorStateAction[0] |
GameObjectUnityEvent | onExecute = new GameObjectUnityEvent() |
bool | useConversationTitlePicker = true |
bool | useBarkTitlePicker = true |
bool | useQuestNamePicker = true |
DialogueDatabase | selectedDatabase = null |
Protected Member Functions | |
IEnumerator | ShowCursorAfterOneFrame () |
void | CheckOnTriggerExit (Transform otherTransform) |
IEnumerator | StartAtEndOfFrame () |
virtual void | OnSaveDataApplied () |
virtual IEnumerator | FireIfNoSaveDataApplied () |
virtual void | DoQuestAction () |
virtual void | DoLuaAction (Transform actor) |
virtual void | DoLuaAction () |
virtual void | DoSequenceAction (Transform actor) |
virtual void | DoAlertAction () |
virtual void | DoSendMessageActions () |
virtual void | DoBarkAction (Transform actor) |
virtual Transform | GetBarker (string conversation) |
virtual string | GetBarkerName () |
virtual void | BarkCachedLine (Transform speaker, Transform listener) |
void | PopulateCache (Transform speaker, Transform listener) |
void | BarkNextCachedLine (Transform speaker, Transform listener) |
virtual void | DoConversationAction (Transform actor) |
virtual void | StopActiveConversation () |
void | StopMonitoringConversationDistance () |
IEnumerator | MonitorDistance (Transform actor) |
virtual void | DoSetActiveActions (Transform actor) |
virtual void | DoSetEnabledActions (Transform actor) |
virtual void | DoSetAnimatorStateActions (Transform actor) |
Protected Attributes | |
BarkHistory | barkHistory |
ConversationState | cachedState = null |
BarkGroupMember | barkGroupMember = null |
IBarkUI | barkUI = null |
bool | isConversationQueued = false |
Transform | queuedActor = null |
float | earliestTimeToAllowTriggerExit = 0 |
Coroutine | monitorDistanceCoroutine = null |
bool | wasCursorVisible |
CursorLockMode | savedLockState |
bool | didIPause = false |
float | preConversationTimeScale = 1 |
int | frameConversationEnded = -1 |
bool | tryingToStart = false |
bool | hasSaveSystem |
Coroutine | fireIfNoSaveDataAppliedCoroutine = null |
ActiveConversationRecord | activeConversation |
bool | listenForOnDestroy = false |
Properties | |
Sequencer | sequencer [get, protected set] |
Gets the sequencer used by the current bark, if a bark is playing. | |
BarkHistory | BarkHistory [get] |
The Dialogue System Trigger is a general-purpose trigger that can execute most Dialogue System functions such as starting conversations, barks, alerts, sequences, and Lua code.
Note: DialogueSystemTrigger has a custom editor (DialogueSystemTriggerEditor). If you make a subclass, you can also subclass the editor script and override its virtual functions.
|
inlinevirtual |
|
inlineprotectedvirtual |
|
inlineprotected |
|
inlineprotected |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Reimplemented in PixelCrushers.DialogueSystem.InkSupport.DialogueSystemInkTrigger.
|
inlineprotectedvirtual |
Reimplemented in PixelCrushers.DialogueSystem.InkSupport.DialogueSystemInkTrigger.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlinevirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotected |
|
inline |
|
inline |
Listens for the OnApplyPersistentData message and retrieves the current bark index.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Listens for the OnRecordPersistentData message and records the current bark index.
|
inlineprotectedvirtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inline |
Resets the bark history to the beginning of the list of bark lines.
|
inlineprotected |
|
inlinevirtual |
|
inlineprotected |
|
inlineprotectedvirtual |
|
inlineprotected |
|
inline |
|
inlinevirtual |
Sets the quest status if the condition is true.
|
protected |
float PixelCrushers.DialogueSystem.DialogueSystemTrigger.alertDuration = 0 |
string PixelCrushers.DialogueSystem.DialogueSystemTrigger.alertMessage |
An optional gameplay alert message.
Leave blank for no message.
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.allowBarksDuringConversations = false |
Are barks allowed during conversations?
int PixelCrushers.DialogueSystem.DialogueSystemTrigger.anotherQuestEntryNumber = 1 |
QuestState PixelCrushers.DialogueSystem.DialogueSystemTrigger.anotherQuestEntryState |
string PixelCrushers.DialogueSystem.DialogueSystemTrigger.barkConversation = string.Empty |
The title of the bark conversation.
Used if barkSource is set to conversation.
int PixelCrushers.DialogueSystem.DialogueSystemTrigger.barkEntryID = -1 |
Dialogue entry to bark.
Otherwise will bark from a valid entry in bark conversation.
string PixelCrushers.DialogueSystem.DialogueSystemTrigger.barkEntryTitle |
Bark entry with this Title.
If set, this takes precedence over Bark Entry ID.
Transform PixelCrushers.DialogueSystem.DialogueSystemTrigger.barker |
The barker.
|
protected |
|
protected |
BarkOrder PixelCrushers.DialogueSystem.DialogueSystemTrigger.barkOrder = BarkOrder.Random |
Specifies the order to run through the list of barks.
BarkSource PixelCrushers.DialogueSystem.DialogueSystemTrigger.barkSource = BarkSource.None |
Transform PixelCrushers.DialogueSystem.DialogueSystemTrigger.barkTarget |
The target of the bark.
string PixelCrushers.DialogueSystem.DialogueSystemTrigger.barkText = string.Empty |
Text to bark.
Used if barkSource is text. Will be localized through Dialogue Manager's Text Table if assigned.
string PixelCrushers.DialogueSystem.DialogueSystemTrigger.barkTextSequence = string.Empty |
Optional sequence to play when barking text.
|
protected |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.cacheBarkLines = false |
If ticked, bark info is cached during the first bark.
This can reduce stutter when barking on slower mobile devices, but barks are not reevaluated each time as the state changes, barks use no em formatting codes, and sequences are not played with barks.
|
protected |
Condition PixelCrushers.DialogueSystem.DialogueSystemTrigger.condition |
The conditions under which the trigger will fire.
string PixelCrushers.DialogueSystem.DialogueSystemTrigger.conversation = string.Empty |
The title of the conversation to start.
Transform PixelCrushers.DialogueSystem.DialogueSystemTrigger.conversationActor |
The actor to converse with.
If not set, the game object that triggered the event.
Transform PixelCrushers.DialogueSystem.DialogueSystemTrigger.conversationConversant |
The conversant of the conversation.
If not set, this game object. The actor is usually the entity that caused the trigger (for example, the player that hits the "Use" button on the conversant, thereby triggering OnUse). See https://www.pixelcrushers.com/dialogue_system/manual2x/html/triggers_and_interaction.html for an explanation of how GameObjects are assigned at runtime.
|
protected |
|
protected |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.exclusive = false |
Only start if no other conversation is active.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
string PixelCrushers.DialogueSystem.DialogueSystemTrigger.luaCode = string.Empty |
The lua code to run.
float PixelCrushers.DialogueSystem.DialogueSystemTrigger.marginToAllowTriggerExit = 0.2f |
float PixelCrushers.DialogueSystem.DialogueSystemTrigger.maxConversationDistance = 5f |
float PixelCrushers.DialogueSystem.DialogueSystemTrigger.monitorConversationDistanceFrequency = 1f |
|
protected |
GameObjectUnityEvent PixelCrushers.DialogueSystem.DialogueSystemTrigger.onExecute = new GameObjectUnityEvent() |
GameObject PixelCrushers.DialogueSystem.DialogueSystemTrigger.overrideDialogueUI = null |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.pauseGameDuringConversation = false |
|
protected |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.preventRestartOnSameFrameEnded = false |
int PixelCrushers.DialogueSystem.DialogueSystemTrigger.questEntryNumber = 1 |
The quest entry number whose state to change.
QuestState PixelCrushers.DialogueSystem.DialogueSystemTrigger.questEntryState |
The new state of the quest entry when triggered.
string PixelCrushers.DialogueSystem.DialogueSystemTrigger.questName |
The name of the quest.
QuestState PixelCrushers.DialogueSystem.DialogueSystemTrigger.questState |
The new state of the quest when triggered.
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.queue = false |
If another conversation is active and simultaneous conversations aren't allowed, queue this conversation to start as soon as active one ends.
|
protected |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.replace = false |
Stop other conversation if one is active.
|
protected |
DialogueDatabase PixelCrushers.DialogueSystem.DialogueSystemTrigger.selectedDatabase = null |
SendMessageAction [] PixelCrushers.DialogueSystem.DialogueSystemTrigger.sendMessages = new SendMessageAction[0] |
Targets and messages to send when the trigger fires.
string PixelCrushers.DialogueSystem.DialogueSystemTrigger.sequence = string.Empty |
Transform PixelCrushers.DialogueSystem.DialogueSystemTrigger.sequenceListener |
The listener to use for the sequence (or null if no listener is needed).
Sequence commands can reference 'speaker' and 'listener', so you may need to define them in this component.
Transform PixelCrushers.DialogueSystem.DialogueSystemTrigger.sequenceSpeaker |
The speaker to use for the sequence (or null if no speaker is needed).
Sequence commands can reference 'speaker' and 'listener', so you may need to define them in this component.
SetGameObjectActiveAction [] PixelCrushers.DialogueSystem.DialogueSystemTrigger.setActiveActions = new SetGameObjectActiveAction[0] |
SetAnimatorStateAction [] PixelCrushers.DialogueSystem.DialogueSystemTrigger.setAnimatorStateActions = new SetAnimatorStateAction[0] |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.setAnotherQuestEntryState = false |
SetComponentEnabledAction [] PixelCrushers.DialogueSystem.DialogueSystemTrigger.setEnabledActions = new SetComponentEnabledAction[0] |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.setQuestEntryState = false |
If true
, set the quest entry state.
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.setQuestState = true |
If true
, set the quest state.
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.showCursorDuringConversation = false |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.skipBarkIfNoValidEntries |
Skip bark if no valid entries.
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.skipIfNoValidEntries = false |
If this is true
and no valid entries currently link from the start entry, don't start the conversation.
int PixelCrushers.DialogueSystem.DialogueSystemTrigger.startConversationEntryID = -1 |
string PixelCrushers.DialogueSystem.DialogueSystemTrigger.startConversationEntryTitle |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.stopConversationIfTooFar = false |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.stopConversationOnTriggerExit = false |
Set true
to stop the conversation if the actor leaves the trigger area.
TextTable PixelCrushers.DialogueSystem.DialogueSystemTrigger.textTable |
An optional localized text table to use for the alert message.
DialogueSystemTriggerEvent PixelCrushers.DialogueSystem.DialogueSystemTrigger.trigger = DialogueSystemTriggerEvent.OnUse |
The trigger that this component listens for.
|
protected |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.useBarkTitlePicker = true |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.useConversationTitlePicker = true |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.useQuestNamePicker = true |
bool PixelCrushers.DialogueSystem.DialogueSystemTrigger.waitOneFrameOnStartOrEnable = true |
|
protected |
|
getprotected |
|
getprotected set |
Gets the sequencer used by the current bark, if a bark is playing.
If a bark is not playing, this is undefined. To check if a bark is playing, check the bark UI's IsPlaying property.
The sequencer.