Adventure Creator  1.68.4
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.Conversation Class Reference
Inheritance diagram for AC.Conversation:
AC.ITranslatable

Public Member Functions

void Interact ()
 
void Interact (ActionConversation actionConversation)
 Shows the Conversation's dialogue options. More...
 
void TurnOn ()
 
bool IsActive (bool includeResponses)
 Checks if the Conversation is currently active. More...
 
void TurnOff ()
 
void RunOption (int slot, bool force=false)
 Runs a dialogue option. More...
 
float GetTimeRemaining ()
 Gets the time remaining before a timed Conversation ends. More...
 
string GetOptionName (int slot)
 Gets the display label of a dialogue option. More...
 
CursorIconBase GetOptionIcon (int slot)
 Gets the display icon of a dialogue option. More...
 
ButtonDialog GetOption (int slot)
 Gets the ButtonDialog data container, which stores data for a dialogue option. More...
 
ButtonDialog GetOptionWithID (int id)
 Gets the ButtonDialog data container with a given ID number, which stores data for a dialogue option. More...
 
bool OptionHasBeenChosen (int slot)
 Checks if a dialogue option has been chosen at least once by the player. More...
 
void TurnOptionOn (int id)
 Turns a dialogue option on, provided that it is unlocked. More...
 
void TurnOptionOff (int id)
 Turns a dialogue option off, provided that it is unlocked. More...
 
void SetOptionState (int id, bool flag, bool isLocked)
 Sets the enabled and locked states of a dialogue option, provided that it is unlocked. More...
 
void RenameOption (int id, string newLabel, int newLineID)
 Renames a dialogue option. More...
 
int GetCount ()
 Gets the number of enabled dialogue options. More...
 
void Upgrade ()
 
bool ConvertLocalVariableToGlobal (int oldLocalID, int newGlobalID)
 Converts the Conversations's references from a given local variable to a given global variable More...
 
int GetVariableReferences (VariableLocation location, int varID)
 Gets the number of references to a given local or global variable More...
 
int GetInventoryReferences (int itemID)
 
bool ConvertGlobalVariableToLocal (int oldGlobalID, int newLocalID, bool isCorrectScene)
 Converts the Conversations's references from a given global variable to a given local variable More...
 
int [] GetIDArray ()
 
string GetTranslatableString (int index)
 
int GetTranslationID (int index)
 Gets the translation ID of a given text index. More...
 
int GetNumTranslatables ()
 Gets the maximum number of possible translatable texts. More...
 
bool HasExistingTranslation (int index)
 Checks if a given text index has already been assigned a unique translation ID. More...
 
void SetTranslationID (int index, int _lineID)
 Sets the translation ID of a given text index More...
 
string GetOwner ()
 Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element. More...
 
bool OwnerIsPlayer ()
 Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line. More...
 
AC_TextType GetTranslationType (int index)
 Gets the translation type of a given text index. More...
 
bool CanTranslate (int index)
 Checks if a given text index can and should be translated. More...
 

Public Attributes

AC.InteractionSource interactionSource
 
List< ButtonDialogoptions = new List<ButtonDialog>()
 
ButtonDialog selectedOption
 
int lastOption = -1
 
bool autoPlay = false
 
bool isTimed = false
 
float timer = 5f
 
int defaultOption = 0
 

Detailed Description

This component provides the player with a list of dialogue options that their character can say. Options are display in a MenuDialogList element, and will usually run a DialogueOption ActionList when clicked - unless overrided by the "Dialogue: Start conversation" Action that triggers it.

Member Function Documentation

◆ CanTranslate()

bool AC.Conversation.CanTranslate ( int  index)

Checks if a given text index can and should be translated.

Parameters
indexThe index of the translatable text
Returns
True if the text can and should be translated

Implements AC.ITranslatable.

◆ ConvertGlobalVariableToLocal()

bool AC.Conversation.ConvertGlobalVariableToLocal ( int  oldGlobalID,
int  newLocalID,
bool  isCorrectScene 
)

Converts the Conversations's references from a given global variable to a given local variable

