Gender string

From Mount&Blade Modding Wiki
Jump to: navigation, search

A gender string, referred to officially (but rarely) as gender-based alternation, inserts one of two pieces of text into a string, depending on the sex of the person being spoken to in the dialogue system. If the listener is male, the first choice is used. If the listener is female, the second choice is used. It is one of the four methods of producing dynamic text (the others being registers, string registers, and conditional strings).

Contents

Using gender strings

Gender strings are very simple in construction; they consist of two text strings, one for a male, one for a female, separated by a slash "/" and surrounded by braces "{" and "}".

Hello, {lad/lass}, how fare you?

The above expression will read:

Hello, lad, how fare you?

when the dialogue partner is a male, and:

Hello, lass, how fare you?

when the dialogue partner is female.

Caveats

Use gender safe writing all the time

Be wary anytime you write a string referring to the player or an NPC lord without using a gender string or string register. Inevitably, whether by another modification or just by pure chance, a female lord will be involved in conversation you originally intended only for males, or vice versa.

Only the speaker and listener work with gender strings

Remember that the gender string is based on the sex of the person listening to the text, not the person speaking the text.

If a dialogue entry starts with:

[anyone

then the player character is the listener, while if the dialogue entry starts with:

[anyone|plyr

then the NPC is the listener. Also remember that the gender string applies only to the speaker and the listener. If you wish to refer to the gender of someone else, you must find the troop ID of that person and use the troop_get_type function to find their gender.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox