PixelCrushers.DialogueSystem.DialogueDatabase Class Reference

A dialogue database asset. More...

Inheritance diagram for PixelCrushers.DialogueSystem.DialogueDatabase:
Collaboration diagram for PixelCrushers.DialogueSystem.DialogueDatabase:

Classes

class  SyncInfo
 

Public Member Functions

void ResetEmphasisSettings ()
 
bool IsPlayerID (int actorID)
 Determines whether an actor is a player character.
 
bool IsPlayer (string actorName)
 Determines whether an actor is a player character.
 
CharacterType GetCharacterType (int actorID)
 Gets the type of the character (PC or NPC) of an actor based on the actor's IsPlayer value.
 
void ResetCache ()
 Dialogue databases maintain a quick lookup cache of assets by Name (by Title for conversations).
 
delegate string GetCustomEntrytagDelegate (Conversation conversation, DialogueEntry entry)
 
Actor GetActor (string actorName)
 Gets the actor by name.
 
Actor GetActor (int id)
 Gets the actor associated with an actor ID.
 
Item GetItem (string itemName)
 Gets the item by name.
 
Item GetItem (int id)
 Gets the item associated with an item ID.
 
Location GetLocation (string locationName)
 Gets the location by name.
 
Location GetLocation (int id)
 Gets the location associated with a location ID.
 
Variable GetVariable (string variableName)
 Gets the variable by name.
 
Variable GetVariable (int id)
 Gets the variable by ID.
 
void AddConversation (Conversation conversation)
 Adds a Conversation to the database.
 
Conversation GetConversation (string conversationTitle)
 Retrieves a Conversation by its Title field.
 
Conversation GetConversation (int conversationID)
 Retrieves a Conversation by its ID.
 
DialogueEntry GetDialogueEntry (int conversationID, int dialogueEntryID)
 Gets a dialogue entry by its conversation and dialogue entry IDs.
 
DialogueEntry GetDialogueEntry (Link link)
 Follows a Link and returns the destination DialogueEntry.
 
string GetLinkText (Link link)
 Gets the text of the dialogue entry that a link points to.
 
void Add (DialogueDatabase database)
 Add the contents of another database to this database.
 
void Remove (DialogueDatabase database)
 Removes from this database all content that's in the specified database.
 
void Remove (DialogueDatabase database, List< DialogueDatabase > keep)
 Removes from this database all content that's in the specified database.
 
void Clear ()
 Removes all assets from this database.
 
void SyncAll ()
 Syncs all assets from their source databases if assigned in syncInfo.
 
void SyncActors ()
 Syncs the actors from syncInfo.syncActorsDatabase.
 
void SyncItems ()
 Syncs the items from syncInfo.syncItemsDatabase.
 
void SyncLocations ()
 Syncs the locations from syncInfo.syncLocationsDatabase.
 
void SyncVariables ()
 Syncs the variables from syncInfo.syncVariablesDatabase.
 
string GetEntrytag (Conversation conversation, DialogueEntry entry, EntrytagFormat entrytagFormat)
 Gets the entrytag string of a dialogue entry.
 
string GetEntrytag (int conversationID, int dialogueEntryID, EntrytagFormat entrytagFormat)
 Gets the entrytag string of a dialogue entry.
 
string GetEntrytaglocal (Conversation conversation, DialogueEntry entry, EntrytagFormat entrytagFormat)
 Gets the entrytaglocal string (localized version) of a dialogue entry.
 
string GetEntrytaglocal (int conversationID, int dialogueEntryID, EntrytagFormat entrytagFormat)
 Gets the entrytaglocal string (localized version) of a dialogue entry.
 

Static Public Member Functions

static bool ContainsName< T > (List< T > assetList, string assetName)
 Checks if a list of assets contains an asset with a specified name.
 
static bool ContainsID< T > (List< T > assetList, int assetID)
 Checks if a list of assets contains an asset with a specified ID.
 
static bool ContainsTitle (List< Conversation > conversations, string title)
 Checks is a list of conversations contains a conversation with a specified title.
 
