Adventure Creator  1.66.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.SpeechLine Class Reference

Public Member Functions

 SpeechLine (SpeechLine _speechLine)
 
 SpeechLine (SpeechLine _speechLine, int language)
 
 SpeechLine (int _id, string _scene, string _owner, string _text, int _languagues, AC_TextType _textType, bool _isPlayer)
 
bool IsMatch (SpeechLine newLine, bool ignoreID=false)
 Checks if the class matches another, in terms of line ID, text, type and owner. Used to determine if a speech line is a duplicate of another. More...
 
void TransferActionComment (string comment, string actionListName)
 
void RestoreBackup (SpeechLine backupLine)
 
void ShowGUI ()
 Displays the GUI of the class's entry within the Speech Manager.
 
bool Matches (string filter, FilterSpeechLine filterSpeechLine)
 Checks to see if the class matches a filter set in the Speech Manager. More...
 
string GetInfo ()
 Combines the type and owner into a single string, for display in exported game text. More...
 
string Print (int languageIndex=0, bool includeDescriptions=false, bool removeTokens=false)
 Combines the class's various fields into a formatted HTML string, for display in exported game text. More...
 
bool HasAllAudio ()
 Checks if the line has all associated audio for all languages, if a speech line More...
 
bool HasAudio (int languageIndex)
 Checks if the line has all associated audio for a given language, if a speech line More...
 
string GetAutoAssetPathAndName (string language, bool forLipsync=false, string overrideName="")
 Gets the full folder and filename for a speech line's audio or lipsync file, relative to the "Resources" Assets directory in which it is placed. More...
 
bool SeparatePlayerAudio ()
 Checks if the line is shared by multiple player characters, each with their own audio and lipsync files. More...
 
string GetFilename (string overrideName="")
 Gets the clean-formatted filename for a speech line's audio file. More...
 

Static Public Member Functions

static void ShowField (string label, string field, bool multiLine, string api="")
 Displays a GUI of a field within the class. More...
 

Public Attributes

bool isPlayer
 
int lineID
 
string scene
 
string owner
 
string text
 
string description
 
AC_TextType textType
 
List< string > translationText = new List<string>()
 
AudioClip customAudioClip
 
Object customLipsyncFile
 
List< AudioClip > customTranslationAudioClips
 
List< Object > customTranslationLipsyncFiles
 
int tagID
 
int orderID = -1
 
string orderPrefix = ""
 

Properties

string OrderIdentifier [get]
 

Detailed Description

A container class for text gathered by the Speech Manager. It is not limited to just speech, as all text displayed in a game will be gathered.

Constructor & Destructor Documentation

◆ SpeechLine() [1/2]

AC.SpeechLine.SpeechLine ( SpeechLine  _speechLine)

A Constructor that copies all values from another SpeechLine. This way ensures that no connection remains to the original class.

◆ SpeechLine() [2/2]

AC.SpeechLine.SpeechLine ( int  _id,
string  _scene,
string  _owner,
string  _text,
int  _languagues,
AC_TextType  _textType,
bool  _isPlayer 
)

A constructor for speech text in which the ID number is explicitly defined.

Member Function Documentation

◆ GetAutoAssetPathAndName()

string AC.SpeechLine.GetAutoAssetPathAndName ( string  language,
bool  forLipsync = false,
string  overrideName = "" 
)

Gets the full folder and filename for a speech line's audio or lipsync file, relative to the "Resources" Assets directory in which it is placed.

Parameters
languageThe language of the audio
forLipSyncTrue if this is for a lipsync file
overrideNameIf set, then this string (with special characters removed) will be used instead
Returns
A string of the folder name that the audio or lipsync file should be placed in

◆ GetFilename()

string AC.SpeechLine.GetFilename ( string  overrideName = "")

Gets the clean-formatted filename for a speech line's audio file.

Parameters
overrideNameIf set, then this string (with special characters removed) will be used instead
Returns
The filename

◆ GetInfo()

string AC.SpeechLine.GetInfo ( )