Parameters
oldLocalIDThe ID number of the old global variable
newLocalIDThe ID number of the new local variable
Returns
True if the Action was amended

◆ ConvertLocalVariableToGlobal()

bool AC.Conversation.ConvertLocalVariableToGlobal ( int  oldLocalID,
int  newGlobalID 
)

Converts the Conversations's references from a given local variable to a given global variable

Parameters
oldLocalIDThe ID number of the old local variable
newGlobalIDThe ID number of the new global variable
Returns
True if the Action was amended

◆ GetCount()

int AC.Conversation.GetCount ( )

Gets the number of enabled dialogue options.

Returns
The number of enabled dialogue options

◆ GetIDArray()

int [] AC.Conversation.GetIDArray ( )

<summmary>Gets an array of ID numbers of existing ButtonDialog classes, so that a unique number can be generated.

Returns
Gets an array of ID numbers of existing ButtonDialog classes

◆ GetNumTranslatables()

int AC.Conversation.GetNumTranslatables ( )

Gets the maximum number of possible translatable texts.

Returns
The maximum number of possible translatable texts.

Implements AC.ITranslatable.

◆ GetOption()

ButtonDialog AC.Conversation.GetOption ( int  slot)

Gets the ButtonDialog data container, which stores data for a dialogue option.

Parameters
slotThe index number of the dialogue option to find
Returns
The ButtonDialog data container

◆ GetOptionIcon()

CursorIconBase AC.Conversation.GetOptionIcon ( int  slot)

Gets the display icon of a dialogue option.

Parameters
slotThe index number of the dialogue option to find
Returns
The display icon of the dialogue option

◆ GetOptionName()

string AC.Conversation.GetOptionName ( int  slot)

Gets the display label of a dialogue option.

Parameters
slotThe index number of the dialogue option to find
Returns
The display label of the dialogue option

◆ GetOptionWithID()

ButtonDialog AC.Conversation.GetOptionWithID ( int  id)

Gets the ButtonDialog data container with a given ID number, which stores data for a dialogue option.

Parameters
idThe ID number associated with the dialogue option to find
Returns
The ButtonDialog data container

◆ GetOwner()

string AC.Conversation.GetOwner ( )

Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element.

Returns
The name of the translatable text's owner.

Implements AC.ITranslatable.

◆ GetTimeRemaining()

float AC.Conversation.GetTimeRemaining ( )

Gets the time remaining before a timed Conversation ends.

Returns
The time remaining before a timed Conversation ends.

◆ GetTranslatableString()

string AC.Conversation.GetTranslatableString ( int  index)

ITranslatable implementation

Implements AC.ITranslatable.

◆ GetTranslationID()

int AC.Conversation.GetTranslationID ( int  index)

Gets the translation ID of a given text index.

Parameters
indexThe index of the translatable text
Returns
The translation ID of the text

Implements AC.ITranslatable.

◆ GetTranslationType()

AC_TextType AC.Conversation.GetTranslationType ( int  index)

Gets the translation type of a given text index.

Parameters
indexThe index of the translatable text
Returns
The translation type of a given text index.

Implements AC.ITranslatable.

◆ GetVariableReferences()

int AC.Conversation.GetVariableReferences ( VariableLocation  location,
int  varID 
)

Gets the number of references to a given local or global variable

Parameters
locationThe location of the variable (Global, Local)
varIDThe ID number of the variable
Returns
The number of references to the variable

◆ HasExistingTranslation()

bool AC.Conversation.HasExistingTranslation ( int  index)

Checks if a given text index has already been assigned a unique translation ID.

Parameters
indexThe index of the translatable text
Returns
True if the text has been assigned a unique translation ID

Implements AC.ITranslatable.

◆ Interact() [1/2]

void AC.Conversation.Interact ( )

Show the Conversation's dialogue options.

◆ Interact() [2/2]

void AC.Conversation.Interact ( ActionConversation  actionConversation)

Shows the Conversation's dialogue options.