static bool Contains (DialogueDatabase database, Asset asset)
 Checks if a database contains an asset.
 
static bool Contains (List< DialogueDatabase > databaseList, Asset asset)
 Checks if a list of databases contains an asset.
 

Public Attributes

string version
 The version of the database, typically only used internally by the developer.
 
string author
 The author, typically only used internally by the developer.
 
string description
 The description of the database, typically only used internally by the developer.
 
string globalUserScript
 The global Lua user script.
 
EmphasisSetting[] emphasisSettings = new EmphasisSetting[NumEmphasisSettings]
 A Chat Mapper project defines four emphasis settings (text styles) for formatting lines of dialogue.
 
int baseID = 1
 Assign IDs of assets (actors, items, conversations, etc.) from this base value.
 
List< Actoractors = new List<Actor>()
 The actors in the database.
 
List< Itemitems = new List<Item>()
 The items in the database.
 
List< Locationlocations = new List<Location>()
 The locations in the database.
 
List< Variablevariables = new List<Variable>()
 The variables in the database.
 
List< Conversationconversations = new List<Conversation>()
 The conversations in the database.
 
SyncInfo syncInfo = new SyncInfo()
 
string templateJson = string.Empty
 Each database now stores a copy of its template.
 

Static Public Attributes

const int NumEmphasisSettings = 4
 The number of emphasis settings supported by Chat Mapper and the Dialogue System.
 
static GetCustomEntrytagDelegate getCustomEntrytag = null
 
const string InvalidEntrytag = "invalid_entrytag"
 
const string VoiceOverFileFieldName = DialogueSystemFields.VoiceOverFile
 

Properties

int playerID [get]
 Gets the ID of the first player character in the actor list.
 

Detailed Description

A dialogue database asset.

A dialogue database is a collection of data records necessary to run dialogue, such as actors and conversations. This is a ScriptableObject so it can be edited, serialized, and assigned in Unity.

Member Function Documentation

◆ Add()

void PixelCrushers.DialogueSystem.DialogueDatabase.Add ( DialogueDatabase  database)
inline

Add the contents of another database to this database.

Parameters
databaseThe database to copy.

◆ AddConversation()

void PixelCrushers.DialogueSystem.DialogueDatabase.AddConversation ( Conversation  conversation)
inline

Adds a Conversation to the database.

Parameters
conversationThe conversation to add.

◆ Clear()

void PixelCrushers.DialogueSystem.DialogueDatabase.Clear ( )
inline

Removes all assets from this database.

◆ Contains() [1/2]

static bool PixelCrushers.DialogueSystem.DialogueDatabase.Contains ( DialogueDatabase  database,
Asset  asset 
)
inlinestatic

Checks if a database contains an asset.

Depending on the asset's type, it will check by name or title. This might not be an exact match – for example, two conversations could have the same title, in which case either one would return true.

Parameters
databaseThe database to search.
assetThe asset to search for.

◆ Contains() [2/2]

static bool PixelCrushers.DialogueSystem.DialogueDatabase.Contains ( List< DialogueDatabase databaseList,
Asset  asset 
)
inlinestatic

Checks if a list of databases contains an asset.

Parameters
databaseListThe list of databases to check.
assetThe asset to search for.

◆ ContainsID< T >()

static bool PixelCrushers.DialogueSystem.DialogueDatabase.ContainsID< T > ( List< T >  assetList,
int  assetID 
)
inlinestatic

Checks if a list of assets contains an asset with a specified ID.

Returns
true if an asset matches the specified ID.
Parameters
assetListThe list of assets to search.
assetIDThe ID to search for.
Template Parameters
TThe type of asset.
Type Constraints
T :Asset 

◆ ContainsName< T >()

static bool PixelCrushers.DialogueSystem.DialogueDatabase.ContainsName< T > ( List< T >  assetList,
string  assetName 
)
inlinestatic

Checks if a list of assets contains an asset with a specified name.

