Causes the creature to speak a translated string.
- Reference of the string in the talk table
- A TALKVOLUME_* constant representing the channel on which to speak the string. (Default: TALKVOLUME_TALK)
Causes the calling creature to speak a translated string with the nStrRef index from the Talk Table.
The StrRef is an index number into the user's dialog.tlk file, which is a language-specific file or the module specific .tlk file.
Since Hordes of the Underdark, it's become possible to easily make your own tlk file and include with your module. Note that you must add 16777216 to the index in your file, so if you want entry 1 in your custom tlk file, you'll need use 16777217 for the nStrRef in this function. More detailed information on talk tables can be found here.
// the name of the spell that was cast at him.
//The spell that triggered this OnSpellCastAt event
int nSpell = GetLastSpell();
// Look up the StrRef as a string in spells.2da and convert to int
int nStrRef = StringToInt(Get2DAString("spells", "Name", nSpell));
// Speak the spell name
|functions:||ActionSpeakString, FloatingTextStrRefOnCreature, SpeakStringByStrRef|
author: Troels Therkelsen, editor: Lilac Soul, additional contributor(s): Lilac Soul