Translations of this page:

This is an old revision of the document!
—-

7. Dialogues

WME provides very powerful dialogue capabilities and this chapter deals with the way how you can implement dialogue trees in your game. We’ll use our last example where we have in one scene Molly and Sally.

Our chapter starts similar to the previous with the definition of so called “response box”. It’s the interface which will have stored the dialogue choices player has to make to successfully communicate with another character.

You’ll see that it’s very similar to the inventory box definition. We’re speaking about the file located in data\interface\responses.def and as we’ve seen already, it’s assigned in the Project Manager as the Response Window.

RESPONSE_BOX 
{ 
  FONT = "fonts\outline_white.font" 
  FONT_HOVER = "fonts\outline_red.font"

Path to the font files used for the dialogue options and dialogue options with mouse hover.

  HORIZONTAL = FALSE

Horizontal specifies if the dialogue options are to be displayed horizontally or vertically.

  SPACING = 5

How many pixels should be the options apart?

  AREA {40, 0, 800, 170}

Same as in the inventory box, you define the window in which your options appear.

  WINDOW 
  {     
    X = 0 
    Y = 420 
    WIDTH = 800 
    HEIGHT = 180 
 
    BUTTON 
    { 
      TEMPLATE = "ui_elements\template\but.button" 
      IMAGE = "ui_elements\arrow_up.bmp" 
      TEXT = "" 
      NAME = "prev" 
 
      X = 0 
      Y = 0 
      WIDTH = 30 
      HEIGHT = 30 
    } 
 
    BUTTON{ 
      TEMPLATE = "ui_elements\template\but.button" 
      IMAGE = "ui_elements\arrow_down.bmp" 
      TEXT = "" 
      NAME = "next" 
 
      X = 0 
      Y = 150 
      WIDTH = 30 
      HEIGHT = 30 
    } 
  } 
}

Again you see that there’s a window definition with two buttons (prev and next) which are the scroll buttons. If WME finds buttons named like this, it uses them automatically. All the positioning (absolute in window and relative in buttons is the same as with the inventory box).

From other possible options you can use:

TEXT_ALIGN - specifies the alignment of textual response lines; it can be either "left", "right" or "center"; the default value is "left"

VERTICAL_ALIGN - specifies the vertical alignment of responses within the response area (it has no effect on horizontally ordered items); it can be one of the following values: "top", "center" or "bottom"; the default value is "bottom"

Of course you can for the window use IMAGE parameter which would set some background image for the response box. I’ll leave it to your imagination for now and let’s move on the way how the dialogue itself is constructed.

Dialogues in WME are entirely scripted which give them a huge flexibility. You can do whatever you like, in the middle of the dialogue including running complex cut-scenes, videos, you name it - you have it.

But back to our dialogue - let’s look at a sample dialogue tree I’ve created for this purpose:


 
wmebook/ch7.1197035436.txt.gz · Last modified: 2007/12/07 14:50 by metamorphium
Recent changes RSS feed Creative Commons License Driven by DokuWiki