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

Public Member Functions

 SpeechLine (SpeechLine _speechLine)
 
 SpeechLine (SpeechLine _speechLine, int voiceLanguage)
 
 SpeechLine (int _id, string _scene, string _owner, string _text, int _languagues, AC_TextType _textType, bool _isPlayer)
 
void CopyValues (SpeechLine _speechLine)
 
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 gameObjectName)
 
void RestoreBackup (SpeechLine backupLine)
 
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...
 
string GetTranslation (string originalText, int language)
 Gets the translation for a given language index. More...
 
void ShowGUI (float maxWidth)
 
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...
 
string Print (string overrideName, int languageIndex=0, bool includeDescriptions=false, bool removeTokens=false)
 
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...
 

Static Public Member Functions

static void ShowField (string label, string field, bool multiLine, float maxWidth=570f, string api="", string tooltip="", bool selectable=false)
 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
 
bool onlyPlaySpeechOnce = false
 
bool alwaysRetainInSpeechManager = false
 
bool ignoreDuringExport = false
 
string customFilename = ""
 
int orderID = -1
 
string orderPrefix = ""
 

Protected Member Functions

string GetSubfolderPath (string overrideName="")
 
string GetRelativePath (string language, bool forLipsync=false, string overrideName="")
 
string GetSpeakerName ()
 
void SetCustomArraySizes (int newCount)
 
List< AudioClip > GetAudioListForTranslation (List< AudioClip > audioClips, int language)
 
List< Object > GetLipsyncListForTranslation (List< Object > lipsyncFiles, int language)
 

Protected Attributes

bool gotCommentFromDescription
 

Static Protected Attributes

static string[] badChars = new string[] {"/", "`", "'", "!", "@", "£", "$", "%", "^", "&", "*", "(", ")", "{", "}", ":", ";", ".", "|", "<", ",", ">", "?", "#", "-", "=", "+", "-"}
 

Properties

string OrderIdentifier [get]
 
string DefaultFilename [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

◆ GetTranslation()

string AC.SpeechLine.GetTranslation ( string  originalText,
int  language 
)

Gets the translation for a given language index.

Parameters
originalTextThe original text, returned if the language index is invalid
languageThe language index
Returns
The translation text

◆ 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,
float  maxWidth = 570f,
string  api = "",
string  tooltip = "",
bool  selectable = false 
)
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

◆ ShowGUI()

void AC.SpeechLine.ShowGUI ( float  maxWidth)

Displays the GUI of the class's entry within the Speech Manager.

Member Data Documentation

◆ alwaysRetainInSpeechManager

bool AC.SpeechLine.alwaysRetainInSpeechManager = false

If True, then this class instance will not be removed by the Speech Manager's "Gather text" and "Reset text" processes. This flag should be used under caution, as this will not affect the state of any linked iTranslatable interface

◆ 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

◆ ignoreDuringExport

bool AC.SpeechLine.ignoreDuringExport = false

If True, then this line will not be included in CSV exports, even if it matches the criteria set in the Export Wizard window

◆ 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

◆ onlyPlaySpeechOnce

bool AC.SpeechLine.onlyPlaySpeechOnce = false

If True, and the textType = AC_TextType.Speech, then the speech line can only be played once. Additional calls to play it will be ignored

◆ 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

Property Documentation

◆ DefaultFilename

string AC.SpeechLine.DefaultFilename
get

The line's default filenames - used unless overridden by custom filenaming