A static class that adds additional Chat Mapper-related functionality to the Lua environment, since Chat Mapper projects can define conditions and actions in Lua, modify Lua variables, and use Chat Mapper-specific Lua functions. More...
Static Public Member Functions | |
static void | InitializeChatMapperVariables () |
Initializes the Chat Mapper tables. More... | |
static void | AddChatMapperVariables (DialogueDatabase database, List< DialogueDatabase > loadedDatabases) |
Adds the assets defined in a DialogueDatabase to the Chat Mapper tables. More... | |
static void | RemoveChatMapperVariables (DialogueDatabase database, List< DialogueDatabase > loadedDatabases) |
Removes the assets defined in a DialogueDatabase from the Chat Mapper tables. More... | |
static void | SetParticipants (string actorName, string conversantName, string actorIndex=null, string conversantIndex=null) |
Sets the conversation participant name variables (Variable['Actor'] and Variable['Conversant']) and, optionally, participant indices in Actor table. More... | |
static string | GetSimStatus (DialogueEntry dialogueEntry) |
Returns the SimStatus of a dialogue entry, or a blank string if Include Sim Status isn't ticked. More... | |
static string | GetSimStatus (int conversationID, int entryID) |
Returns the SimStatus of a dialogue entry, or a blank string if Include Sim Status isn't ticked. More... | |
static void | MarkDialogueEntryUntouched (DialogueEntry dialogueEntry) |
Marks a dialogue entry as untouched, by setting the Lua variable Conversation[#].Dialog[#].SimStatus="Untouched" , where # is the conversation and/or dialogue entry ID. More... | |
static void | MarkDialogueEntryDisplayed (DialogueEntry dialogueEntry) |
Marks a dialogue entry as displayed, by setting the Lua variable Conversation[#].Dialog[#].SimStatus="WasDisplayed" , where # is the conversation and/or dialogue entry ID. More... | |
static void | MarkDialogueEntryOffered (DialogueEntry dialogueEntry) |
Marks a dialogue entry as offered, by setting the Lua variable Conversation[#].Dialog[#].SimStatus="WasOffered" , where # is the conversation and/or dialogue entry ID. More... | |
static void | MarkDialogueEntry (DialogueEntry dialogueEntry, string status) |
Marks a dialogue entry with a status such as "WasOffered". More... | |
static void | AddToConversationTable (List< Conversation > conversations, List< DialogueDatabase > loadedDatabases, bool addRaw=false) |
static LuaTable | AddToConversationTable (LuaTable conversationTable, Conversation conversation, bool addRaw=false) |
static string | FieldValueAsString (Field field) |
Returns a field's value as a string for use in Lua. More... | |
static string | ValueAsString (FieldType fieldType, string fieldValue) |
Returns a Chat Mapper value as a string for use in Lua. More... | |
static string | RandomElement (string list) |
Returns a random element in a list. More... | |
static string | GetLocalizedText (string tableName, string elementName, string fieldName) |
Gets the localized text for a field in a table element. More... | |
static string | GetStatus (LuaTable asset1, LuaTable asset2) |
Chat Mapper function. More... | |
static void | SetStatus (LuaTable asset1, LuaTable asset2, string statusValue) |
Chat Mapper function. More... | |
static float | GetRelationship (LuaTable actor1, LuaTable actor2, string relationshipType) |
Chat Mapper function. More... | |
static void | SetRelationship (LuaTable actor1, LuaTable actor2, string relationshipType, float value) |
Chat Mapper function. More... | |
static void | IncRelationship (LuaTable actor1, LuaTable actor2, string relationshipType, float incrementAmount) |
Chat Mapper function. More... | |
static void | DecRelationship (LuaTable actor1, LuaTable actor2, string relationshipType, float decrementAmount) |
Chat Mapper function. More... | |
static string | GetStatusTableAsLua () |
Gets the Lua commands necessary to rebuild the status table. More... | |
static string | GetRelationshipTableAsLua () |
Gets the Lua commands necessary to rebuild the relationship table. More... | |
static void | RefreshStatusTableFromLua () |
static void | RefreshRelationshipTableFromLua () |
static string | DoubleQuotesToSingle (string s) |
Replaces all double-quotes with escaped double-quotes, newlines with escapes newlines, and removes carriage returns. More... | |
static string | SpacesToUnderscores (string s) |
Replaces all spaces with underscores. More... | |
static string | StringToTableIndex (string s) |
Returns the version of a string usable as the index to a Chat Mapper table. More... | |
static string | StringToLocalizedTableIndex (string s) |
Returns a StringToTableIndex() value after adding the current language code to the end of s. More... | |
static bool | DoesTableElementExist (string table, string element) |
Checks if a table element exists. More... | |
static Lua.Result | GetTableField (string table, string element, string field) |
Gets the value of a field in a Lua table element. More... | |
static void | SetTableField (string table, string element, string field, object value) |
Sets the value of a field in a Lua table element. More... | |
static Lua.Result | GetActorField (string actor, string field) |
Gets the value of a field in the Lua Actor table. More... | |
static void | SetActorField (string actor, string field, object value) |
Sets the value of a field in the Lua Actor table. More... | |
static Lua.Result | GetItemField (string item, string field) |
Gets the value of a field in the Lua Item table. More... | |
static void | SetItemField (string item, string field, object value) |
Sets the value of a field in the Lua Item table. More... | |
static Lua.Result | GetQuestField (string quest, string field) |
Gets the value of a field in the Lua Quest table, which is an alias for the Item table. More... | |
static void | SetQuestField (string quest, string field, object value) |
Sets the value of a field in the Lua Quest table, which is an alias for the Item table. More... | |
static Lua.Result | GetLocationField (string location, string field) |
Gets the value of a field in the Lua Location table. More... | |
static void | SetLocationField (string location, string field, object value) |
Sets the value of a field in the Lua Location table. More... | |
static bool | DoesVariableExist (string variable) |
Checks if a variable exists in the Lua Variable table. More... | |
static Lua.Result | GetVariable (string variable) |
Gets the value of a variable in the Lua Variable table. More... | |
static void | SetVariable (string variable, object value) |
Sets the value of a variable in the Lua Variable table. More... | |
static Lua.Result | GetLocalizedTableField (string table, string element, string field) |
Gets the value of a localized field in a Lua table element. More... | |
static void | SetLocalizedTableField (string table, string element, string field, object value) |
Sets the value of a localized field in a Lua table element. More... | |
static Lua.Result | GetLocalizedActorField (string actor, string field) |
Gets the value of a localized field in the Lua Actor table. More... | |
static void | SetLocalizedActorField (string actor, string field, object value) |
Sets the value of a localized field in the Lua Actor table. More... | |
static Lua.Result | GetLocalizedItemField (string item, string field) |
Gets the value of a localized field in the Lua Item table. More... | |
static void | SetLocalizedItemField (string item, string field, object value) |
Sets the value of a localized field in the Lua Item table. More... | |
static Lua.Result | GetLocalizedQuestField (string quest, string field) |
Gets the value of a localized field in the Lua Quest table, which is an alias for the Item table. More... | |
static void | SetLocalizedQuestField (string quest, string field, object value) |
Sets the value of a localized field in the Lua Quest table, which is an alias for the Item table. More... | |
static Lua.Result | GetLocalizedLocationField (string location, string field) |
Gets the value of a localized field in the Lua Location table. More... | |
static void | SetLocalizedLocationField (string location, string field, object value) |
Sets the value of a localized field in the Lua Location table. More... | |
static Lua.Result | GetConversationField (int conversationID, string field) |
Gets the value of a conversation field. More... | |
static Lua.Result | GetLocalizedConversationField (int conversationID, string field) |
Gets the value of a conversation field. More... | |
Static Public Attributes | |
const string | SimStatus = "SimStatus" |
const string | Untouched = "Untouched" |
const string | WasDisplayed = "WasDisplayed" |
const string | WasOffered = "WasOffered" |
static bool | includeSimStatus = true |
Gets or sets a value indicating whether to record SimStatus in the Lua environment. More... | |
A static class that adds additional Chat Mapper-related functionality to the Lua environment, since Chat Mapper projects can define conditions and actions in Lua, modify Lua variables, and use Chat Mapper-specific Lua functions.
For speed, this class occasionally bypasses the Lua wrapper class and works directly with the underlying Lua implementation, Lua Interpreter.
|
static |
Adds the assets defined in a DialogueDatabase to the Chat Mapper tables.
Doesn't add assets that are contained in loadedDatabases. Runs the global user script if defined.
database | The DialogueDatabase containing assets to add. |
loadedDatabases | List of databases that have already been loaded and added to Lua. |
|
static |
|
static |
|
static |
Chat Mapper function.
See the online Chat Mapper manual for more details: http://www.chatmapper.com
Syntax:
|
static |
Checks if a table element exists.
true
, if the table entry exists, false
otherwise.table | Table name (e.g., "Actor"). |
element | Element name (e.g., "Player"). |
|
static |
|
static |
Replaces all double-quotes with escaped double-quotes, newlines with escapes newlines, and removes carriage returns.
This utility function is used to pre-process strings before inserting them in Lua commands to help prevent syntax errors. Note:: This method previously replaced all double-quotes with single-quotes. The same method name was kept to prevent any customer code that uses it from breaking.
s | The original string. |
|
static |
Returns a field's value as a string for use in Lua.
If it's a numeric field, the string will just contain the number. If it's a Boolean, it will be true or false (lowercase). Otherwise it will be a string enclosed in double-quotes, with any internal double quotes converted to single quotes.
field | The field. |
|
static |
Gets the value of a field in the Lua Actor table.
.AsString
, .AsBool
, etc., to it.actor | Actor name. |
field | Name of the field in the actor element. |
|
static |
Gets the value of a conversation field.
conversationID | Conversation ID. |
field | Field name. |
|
static |
Gets the value of a field in the Lua Item table.
.AsString
, .AsBool
, etc., to it.item | Item/quest name. |
field | Name of the field in the item element. |
|
static |
Gets the value of a localized field in the Lua Actor table.
.AsString
, .AsBool
, etc., to it.actor | Actor name. |
field | Base name (non-localized) of the field in the actor element. |
|
static |
Gets the value of a conversation field.
conversationID | Conversation ID. |
field | Base name (non-localized) of the field in the location element. |
|
static |
Gets the value of a localized field in the Lua Item table.
.AsString
, .AsBool
, etc., to it.item | Item/quest name. |
field | Base name (non-localized) of the field in the item element. |
|
static |
Gets the value of a localized field in the Lua Location table.
.AsString
, .AsBool
, etc., to it.location | Location name. |
field | Base name (non-localized) of the field in the location element. |
|
static |
Gets the value of a localized field in the Lua Quest table, which is an alias for the Item table.
.AsString
, .AsBool
, etc., to it.quest | Quest name. |
field | Base name (non-localized) of the field. |
|
static |
Gets the value of a localized field in a Lua table element.
.AsString
, .AsBool
, etc., to it.table | Table name. |
element | Name of an element in the table. |
field | The base name (non-localized) of a field in the element. |
|
static |
Gets the localized text for a field in a table element.
tableName | Table name. |
elementName | Element name. |
fieldName | Field name. |
|
static |
Gets the value of a field in the Lua Location table.
.AsString
, .AsBool
, etc., to it.location | Location name. |
field | Name of the field in the location element. |
|
static |
Gets the value of a field in the Lua Quest table, which is an alias for the Item table.
.AsString
, .AsBool
, etc., to it.quest | Quest name. |
field | Name of the field. |
|
static |
Chat Mapper function.
See the online Chat Mapper manual for more details: http://www.chatmapper.com
Syntax:
|
static |
|
static |
Returns the SimStatus of a dialogue entry, or a blank string if Include Sim Status isn't ticked.
|
static |
Returns the SimStatus of a dialogue entry, or a blank string if Include Sim Status isn't ticked.
|
static |
Chat Mapper function.
See the online Chat Mapper manual for more details: http://www.chatmapper.com
Syntax:
|
static |
|
static |
Gets the value of a field in a Lua table element.
.AsString
, .AsBool
, etc., to it.table | Table name. |
element | Name of an element in the table. |
field | Name of a field in the element. |
|
static |
Gets the value of a variable in the Lua Variable table.
.AsString
, .AsBool
, etc., to it.variable | Variable name. |
|
static |
Chat Mapper function.
See the online Chat Mapper manual for more details: http://www.chatmapper.com
Syntax:
|
static |
Initializes the Chat Mapper tables.
|
static |
Marks a dialogue entry with a status such as "WasOffered".
Typically you will use the more-specific functions MarkDialogueEntryDisplayed, MarkDialogueEntryOffered, and MarkDialogueEntryUntouched instead of this method.
dialogueEntry | Dialogue entry to mark |
status | Mark entry with this status ("Untouched", "WasOffered", or "WasDisplayed") |
|
static |
Marks a dialogue entry as displayed, by setting the Lua variable Conversation[#].Dialog[#].SimStatus="WasDisplayed"
, where #
is the conversation and/or dialogue entry ID.
The ConversationModel marks entries displayed when they are used in a conversation.
dialogueEntry | Dialogue entry to mark. |
|
static |
Marks a dialogue entry as offered, by setting the Lua variable Conversation[#].Dialog[#].SimStatus="WasOffered"
, where #
is the conversation and/or dialogue entry ID.
If the value is already "WasDisplayed", this method leaves it as "WasDisplayed". The ConversationModel marks entries as offered when they are presented to the player as a response option.
dialogueEntry | Dialogue entry to mark. |
|
static |
Marks a dialogue entry as untouched, by setting the Lua variable Conversation[#].Dialog[#].SimStatus="Untouched"
, where #
is the conversation and/or dialogue entry ID.
The ConversationModel marks entries displayed when they are used in a conversation.
dialogueEntry | Dialogue entry to mark. |
|
static |
Returns a random element in a list.
The list is defined in a string.
args | An array of one LuaValue which is a string with elements separated by the horizontal bar character ('|'). |
|
static |
|
static |
|
static |
Removes the assets defined in a DialogueDatabase from the Chat Mapper tables.
Doesn't remove any assets that are contains in loadedDatabases.
database | A DialogueDatabase containing assets to remove. |
loadedDatabases | List of databases containing items that should be kept in Lua. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Sets the value of a localized field in a Lua table element.
table | Table name. |
element | Name of an element in the table. |
field | Base name (non-localized) of a field in the element. |
value | The value to set the field to. |
|
static |
|
static |
|
static |
|
static |
Chat Mapper function.
See the online Chat Mapper manual for more details: http://www.chatmapper.com
Syntax:
|
static |
Chat Mapper function.
See the online Chat Mapper manual for more details: http://www.chatmapper.com
Syntax:
|
static |
Sets the value of a field in a Lua table element.
table | Table name. |
element | Name of an element in the table. |
field | Name of a field in the element. |
value | The value to set the field to. |
|
static |
|
static |
Replaces all spaces with underscores.
s | The original string. |
|
static |
Returns a StringToTableIndex() value after adding the current language code to the end of s.
s | The original asset/field name. |
|
static |
Returns the version of a string usable as the index to a Chat Mapper table.
This utility function is used when looking up assets in tables to make it consistent with Chat Mapper. For example, if you have an actor named "Adam Birch", Chat Mapper creates a table entry Actor["Adam_Birch"]
(note the underscore).
s | The original asset/field name. |
|
static |
Returns a Chat Mapper value as a string for use in Lua.
If it's a numeric field, the string will just contain the number. If it's a Boolean, it will be true or false (lowercase). Otherwise it will be a string enclosed in double-quotes, with any internal double quotes converted to single quotes.
|
static |
Gets or sets a value indicating whether to record SimStatus in the Lua environment.
SimStatus comes from Chat Mapper, and is a way to remember whether a dialogue entry has been offered to the player ('WasOffered'), spoken by an actor ('WasDisplayed'), or neither ('Untouched'). If this information isn't useful in your project, you can disable it to save memory.
true
to include sim status; otherwise, false
.
|
static |
|
static |
|
static |
|
static |