Returns
true if an asset matches the specified name.
Parameters
assetListThe list of assets to search.
assetNameThe name to search for.
Template Parameters
TThe type of asset.
Type Constraints
T :Asset 

◆ ContainsTitle()

static bool PixelCrushers.DialogueSystem.DialogueDatabase.ContainsTitle ( List< Conversation conversations,
string  title 
)
inlinestatic

Checks is a list of conversations contains a conversation with a specified title.

Returns
true if the title is found.
Parameters
conversationsThe conversations to search.
titleThe title to search for.

◆ GetActor() [1/2]

Actor PixelCrushers.DialogueSystem.DialogueDatabase.GetActor ( int  id)
inline

Gets the actor associated with an actor ID.

Returns
The actor.
Parameters
idThe actor ID.

◆ GetActor() [2/2]

Actor PixelCrushers.DialogueSystem.DialogueDatabase.GetActor ( string  actorName)
inline

Gets the actor by name.

Returns
The actor.
Parameters
actorNameThe actor's name (the value of the Name field).

◆ GetCharacterType()

CharacterType PixelCrushers.DialogueSystem.DialogueDatabase.GetCharacterType ( int  actorID)
inline

Gets the type of the character (PC or NPC) of an actor based on the actor's IsPlayer value.

Returns
The character type (PC or NPC)
Parameters
actorIDThe Actor ID to check.

◆ GetConversation() [1/2]

Conversation PixelCrushers.DialogueSystem.DialogueDatabase.GetConversation ( int  conversationID)
inline

Retrieves a Conversation by its ID.

Returns
The conversation with the specified ID.
Parameters
conversationIDThe Conversation ID.

◆ GetConversation() [2/2]

Conversation PixelCrushers.DialogueSystem.DialogueDatabase.GetConversation ( string  conversationTitle)
inline

Retrieves a Conversation by its Title field.

Returns
The conversation matching the specified title.
Parameters
conversationTitleThe title of the conversation.

◆ GetCustomEntrytagDelegate()

delegate string PixelCrushers.DialogueSystem.DialogueDatabase.GetCustomEntrytagDelegate ( Conversation  conversation,
DialogueEntry  entry 
)

◆ GetDialogueEntry() [1/2]

DialogueEntry PixelCrushers.DialogueSystem.DialogueDatabase.GetDialogueEntry ( int  conversationID,
int  dialogueEntryID 
)
inline

Gets a dialogue entry by its conversation and dialogue entry IDs.

Returns
The dialogue entry.
Parameters
conversationIDConversation ID.
dialogueEntryIDDialogue entry ID.

◆ GetDialogueEntry() [2/2]

DialogueEntry PixelCrushers.DialogueSystem.DialogueDatabase.GetDialogueEntry ( Link  link)
inline

Follows a Link and returns the destination DialogueEntry.

Returns
The dialogue entry that the link points to.
Parameters
linkThe link to follow.

◆ GetEntrytag() [1/2]

string PixelCrushers.DialogueSystem.DialogueDatabase.GetEntrytag ( Conversation  conversation,
DialogueEntry  entry,
EntrytagFormat  entrytagFormat 
)
inline

Gets the entrytag string of a dialogue entry.

Parameters
conversationDialogue entry's conversation.
entryDialogue entry.
entrytagFormatEntrytag format.
Returns
Entrytag.

◆ GetEntrytag() [2/2]

string PixelCrushers.DialogueSystem.DialogueDatabase.GetEntrytag ( int  conversationID,
int  dialogueEntryID,
EntrytagFormat  entrytagFormat 
)
inline

Gets the entrytag string of a dialogue entry.

Parameters
conversationIDDialogue entry's conversation.
dialogueEntryIDDialogue entry.
entrytagFormatEntrytag format.
Returns
Entrytag.

◆ GetEntrytaglocal() [1/2]

string PixelCrushers.DialogueSystem.DialogueDatabase.GetEntrytaglocal ( Conversation  conversation,
DialogueEntry  entry,
EntrytagFormat  entrytagFormat 
)
inline

