A dialogue database asset. More...
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< Actor > | actors = new List<Actor>() |
The actors in the database. | |
List< Item > | items = new List<Item>() |
The items in the database. | |
List< Location > | locations = new List<Location>() |
The locations in the database. | |
List< Variable > | variables = new List<Variable>() |
The variables in the database. | |
List< Conversation > | conversations = 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. | |
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.
|
inline |
Add the contents of another database to this database.
database | The database to copy. |
|
inline |
Adds a Conversation to the database.
conversation | The conversation to add. |
|
inline |
Removes all assets from this database.
|
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.
database | The database to search. |
asset | The asset to search for. |
|
inlinestatic |
Checks if a list of databases contains an asset.
databaseList | The list of databases to check. |
asset | The asset to search for. |
|
inlinestatic |
Checks if a list of assets contains an asset with a specified ID.
true
if an asset matches the specified ID. assetList | The list of assets to search. |
assetID | The ID to search for. |
T | The type of asset. |
T | : | Asset |
|
inlinestatic |
Checks if a list of assets contains an asset with a specified name.
true
if an asset matches the specified name. assetList | The list of assets to search. |
assetName | The name to search for. |
T | The type of asset. |
T | : | Asset |
|
inlinestatic |
Checks is a list of conversations contains a conversation with a specified title.
true
if the title is found. conversations | The conversations to search. |
title | The title to search for. |
|
inline |
Gets the actor associated with an actor ID.
id | The actor ID. |
|
inline |
Gets the actor by name.
actorName | The actor's name (the value of the Name field). |
|
inline |
Gets the type of the character (PC or NPC) of an actor based on the actor's IsPlayer value.
actorID | The Actor ID to check. |
|
inline |
Retrieves a Conversation by its ID.
conversationID | The Conversation ID. |
|
inline |
Retrieves a Conversation by its Title field.
conversationTitle | The title of the conversation. |
delegate string PixelCrushers.DialogueSystem.DialogueDatabase.GetCustomEntrytagDelegate | ( | Conversation | conversation, |
DialogueEntry | entry | ||
) |
|
inline |
Gets a dialogue entry by its conversation and dialogue entry IDs.
conversationID | Conversation ID. |
dialogueEntryID | Dialogue entry ID. |
|
inline |
Follows a Link and returns the destination DialogueEntry.
link | The link to follow. |
|
inline |
Gets the entrytag string of a dialogue entry.
conversation | Dialogue entry's conversation. |
entry | Dialogue entry. |
entrytagFormat | Entrytag format. |
|
inline |
Gets the entrytag string of a dialogue entry.
conversationID | Dialogue entry's conversation. |
dialogueEntryID | Dialogue entry. |
entrytagFormat | Entrytag format. |
|
inline |
Gets the entrytaglocal string (localized version) of a dialogue entry.
conversation | Dialogue entry's conversation. |
entry | Dialogue entry. |
entrytagFormat | Entrytag format. |
|
inline |
Gets the entrytaglocal string (localized version) of a dialogue entry.
conversationID | Dialogue entry's conversation. |
dialogueEntryID | Dialogue entry. |
entrytagFormat | Entrytag format. |
|
inline |
Gets the item associated with an item ID.
id | The item ID. |
|
inline |
Gets the item by name.
itemName | The item's name (the value of the Name field). |
|
inline |
Gets the text of the dialogue entry that a link points to.
null
if the link is invalid. link | The link to follow. |
|
inline |
Gets the location associated with a location ID.
id | The location ID. |
|
inline |
Gets the location by name.
locationName | The location's name (value of the Name field). |
|
inline |
Gets the variable by ID.
id | ID. |
|
inline |
Gets the variable by name.
variableName | Variable name. |
|
inline |
Determines whether an actor is a player character.
true
if the named actor is a player; otherwise, false
.actorName | Actor name in the database. |
|
inline |
Determines whether an actor is a player character.
true
if actorID is the ID of a player; otherwise, false
. actorID | An actor ID. |
|
inline |
Removes from this database all content that's in the specified database.
database | The database containing assets to remove from this database. |
|
inline |
Removes from this database all content that's in the specified database.
database | The database containing assets to remove from this database. |
keep | List of databases containing items that should be kept. |
|
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.
|
inline |
|
inline |
Syncs the actors from syncInfo.syncActorsDatabase.
|
inline |
Syncs all assets from their source databases if assigned in syncInfo.
|
inline |
Syncs the items from syncInfo.syncItemsDatabase.
|
inline |
Syncs the locations from syncInfo.syncLocationsDatabase.
|
inline |
Syncs the variables from syncInfo.syncVariablesDatabase.
The actors in the database.
string PixelCrushers.DialogueSystem.DialogueDatabase.author |
The author, typically only used internally by the developer.
int PixelCrushers.DialogueSystem.DialogueDatabase.baseID = 1 |
Assign IDs of assets (actors, items, conversations, etc.) from this base value.
Useful for multiple databases.
List<Conversation> PixelCrushers.DialogueSystem.DialogueDatabase.conversations = new List<Conversation>() |
The conversations in the database.
string PixelCrushers.DialogueSystem.DialogueDatabase.description |
The description of the database, typically only used internally by the developer.
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.
|
static |
string PixelCrushers.DialogueSystem.DialogueDatabase.globalUserScript |
The global Lua user script.
|
static |
The items in the database.
You can use these to track in-game items, or to track quests using the QuestLog class.
The locations in the database.
|
static |
The number of emphasis settings supported by Chat Mapper and the Dialogue System.
string PixelCrushers.DialogueSystem.DialogueDatabase.templateJson = string.Empty |
Each database now stores a copy of its template.
The variables in the database.
string PixelCrushers.DialogueSystem.DialogueDatabase.version |
The version of the database, typically only used internally by the developer.
|
static |
|
get |
Gets the ID of the first player character in the actor list.
The player ID.