Serial Dialogs (MGS)

In MGS Natlang, serial dialogs are found within serial dialog blocks and related combination blocks.

Serial dialogs contain text meant to be shown via the serial console terminal. They are called serial "dialogs" because they are similar to dialogs in many respects, but they are made up of text alone (as opposed to being accompanied by images and labels) and needn't be used for dialog specifically.

serial dialog serialDialogName {
  "Serial dialogs go here!"
}
//or
script {
  show serial dialog serialDialogName {
    "Serial dialogs go here!"
  }
  //or
  show serial dialog {
    "Serial dialogs go here!"
  }

  //secret serial dialog!
  debug!("I am also a serial dialog!")
}

 




 



 



 

Structure

  1. Serial dialog parameter: 0+
  2. Serial dialog message: 1+
  3. Serial dialog option: 0+

NOTE: unlike with conventional dialogs, serial dialog blocks cannot contain more than one serial dialog. In other words, inside a serial dialog block, no parameters can be given after a serial message, and nothing can come after a serial option (except more options).

Serial Dialog Parameters

serial dialog sample {
  wrap messages to 60
  "Hey, can anyone hear me? Hello?"
  # "Yes, I can hear you." : goto script sampleYes
  # "What did you say?" : goto script sampleNo
}

 




Serial dialog parameters are a serial dialog property and value pair. Multiple serial dialog parameters can occur back-to-back in a single MGS Natlang serial dialog or a serial dialog settings block.

  • wrap (messages) (to) $number.
    • Number: the number of chars to auto wrap the contents of serial dialog messages.
    • 80 is default.

(Yeah, there's only one parameter for the moment!)

Serial Dialog Messages

serial dialog sample {
  wrap messages to 60
  "Hey, can anyone hear me? Hello?"
  # "Yes, I can hear you." : goto script sampleYes
  # "What did you say?" : goto script sampleNo
}


 



A serial dialog message is any quoted string.

  • To maximize compatibility, best to limit these to ASCII characters.
  • Each message is printed on its own line.
  • Some characters must be escaped in the message body, such as double quote (\") (depending on the quotes you're using to wrap these).
    • \t (tabs) are auto-converted to four spaces.
    • \n (new lines) are honored, but since text is wrapped automatically, don't worry about hard wrapping your messages unless you want to put line breaks in arbitrary places.
  • Word processor "smart" characters such as ellipses (…), emdashes (—), and smart quotes (“”) are auto converted to ASCII equivalents (...) (--) (").
  • These messages may be given ANSI styles. Use the built-in styling syntax for best results.

Serial Dialog Options

  • A single serial dialog can only use one of the two types of option (multiple choice or free response).
    • The parser will interpret all options within the block using the type of the first option.
  • Unlike dialog options, the option count for serial dialogs is unlimited.
  • The label must be wrapped in quotes.
  • The words goto and script are optional. Any string given after the : (other than goto and script) is assumed to be the script name.

Multiple Choice

# $label:quotedString : (goto) (script) $script:string

Each label will appear as part of a numbered list in the serial console. These labels (and only these) may be styled.

The player cannot proceed until they enter a valid number, at which point the game will jump to the corresponding script. Failure results in a repeat of the same serial dialog again. That means this type of option will always result in a script jump.

serial dialog sample {
  wrap messages to 60
  "Hey, can anyone hear me? Hello?"
  # "Yes, I can hear you." : goto script sampleYes
  # "What did you say?" : goto script sampleNo
}



 
 

The above example becomes:

Hey, can anyone hear me? Hello?
    0: Yes, I can hear you.
    1: What did you say?

>_

Free Response

_ $label:quotedString : (goto) (script) $script:string

The label indicates what the player must type for the game to jump to the indicated script.

There is no explicit prompt for these options, but upon reaching the free response portion of the serial dialog, the player can type whatever they want into the serial console.

An invalid response will fall through, i.e. the script will continue executing actions further below. Therefore, only a valid response will result in a script jump.

The user's response is case insensitive. (The label "CAT" will match the user input of cat.)

exampleScript {
  show serial dialog {
    "When you arrive at the Sphinx,"
    "it speaks in a slow, monotone voice:"
    "WHEN DO THE FLYING TOASTERS COME OUT?"
    _ "after dark" : goto script sphinxSuccess
    _ "before dark" : goto script sphinxWTF
  }
}





 
 


The above example becomes:

When you arrive at the Sphinx,
it speaks in a slow, monotone voice:
WHEN DO THE FLYING TOASTERS COME OUT?

>_

Serial Styles

A unique feature of serial dialog messages and serial options is styling. Styles, implemented with ANSI escape codes, are turned on and off with tags enclosed in < and > (MGS Natlang only — you'll have to lookup the escape codes yourself otherwise).

(Also note that <bell>, though not styling, is also available. This will ring the terminal bell.)

  • Foreground colors (letter colors)
    • Black: <k> or <black>
    • Red: <r> or <red>
    • Green: <g> or <green>
    • Yellow: <y> or <yellow>
    • Blue: <b> or <blue>
    • Magenta: <m> or <magenta>
    • Cyan: <c> or <cyan>
    • White: <w> or <white>
  • Background colors
    • Black: <bg-k> or <bg-black>
    • Red: <bg-r> or <bg-red>
    • Green: <bg-g> or <bg-green>
    • Yellow: <bg-y> or <bg-yellow>
    • Blue: <bg-b> or <bg-blue>
    • Magenta: <bg-m> or <bg-magenta>
    • Cyan: <bg-c> or <bg-cyan>
    • White: <bg-w> or <bg-white>
  • Emphasis
    • Bold: <bold> (brighter colors and/or greater font weight)
    • Dim: <dim>
  • Reset all styles: </> or <reset>
    • Styles can only be turned off all at once, unfortunately.
    • Styles will stay "on" until you explicitly turn them "off".

Example

serial dialog grandpaRambling {
  "That doll is <r>evil</>, I tells ya! <r><bold>EVIL</>!!"
}

That doll is evil, I tells ya! EVIL!!

You can also add styles one at a time, and they will accumulate:

serial dialog accumulation {
  "plain text <r>red text <bold>add bold <bg-b>add blue background</> clear all"
}

plain text add red add bold add blue background clear all

The user's color theme affects how styles appear in their serial console, and not all styles are implemented in all themes (or consoles). We therefore recommend using styles for optional flavor only, and not to impart gameplay-critical information.

Workaround

The web build of the game currently styles serial output one line at a time, and so styling may be dropped after a line break. As a workaround, manually insert your style tags again before the word that was wrapped.