Gets the entrytaglocal string (localized version) of a dialogue entry.

Parameters
conversationDialogue entry's conversation.
entryDialogue entry.
entrytagFormatEntrytag format.
Returns
Localized entrytag.

◆ GetEntrytaglocal() [2/2]

string PixelCrushers.DialogueSystem.DialogueDatabase.GetEntrytaglocal ( int  conversationID,
int  dialogueEntryID,
EntrytagFormat  entrytagFormat 
)
inline

Gets the entrytaglocal string (localized version) of a dialogue entry.

Parameters
conversationIDDialogue entry's conversation.
dialogueEntryIDDialogue entry.
entrytagFormatEntrytag format.
Returns
Localized entrytag.

◆ GetItem() [1/2]

Item PixelCrushers.DialogueSystem.DialogueDatabase.GetItem ( int  id)
inline

Gets the item associated with an item ID.

Returns
The item.
Parameters
idThe item ID.

◆ GetItem() [2/2]

Item PixelCrushers.DialogueSystem.DialogueDatabase.GetItem ( string  itemName)
inline

Gets the item by name.

Returns
The item.
Parameters
itemNameThe item's name (the value of the Name field).

◆ GetLinkText()

string PixelCrushers.DialogueSystem.DialogueDatabase.GetLinkText ( Link  link)
inline

Gets the text of the dialogue entry that a link points to.

Returns
The text of the link's destination dialogue entry, or null if the link is invalid.
Parameters
linkThe link to follow.

◆ GetLocation() [1/2]

Location PixelCrushers.DialogueSystem.DialogueDatabase.GetLocation ( int  id)
inline

Gets the location associated with a location ID.

Returns
The location.
Parameters
idThe location ID.

◆ GetLocation() [2/2]

Location PixelCrushers.DialogueSystem.DialogueDatabase.GetLocation ( string  locationName)
inline

Gets the location by name.

Returns
The location.
Parameters
locationNameThe location's name (value of the Name field).

◆ GetVariable() [1/2]

Variable PixelCrushers.DialogueSystem.DialogueDatabase.GetVariable ( int  id)
inline

Gets the variable by ID.

Returns
The variable.
Parameters
idID.

◆ GetVariable() [2/2]

Variable PixelCrushers.DialogueSystem.DialogueDatabase.GetVariable ( string  variableName)
inline

Gets the variable by name.

Returns
The variable.
Parameters
variableNameVariable name.

◆ IsPlayer()

bool PixelCrushers.DialogueSystem.DialogueDatabase.IsPlayer ( string  actorName)
inline

Determines whether an actor is a player character.

Returns
true if the named actor is a player; otherwise, false.
Parameters
actorNameActor name in the database.

◆ IsPlayerID()

bool PixelCrushers.DialogueSystem.DialogueDatabase.IsPlayerID ( int  actorID)
inline

Determines whether an actor is a player character.

Returns
true if actorID is the ID of a player; otherwise, false.
Parameters
actorIDAn actor ID.

◆ Remove() [1/2]

void PixelCrushers.DialogueSystem.DialogueDatabase.Remove ( DialogueDatabase  database)
inline

Removes from this database all content that's in the specified database.

Parameters
databaseThe database containing assets to remove from this database.

◆ Remove() [2/2]

void PixelCrushers.DialogueSystem.DialogueDatabase.Remove ( DialogueDatabase  database,
List< DialogueDatabase keep 
)
inline

Removes from this database all content that's in the specified database.

Parameters
databaseThe database containing assets to remove from this database.
keepList of databases containing items that should be kept.

◆ ResetCache()

void PixelCrushers.DialogueSystem.DialogueDatabase.ResetCache ( )
inline

Dialogue databases maintain a quick lookup cache of assets by Name (by Title for conversations).

If you change asset Names/Titles manually, call this method to sync the cache with the new values.

◆ ResetEmphasisSettings()

void PixelCrushers.DialogueSystem.DialogueDatabase.ResetEmphasisSettings ( )
inline

