CTlkTable Class¶
Overview¶
Note
The CTlkTable class handles string references stored in talk table files (.tlk)
The structure used for this class is CTlkTable
Quick Reference¶
Quick Ref |
void CTlkTable::CTlkTable() |
void CTlkTable::~CTlkTable() |
int CTlkTable::AddTlkFile(int gender, CString& szFileName) |
unsigned char CTlkTable::Fetch(unsigned long strId, STR_RES& strRes, int ignoreSTRREFON) |
unsigned char CTlkTable::FetchSound(unsigned long strId, STR_RES& strRes) |
void CTlkTable::LoadEngineStrings(unsigned long stringBase, unsigned long numStrings, unsigned long* strings) |
void CTlkTable::OpenOverride() |
void CTlkTable::ParseStr(CString& sText, unsigned short wFlags) |
Constructors¶
Name |
Description |
Constructs a |
|
Destroys a |
CTlkTable::CTlkTable¶
Constructs a CTlkTable
object
void CTlkTable::CTlkTable();
Remarks
Constructs a CTlkTable
object
CTlkTable::~CTlkTable¶
Destroys the CTlkTable
object
void CTlkTable::~CTlkTable();
Remarks
Destroys the CTlkTable
object
Methods¶
Name |
Description |
Add a talk file to the game |
|
Locates and reads the text for the string reference |
|
Locates and reads the sound for the string reference |
|
Opens the override folder to look for additional talk files |
|
CTlkTable::AddTlkFile¶
Add a talk file (.tlk) to the game
int CTlkTable::AddTlkFile(
int gender,
CString& szFileName);
Parameters
int
gender - boolean value for male or female talk fileCString& szFileName - string containing filepath to .tlk file
Return Value
Returns int
Remarks
Talk files are located under the lang
folder and in the appropriate country code folder (ie en_US
for international english). Usually the .tlk files are named Dialog.tlk
for male versions and DialogF.tlk
for female versions.
Talk files store the string references (StrRef) of dialog speech (talk), item names and descriptions, and other text used in the game. Additonally the StrRefs in the talk table can also store references to audio sounds to play (voiced character speeching for example)
CTlkTable::Fetch¶
Locates and reads the text for the string reference (StrRef) specified in strId and stores the fetched text in a STR_RES structure.
unsigned char CTlkTable::Fetch(
unsigned long strId,
STR_RES& strRes,
int ignoreSTRREFON);
Parameters
unsigned long
strId - string reference id to locateSTR_RES& strRes - store the text fetched, in the structure address
int
ignoreSTRREFON - boolean to include and prepend the StrRef ID value as text in the stored text
Return Value
Returns unsigned char
Remarks
CTlkTable::FetchSound¶
Locates and reads the sound for the string reference (StrRef) specified in strId and stores the fetched sound resource reference (ResRef) in a STR_RES structure.
unsigned char CTlkTable::FetchSound(
unsigned long strId,
STR_RES& strRes);
Parameters
unsigned long
strId - string reference id to locateSTR_RES& strRes - store the sound ResRef fetched, in the structure address
Return Value
Returns unsigned char
Remarks
CTlkTable::LoadEngineStrings¶
void CTlkTable::LoadEngineStrings(
unsigned long stringBase,
unsigned long numStrings,
unsigned long* strings);
Parameters
unsigned long
stringBase -unsigned long
numStrings -unsigned long
* strings -
Remarks
CTlkTable::OpenOverride¶
Opens the override folder to look for additional talk (.tlk) files
void CTlkTable::OpenOverride();
Remarks
See the CTlkFileOverride class for further details
CTlkTable::ParseStr¶
Parse
void CTlkTable::ParseStr(
CString& sText,
unsigned short wFlags);
Parameters
CString& sText -
unsigned short
wFlags -
Remarks