Dialogue Punctuation

version 3 by Ron Newcomb

  • Home page
  • Beginning
  • Next



  • Documentation


    Section : Basic Usage

    Correctly placing double quotes, commas, periods, and spacing is a tricky and tedious problem for dialogue-heavy games whose characters' lines span multiple rules and say phrases. This extension provides say phrases that automate the process, inserting the necessary punctuation and spacing where appropriate. Also provided are three attribution tags, which will censor themselves after one of them attributes the speaker. This is so we may use the attribution tags indiscriminately, knowing they will not interrupt the flow of text if they are not needed.

    The first pair of phrases go at the beginning of every passage of dialogue. "[Person speaking]" prints nothing other than any necessary spacing and punctuation, and tells the extension who is speaking the passage. "[Person says]" also does that, plus attributes the character for the player's benefit, " Bob says, ' ", but only if the character has not yet been attributed since he began speaking.

        "[(Person) speaking]"
        "[(Person) says]"

    The next two say phrases are for attributing dialogue after a passage of text, which is the usual case in dialogue. As usual, a character will not be attributed again since he began speaking, regardless which say phrase printed the attribution. The second form of the post-passage attributions, "[c says Person]", will print a period at minimum, or replace the period with a comma in the case the attribution is needed.

        "[says (Person)]"
        "[c says (Person)]"

    Finally, due to the way Inform 7 handles line breaks, the end of a passage of text must end with "[run paragraph on]". The only exception is if other substitutions would end the passage; in that case, the "[run paragraph on]" goes just before them:

        say "[Charlie speaking]Well the transmission seems fine. But, the [run paragraph on][broken part of car]";

    One exception we must be aware of is actions out-of-world. Such actions always cause a line break. To avoid this, instead of creating actions which print nothing as out of world, we instead leave them in-world but do not provide an Understand statement so our player cannot trigger them.


    Section : Sliding Between Narrative and Dialogue

    We can insert some narrative into a paragraph of dialogue with either of the calls to "narrative":
        say "[Bob speaking]Hi Jim![run paragraph on]"; narrative; say "Bob waves his hand.[run paragraph on] ";
        say "[Bob speaking]Hi Jim![narrative]Bob waves his hand.[run paragraph on] ";

    For long stretches of narrative, we can simply turn off the extension:
        turn off dialogue punctuation;
        say "[turn off dialogue punctuation]";

    Either of these uses will correctly end any current paragraph. A use of "[(Person) speaking]" or "[(Person) says]" will turn on the extension again, but the post-passage attributions will merely silence themselves.

    Of course, we can ask if the extension is currently on or not. The extension is still considered on after a call to "narrative":
        if dialogue punctuation is on begin;
        if the dialogue punctuation extension is off begin;


    Section : Customizing

    The look of the punctation and size & nature of the spacing may be changed thus:
        When play begins:
            now the indentation is " "; [ five-space indent]
            now the opening quote is "<<";
            now the closing quote is ">>";
            now the sentence break is " ";
            now the speaker break is "[line break]".

    For example, if we wanted our dialogue (if not our narrative) in the standard format of indented paragraphs:
        When play begins:
            now the indentation is " "; [ five-space indent]
            now the speaker break is "[line break]".

    A pair of conditions are occasionally useful. They are:
        if inside quotes begin;

        if outside quotes begin;

    To turn on the extension's debugging:
        Use dialogue punctuation debugging.

    Debugging uses different punctuation for opening and closing quotemarks, and furthermore follows each with a number. Internally, this extension uses the say phrases "[open quote]" and "[close quote]" for exactly this reason, and since each phrase is invoked in about four different places within the extension's code, the number allows us to find which invocation printed a particular mark. Open quote marks are numbered starting from 1; close quotes, from 6.

    Finally, the quote mark say phrases can be directly edited to use different "quotes" for each character. For example, in third-person view, the viewpoint character may have his or her thoughts italicized to set them off from the narrative. This could be coded as:
        To say open quote (n - number):
            if using dialogue punctuation debugging option begin;
                say "[run paragraph on][bold type]«[n][roman type][run paragraph on]";
            otherwise if the currently speaking character is Gary;
                say italic type;
            otherwise;
                say "[run paragraph on][opening quote][run paragraph on]";
            end if;
            now outside-quotes is false.
        
        To say close quote (n - number):
            if using dialogue punctuation debugging option begin;
                say "[run paragraph on][bold type]»[n][roman type][run paragraph on]";
            otherwise if the currently speaking character is Gary;
                say roman type;
            otherwise;
                say "[run paragraph on][closing quote][run paragraph on]";
            end if;
            now outside-quotes is true.