Writing Dialogue

The simplest way to add dialogue is to have two strings on the line: the first is who is speaking, the second what they are saying.


label downTheRabbitHole:
    "Alice was beginning to get very tired of sitting by her sister on the bank,
    and of having nothing to do: once or twice she had peeped into the book her
    sister was reading, but it had no pictures or conversations in it."
    
    "Alice" "What is the use of a book without pictures or conversations?"
    return

Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it.
Alice
What is the use of a book without pictures or conversations?

This is great for a character that only speaks a few times, but if they are going to be speaking a lot, then it is better to define them as a Character.

Convention

The convention for dialogue in Visual Novels is different from that of a book, and perhaps closer to that of a play. A book might have:

"What is the use of a book," said Alice "without pictures or conversations?"
Whereas in a Visual Novel who is speaking is indicated by the character's name in the text box, and what they say follows:
Alice
What is the use of a book without pictures or conversations?
Whether Alice said, muttered, or shouted this line is typically conveyed by a combination of her character sprite's expression, and by changing the font size and weight of what is said. These kinds of things may not be apparent to the visually impaired though and are not communicated using self-voicing.

You need not follow this convention of course. If you want to include double-quotes in a string delimited by double-quotes you need to use the escape character \ to mark the quotes that don't end the string:


    "Alice" "\"What is the use of a book,\" said Alice \"without pictures or conversations?\""

Alice
"What is the use of a book," said Alice "without pictures or conversations?"

Monologuing

If someone speaks many consecutive lines of dialogue you can use monologue mode by using triple double-quotes. A blank line is used to separate each section. This example uses additional escape sequences to retain the original formatting.

Note: You still need to escape even single instances of the double-quote character. This is different to the way Python handles it's triple quoted string literals which don't need this escaping.


label nowUntil:
    "Oberon" """
    \ Now, until the break of day,\n
    Through this house each fairy stray.\n

    \ To the best bride-bed will we,\n
    Which by us shall blessed be;\n
    And the issue there create\n
    Ever shall be fortunate.\n

    \ So shall all the couples three\n
    Ever true in loving be;\n
    And the blots of Nature's hand\n
    Shall not in their issue stand;\n
    """

Oberon
Now, until the break of day,
Through this house each fairy stray.
Oberon
To the best bride-bed will we,
Which by us shall blessed be;
And the issue there create
Ever shall be fortunate.
Oberon
So shall all the couples three
Ever true in loving be;
And the blots of Nature's hand
Shall not in their issue stand;

Opinions

Once you get started writing character dialogue (and including character sprites too) it's all too easy to forget the power of narration. Even though a lot may be conveyed by the art and dialogue, they don't convey the other senses: smell, taste, touch. Also missing is the impression one character has of another or what the characters are thinking. If you are aiming for your game to be accessible to the visually impaired then you need to describe what others would see.

Another thing to consider is how much clicking the player must do to advance the story. Two characters repeatedly saying "..." to each other is just irritating to the player and conveys almost nothing. How much better would even something like this be?

Bob stands there, twiddling his thumbs, while you desperately search for something to say to him and come up blank. He's about to walk away when your mind unfreezes.