Wiki

Dialogue System

Characters

As outlined in the Ren’py documentation, each character has an assigned sayer function that can be referenced within the Ren’py scope for displaying text. Our implementation extends this functionality by enabling manipulation of the character image through parameters supplied at the end of the spoken dialogue line.

The implementation for male and female characters differs due to varying requirements. Female dolls offer more image manipulations, but this comes at the expense of increased computational time.

Every female character has a variety of distinct facial expressions that you can provide as parameters. For a comprehensive list, it is recommended to check the game files under the following directory:

WTS/game/characters/hermione/poses/default/face/

It is important to note that if you omit the parameter list in parentheses, the dialogue line will be displayed without any alterations to the character (if currently displayed) or with no character shown at all (if not previously displayed).

List of female characters with support for the Paper Doll System:

  • ast: Astoria
  • cho: Cho
  • her: Hermione
  • hoo: Madam Hooch
  • lun: Luna
  • sus: Susan
  • ton: Tonks

Example use:

her "Hello world." (mouth="open", eyes="base", eyebrows="angry", pupils="mid")

List of male characters with a simplified version of the Paper Doll System:

  • gen: Genie
  • sna: Snape

Example use:

gen "Hello world." (face="base", xpos="far_left", ypos="head")

Other characters with an assigned image:

  • twi: The twins (displayed together)
  • fre: Fred
  • ger: George
  • maf: Madam Mafkin

Example use:

twi "Hello world."

Text Tags

Text tags are convenient functions that can be invoked from within the text to carry out specific tasks, often related to the text it is applied to or to display symbols. The Ren’Py engine comes with numerous default text tags, and we have supplemented them with several additional ones to enhance game development further.

heart

The {heart} text tag serves a simple purpose: it displays a heart emoji (❤) using the DejaVu Sans Unicode font, which is typically not supported by the default game font.

Example use case:

gen "I love you! {heart}"

number

The {number=x} text tag, where X is an integer or a variable representing an integer, converts the number into a human-readable text format, but it only works when the number is below 100. For instance, using {number=56} will result in the string ‘Fifty-six’. This feature is particularly helpful when you need to display a variable value in textual form.

Example use case:

gen "{number=15} points to Gryffindor!"

# or

gen "{number=somevar} points to Gryffindor!"

unicode

The {unicode}😀{/unicode} text tag enables the display of Unicode characters using the Unicode-enabled font DejaVu Sans. This tag is useful for showing emojis or characters that are not supported by the default game font. By using this tag, you can render a wide range of Unicode symbols and emojis.

Example use case:

gen "{unicode}😀{/unicode}"