
Prototype: GemRB.StatComment(Strref, X, Y)

Description: Replaces %d's with the values of X and Y in a string referenced by strref. PST uses %d values in place of tokens, thus it requires a special command. (Note that you can safely replace this command with a few Python scripting commands). In other engines use GetString after setting the needed tokens by SetToken (if you need to set them at all).

Parameters: Sttref - a string index from the dialog.tlk table.
            X,Y    - two numerical values to be replaced in place of %d's.

Return value: A string with resolved %d's.

Example:
def IntPress():
        GemRB.SetText(NewLifeWindow, TextArea, 18488)
        GemRB.TextAreaAppend(NewLifeWindow, TextArea, "\n\n"+GemRB.StatComment(GemRB.GetTableValue(StatTable,Int,1),0,0) )
        return

The above example comes directly from our PST script, it will display the description of the intelligence stat (strref==18488), adding a comment based on the current Int variable. StatTable (a table index) contains the comment strref values associated with an intelligence value.

See also: GetString, SetToken, GetTableValue, SetText, LoadTable, TextAreaAppend

