Skip to content

Latest commit

 

History

History
76 lines (56 loc) · 2.96 KB

TextMarkup.md

File metadata and controls

76 lines (56 loc) · 2.96 KB

Text Markup

Inside the text for speaker lines and choices, you can include special markup to substitute variables and to format the text.

Note: SUDS uses the same features and syntax as Unreal's own text formatting system, although we only support named variables, not indexes.

Variable Substitution

To substitute a variable into text, use curly braces ({}):

Shopkeep: So, what'll it be?
  * Take {ItemName}
    Shopkeep: Ah, the {ItemName} eh? Classic.

All types of variables can be substituted like this

Plurals

Sometimes you need to modify the text based on how many of a thing is being discussed. Here we support the Unreal plural forms which can be used to emit different text based on a variable number.

You do this by appending a pipe character (|) after the variable and adding plural(...), as shown below:

Child: There {NumCats}|plural(one=is,other=are) {NumCats} {NumCats}|plural(one=cat,other=cats)

This results in "There is 1 cat" or "There are 7 cats" based on the plurality of the number. You can use zero, one, two, few, many, and other as defined in the CLDR for a given language.

Genders

If you need to gender your text in some way, you can use the Unreal gender forms to alter text:

Worker: Oh, that's {Name}, {Gender}|gender(he,she,they) {Gender}|gender(has,has,have) the best stapler in the office.

This requires that {Gender} is a variable of type gender, which can be masculine, feminine, or neuter as per the Unreal ETextGender type.

Rich Text Formatting

All text in SUDS supports being marked up for use in a Rich Text Block. This requires that you set up a datatable of styles - that's outside the scope of this documentation, but refer to the official documentation for details.

If you've set this up you can include rich text tags to add variable styles, images, and even animated text,

Buttercup: We'll <Shake>never</> survive!
Wesley: <Bold>Nonsense.</> You’re only saying that because no one ever has.

See Also: