GetStringByStrRef(int, int)

Determines translated string by string reference.

string GetStringByStrRef(
    int nStrRef,
    int nGender = GENDER_MALE
);

Parameters

nStrRef

Target string reference.

nGender

Gender of the string for some languages (Default: GENDER_MALE)


Description

Returns a translated string from the talk table using the string reference indicated by nStrRef.

nStrRef can be any of the following constants:

Combat:
COMBAT_ATTACK
COMBAT_CHARGE
COMBAT_FLANK
COMBAT_RETREAT
COMBAT_2ME
COMBAT_EATHALFLING
COMBAT_GIANTCHOP
COMBAT_EATGNOME
COMBAT_MORADINHAMMER
COMBAT_KEELRANGER
COMBAT_GRAPTHARHAMMER
COMBAT_MEKILLYOU
COMBAT_SPOOOON

Movement:
MOVE_FOLLOW
MOVE_STAYCLOSE
MOVE_HALFLINGSCOUT
MOVE_WAITHERE
MOVE_MARCHINGORDER
MOVE_SPREADOUT
MOVE_QUIETLYNOW
MOVE_SEARCHPATTERN
MOVE_YOULEADBEHINDYOU
MOVE_FASTERFASTER

Roleplay:
ROLEPLAY_HOTHERE
ROLEPLAY_SHOWGOODS
ROLEPLAY_WYRMHALFLING
ROLEPLAY_TALKORDIE
ROLEPLAY_TALKPRIVATELY
ROLEPLAY_ONLYDRESSES
ROLEPLAY_THROWHALFLING
ROLEPLAY_ADVENTURESWAG
ROLEPLAY_PLAGUE
ROLEPLAY_BRUENOR
ROLEPLAY_BARBLEED
ROLEPLAY_NOOBER

Spellcasting:
CASTING_VEILOFMYSTRA
CASTING_SUMMONBADGER
CASTING_SHRINK
CASTING_KUOTOABOOM



Remarks

Referenced strings from the talk table are automatically translated into the operating system's default language.

Currently, there doesn’t seem to be a way to update the talk table to add custom string references.

With patch 1.31, a gender option has been added to the function, with a default value of GENDER_MALE. This is useful as some languages will have different strings depending on the gender of the speaker. It is unknown if providing a GENDER_FEMALE value for a language which doesn't support that will provide the same result as with GENDER_MALE, or if the function errors.


Version

1.31

See Also

categories: String Functions
constants: GENDER_* Constants


 author: Daniel Beckman, editor: Lilac Soul, additional contributor(s): NWVault via Crag Hack, Lilac Soul
 Send comments on this topic.