Parameters
actionConversationThe "Dialogue: Start conversation" Action that calls this function. This is necessary when that Action overrides the Converstion's options.

◆ IsActive()

bool AC.Conversation.IsActive ( bool  includeResponses)

Checks if the Conversation is currently active.

Parameters
includeResponsesIf True, then the Conversation will be considered active if any of its dialogue option ActionLists are currently-running, as opposed to only when its options are displayed as choices on screen

True if the Conversation is active

◆ OptionHasBeenChosen()

bool AC.Conversation.OptionHasBeenChosen ( int  slot)

Checks if a dialogue option has been chosen at least once by the player.

Parameters
slotThe index number of the dialogue option to find
Returns
True if the dialogue option has been chosen at least once by the player.

◆ OwnerIsPlayer()

bool AC.Conversation.OwnerIsPlayer ( )

Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line.

Returns
True if the translatable text's owner is a Player.

Implements AC.ITranslatable.

◆ RenameOption()

void AC.Conversation.RenameOption ( int  id,
string  newLabel,
int  newLineID 
)

Renames a dialogue option.

Parameters
idThe ID number of the dialogue option to rename
newLabelThe new label text to give the dialogue option<param>
Parameters
newLindIDThe line ID number to give the dialogue option, as set by the Speech Manager

◆ RunOption()

void AC.Conversation.RunOption ( int  slot,
bool  force = false 
)

Runs a dialogue option.

Parameters
slotThe index number of the dialogue option to run
forceIf True, then the option will be run regardless of whether it's enabled or valid

◆ SetOptionState()

void AC.Conversation.SetOptionState ( int  id,
bool  flag,
bool  isLocked 
)

Sets the enabled and locked states of a dialogue option, provided that it is unlocked.

Parameters
idThe ID number of the dialogue option to change
flagThe "on/off" state to set the option
isLockedThe "locked/unlocked" state to set the option

◆ SetTranslationID()

void AC.Conversation.SetTranslationID ( int  index,
int  lineID 
)

Sets the translation ID of a given text index

Parameters
indexThe index of the translatable text
lineIDThe new translation ID to assign the translatable text

Implements AC.ITranslatable.

◆ TurnOff()

void AC.Conversation.TurnOff ( )

Hides the Conversation's dialogue options, if it is the currently-active Conversation.

◆ TurnOn()

void AC.Conversation.TurnOn ( )

Show the Conversation's dialogue options.

◆ TurnOptionOff()

void AC.Conversation.TurnOptionOff ( int  id)

Turns a dialogue option off, provided that it is unlocked.

Parameters
idThe ID number of the dialogue option to disable

◆ TurnOptionOn()

void AC.Conversation.TurnOptionOn ( int  id)

Turns a dialogue option on, provided that it is unlocked.

Parameters
idThe ID number of the dialogue option to enable

◆ Upgrade()

void AC.Conversation.Upgrade ( )

Upgrades the Conversation from a previous version of Adventure Creator.

Member Data Documentation

◆ autoPlay

bool AC.Conversation.autoPlay = false

If True, and only one option is available, then the option will be chosen automatically

◆ defaultOption

int AC.Conversation.defaultOption = 0

The index number of the option to select, if isTimed = True and the timer runs out before the player has made a choice. If -1, then the conversation will end

◆ interactionSource

AC.InteractionSource AC.Conversation.interactionSource

The source of the commands that are run when an option is chosen (InScene, AssetFile, CustomScript)

◆ isTimed

bool AC.Conversation.isTimed = false

If True, then the Conversation is timed, and the options will only be shown for a fixed period

◆ lastOption

int AC.Conversation.lastOption = -1

The index number of the last-chosen Conversation dialogue option

◆ options

List<ButtonDialog> AC.Conversation.options = new List<ButtonDialog>()

All available dialogue options that make up the Conversation

◆ selectedOption

ButtonDialog AC.Conversation.selectedOption

The option selected within the Conversation's Inspector

◆ timer

float AC.Conversation.timer = 5f

The duration, in seconds, that the Conversation is active, if isTime = True