◆ SyncActors()

void PixelCrushers.DialogueSystem.DialogueDatabase.SyncActors ( )
inline

Syncs the actors from syncInfo.syncActorsDatabase.

◆ SyncAll()

void PixelCrushers.DialogueSystem.DialogueDatabase.SyncAll ( )
inline

Syncs all assets from their source databases if assigned in syncInfo.

◆ SyncItems()

void PixelCrushers.DialogueSystem.DialogueDatabase.SyncItems ( )
inline

Syncs the items from syncInfo.syncItemsDatabase.

◆ SyncLocations()

void PixelCrushers.DialogueSystem.DialogueDatabase.SyncLocations ( )
inline

Syncs the locations from syncInfo.syncLocationsDatabase.

◆ SyncVariables()

void PixelCrushers.DialogueSystem.DialogueDatabase.SyncVariables ( )
inline

Syncs the variables from syncInfo.syncVariablesDatabase.

Member Data Documentation

◆ actors

List<Actor> PixelCrushers.DialogueSystem.DialogueDatabase.actors = new List<Actor>()

The actors in the database.

◆ author

string PixelCrushers.DialogueSystem.DialogueDatabase.author

The author, typically only used internally by the developer.

◆ baseID

int PixelCrushers.DialogueSystem.DialogueDatabase.baseID = 1

Assign IDs of assets (actors, items, conversations, etc.) from this base value.

Useful for multiple databases.

◆ conversations

List<Conversation> PixelCrushers.DialogueSystem.DialogueDatabase.conversations = new List<Conversation>()

The conversations in the database.

◆ description

string PixelCrushers.DialogueSystem.DialogueDatabase.description

The description of the database, typically only used internally by the developer.

◆ emphasisSettings

EmphasisSetting [] PixelCrushers.DialogueSystem.DialogueDatabase.emphasisSettings = new EmphasisSetting[NumEmphasisSettings]

A Chat Mapper project defines four emphasis settings (text styles) for formatting lines of dialogue.

This array contains those emphasis settings.

◆ getCustomEntrytag

GetCustomEntrytagDelegate PixelCrushers.DialogueSystem.DialogueDatabase.getCustomEntrytag = null
static

◆ globalUserScript

string PixelCrushers.DialogueSystem.DialogueDatabase.globalUserScript

The global Lua user script.

◆ InvalidEntrytag

const string PixelCrushers.DialogueSystem.DialogueDatabase.InvalidEntrytag = "invalid_entrytag"
static

◆ items

List<Item> PixelCrushers.DialogueSystem.DialogueDatabase.items = new List<Item>()

The items in the database.

You can use these to track in-game items, or to track quests using the QuestLog class.

◆ locations

List<Location> PixelCrushers.DialogueSystem.DialogueDatabase.locations = new List<Location>()

The locations in the database.

◆ NumEmphasisSettings

const int PixelCrushers.DialogueSystem.DialogueDatabase.NumEmphasisSettings = 4
static

The number of emphasis settings supported by Chat Mapper and the Dialogue System.

◆ syncInfo

SyncInfo PixelCrushers.DialogueSystem.DialogueDatabase.syncInfo = new SyncInfo()

◆ templateJson

string PixelCrushers.DialogueSystem.DialogueDatabase.templateJson = string.Empty

Each database now stores a copy of its template.

◆ variables

List<Variable> PixelCrushers.DialogueSystem.DialogueDatabase.variables = new List<Variable>()

The variables in the database.

◆ version

string PixelCrushers.DialogueSystem.DialogueDatabase.version

The version of the database, typically only used internally by the developer.

◆ VoiceOverFileFieldName

const string PixelCrushers.DialogueSystem.DialogueDatabase.VoiceOverFileFieldName = DialogueSystemFields.VoiceOverFile
static

Property Documentation

◆ playerID

int PixelCrushers.DialogueSystem.DialogueDatabase.playerID
get

Gets the ID of the first player character in the actor list.

The player ID.


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