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

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. More...
 
static bool ContainsID< T > (List< T > assetList, int assetID)
 Checks if a list of assets contains an asset with a specified ID. More...
 
static bool ContainsTitle (List< Conversation > conversations, string title)
 Checks is a list of conversations contains a conversation with a specified title. More...
 
static bool Contains (DialogueDatabase database, Asset asset)
 Checks if a database contains an asset. More...
 
static bool Contains (List< DialogueDatabase > databaseList, Asset asset)
 Checks if a list of databases contains an asset. More...
 

Public Attributes

string version
 The version of the database, typically only used internally by the developer. More...
 
string author
 The author, typically only used internally by the developer. More...
 
string description
 The description of the database, typically only used internally by the developer. More...
 
string globalUserScript
 The global Lua user script. More...
 
EmphasisSetting[] emphasisSettings = new EmphasisSetting[NumEmphasisSettings]
 A Chat Mapper project defines four emphasis settings (text styles) for formatting lines of dialogue. More...
 
List< Actoractors = new List<Actor>()
 The actors in the database. More...
 
List< Itemitems = new List<Item>()
 The items in the database. More...
 
List< Locationlocations = new List<Location>()
 The locations in the database. More...
 
List< Variablevariables = new List<Variable>()
 The variables in the database. More...
 
List< Conversationconversations = new List<Conversation>()
 The conversations in the database. More...
 
SyncInfo syncInfo = new SyncInfo()
 

Static Public Attributes

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

Properties

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

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)

Add the contents of another database to this database.

Parameters
databaseThe database to copy.

◆ AddConversation()

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

Adds a Conversation to the database.

Parameters
conversationThe conversation to add.

◆ Clear()

void PixelCrushers.DialogueSystem.DialogueDatabase.Clear ( )

Removes all assets from this database.

◆ Contains() [1/2]

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

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 
)
static

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 
)
static

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 
)
static

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 
)
static

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)

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)

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)

Gets the type of the character (PC or NPC) of an actor.

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

The comparison is based on the value of playerID, not the actor's IsPlayer field. If more than one actor's IsPlayer field is true, this will only identify the first one.

◆ GetConversation() [1/2]

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

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)

Retrieves a Conversation by its Title field.

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

◆ GetDialogueEntry() [1/2]

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

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)

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 
)

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 
)

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 
)

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 
)

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)

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)

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)

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)

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)

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)

Gets the variable by ID.

Returns
The variable.
Parameters
idID.

◆ GetVariable() [2/2]

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

Gets the variable by name.

Returns
The variable.
Parameters
variableNameVariable name.

◆ IsPlayer()

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

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)

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)

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 
)

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 ( )

◆ ResetEmphasisSettings()

void PixelCrushers.DialogueSystem.DialogueDatabase.ResetEmphasisSettings ( )

◆ SyncActors()

void PixelCrushers.DialogueSystem.DialogueDatabase.SyncActors ( )

Syncs the actors from syncInfo.syncActorsDatabase.

◆ SyncAll()

void PixelCrushers.DialogueSystem.DialogueDatabase.SyncAll ( )

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

◆ SyncItems()

void PixelCrushers.DialogueSystem.DialogueDatabase.SyncItems ( )

Syncs the items from syncInfo.syncItemsDatabase.

◆ SyncLocations()

void PixelCrushers.DialogueSystem.DialogueDatabase.SyncLocations ( )

Syncs the locations from syncInfo.syncLocationsDatabase.

◆ SyncVariables()

void PixelCrushers.DialogueSystem.DialogueDatabase.SyncVariables ( )

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.

◆ 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.

◆ 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()

◆ 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 = "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: