Creating Our First Dialog

By HeliJunkie

Defining the main dialog class

So let us open a text editor (for example notepad.exe) and start to define our first dialog. For each dialog we have to define a class. For each class, we have to use a special syntax:

Class Classname {
};

 

So we will make a Dialog with the name "SampleDialog". So we write to our notepad:

Class SampleDialog {
};


We must place all definitions for our dialog between the "{" and the "};". As you can see, I will give all new/changed text a blue color.

 

Adding comments to our file

If we want to add comments to our file, we use can use "//". And it's not important where it is within a line. It can be at the beginning of a line. So let us add a comment:

Class SampleDialog {
  //A sample Dialog from a dialog tutorial
};

Defining the dialog properties

Each dialog has a set of properties it can/must have. Here is a list:

Dialog-Class Properties

Name
Type
Remark
idd integer A unique number for our dialog. If you don't need direct access to it, use "-1"
duration integer How long this dialog will be displayed (only for non interactive dialogs)
movingEnabled boolean Specify if the player can move while the dialog is displayed.(Only for non interactive dialogs. Interactive dialogs always have false.)
controlsBackground array A string array of control class names to use for background
controls.
controls array A string array of control class names to use.
objects array ???


So let us set the main properties to our sample:

Class SampleDialog {
  //A sample Dialog from a dialog tutorial
  idd = -1;
  movingEnable = false;
  controlsBackground[] = {};
  controls[] = {};
  objects[] = {};
};

 

So we have now created our dialog class skeleton. Let us proceed with adding a control to our sample dialog.

Editor Tips!

  • You must end each property definition with a ";".
  • If a property has an array as value, you have to add "[]" at the end of the property name.
  • Also you have to use "{}" for a value list. You can see more about that later.
  • For the sake of readability you should indent each line within a class. This makes it easier to see where a class starts and ends.

Advertisement