Combines the type and owner into a single string, for display in exported game text.

Returns
A string of the type, and the owner if there is one

◆ HasAllAudio()

bool AC.SpeechLine.HasAllAudio ( )

Checks if the line has all associated audio for all languages, if a speech line

Returns
True if the line has all associated audio for all language

◆ HasAudio()

bool AC.SpeechLine.HasAudio ( int  languageIndex)

Checks if the line has all associated audio for a given language, if a speech line

Parameters
languageIndexThe index number of the language in question. The game's original language is 0
Returns
True if the line has all associated audio for the given language

◆ IsMatch()

bool AC.SpeechLine.IsMatch ( SpeechLine  newLine,
bool  ignoreID = false 
)

Checks if the class matches another, in terms of line ID, text, type and owner. Used to determine if a speech line is a duplicate of another.

Parameters
newLineThe SpeechLine class to check against
ignoreIDIf True, then a difference in lineID number will not matter
Returns
True if the two classes have the same line ID, text, type and owner

◆ Matches()

bool AC.SpeechLine.Matches ( string  filter,
FilterSpeechLine  filterSpeechLine 
)

Checks to see if the class matches a filter set in the Speech Manager.

<param name = "filter The filter text</param> <param name = "filterSpeechLine The type of filtering selected (Type, Text, Scene, Speaker, Description, All)

Returns
True if the class matches the criteria of the filter, and should be listed

◆ Print()

string AC.SpeechLine.Print ( int  languageIndex = 0,
bool  includeDescriptions = false,
bool  removeTokens = false 
)

Combines the class's various fields into a formatted HTML string, for display in exported game text.

Parameters
languageIndexThe index number of the language to display fields for, where 0 = the game's original language
includeDescriptionsIf True, its description will also be included
removeTokensIf True, text tokens such as [wait] within the text will be removed
Returns
A string of the owner, filename, text and description

◆ SeparatePlayerAudio()

bool AC.SpeechLine.SeparatePlayerAudio ( )

Checks if the line is shared by multiple player characters, each with their own audio and lipsync files.

Returns
True if the line is shared by multiple player characters, each with their own audio and lipsync files.

◆ ShowField()

static void AC.SpeechLine.ShowField ( string  label,
string  field,
bool  multiLine,
string  api = "" 
)
static

Displays a GUI of a field within the class.

Parameters
labelThe label in front of the field
fieldThe field to display
multiLineTrue if the field should be word-wrapped

Member Data Documentation

◆ customAudioClip

AudioClip AC.SpeechLine.customAudioClip

The AudioClip used for speech, if set manually

◆ customLipsyncFile

Object AC.SpeechLine.customLipsyncFile

The TextAsset used for lipsyncing, if set manually

◆ customTranslationAudioClips

List<AudioClip> AC.SpeechLine.customTranslationAudioClips

An array of AudioClips used for translated speech, if set manually

◆ customTranslationLipsyncFiles

List<Object> AC.SpeechLine.customTranslationLipsyncFiles

An array of TextAssets used for translated lipsyncing, if set manually

◆ description

string AC.SpeechLine.description

A user-generated description of the text

◆ isPlayer

bool AC.SpeechLine.isPlayer

True if this is a speech line spoken by the Player

◆ lineID

int AC.SpeechLine.lineID

A unique ID number to identify the instance by

◆ owner

string AC.SpeechLine.owner

If not the player, who the text is owned by

◆ scene

string AC.SpeechLine.scene

The name of the scene that the text was found in

◆ tagID

int AC.SpeechLine.tagID

The ID of the associated SpeechTag, if a speech line

◆ text

string AC.SpeechLine.text

The display text itself

◆ textType

AC_TextType AC.SpeechLine.textType

The type of text this is (Speech, Hotspot, DialogueOption, InventoryItem, CursorIcon, MenuElement, HotspotPrefix, JournalEntry)

◆ translationText

List<string> AC.SpeechLine.translationText = new List<string>()

An array of translations for the display text