Message

The message entity is used to display messages on the screen.

Fields Descriptions

The fields for the Message entity are:

Field Description
DisplayType Name of message type as defined in message.ini
szEntityName The name of this entity
TextName Section name of text to display as defined in the message text file
TriggerName The name of the trigger entity

The message will not be displayed unless the state of the trigger entity is on.

Message Text

The text you wish to have displayed by a Message entity is defined in a separate utf-8 encoded text file, which is located in the install directory. The name of this text file can be specified in the language.ini file. Moreover, it is possible to use different text files for different languages. The default message text file is called message.txt. Each text block in the message text file is defined in a section headed up by the TextName in square brackets. For example:

[PressEsc]
<Player> died.
<CR>
Press ESC to restart level.

To use this text in a Message you would set TextName to PressEsc in the entity definition. <CR> indicates a new line in the message text and must be placed in a separate line in the TXT file. <Player> will be replaced automatically with the player's name.

Message.ini

The file message.ini, which is located in the install directory, is used to define the type of message that will be displayed. Each message type is defined in a section headed up by the DisplayType enclosed in square brackets. Depending on the degree of control you need for your message you can choose between a simple or a scripted message which differ in the required values.

Simple Message (play state)

Used for simple messages that just need to fade in, display the text for a while, and fade out again.

[DisplayType]
layout CEGUI layout file
textwindow name of the window in the layout that will contain the actual text
displaytime time, in seconds, that the message will be completely visible
fadeintime time, in seconds, that the message will fade in
fadeouttime time, in seconds, that the message will fade out

Scripted Message (play or dialog state)

Used for messages that require any kind of user interaction.

[DisplayType]
layout CEGUI layout file
textwindow name of the window in the layout that will contain the actual text
script script file to control behaviour of this message
gamestate defines the game state whose default window is used as parent for the message window; use dialog for the dialog game state, play for the play game state
Note:
All orders and variables in conversation, inventory and message scripts are globally visible, hence they all must have unique names.
Exception: All GUI related scripts may contain an initialization order named main. This order will be executed once when the corresponding game component is created and the script is loaded. Afterwards this order is inaccessible.

Example

definition in the message ini file

[Scripted]
layout = message_scripted.layout
textwindow = Message/Scripted/Text
script = message.s
gamestate = dialog

message.s script

{
Message_OnShown[(e)
{
DialogState.UpdateLevel(false);
DialogState.RenderLevel(true); // default
DialogState.Enter();
}]
Message_OnCloseClicked[(e)
{
DialogState.Exit();
}]
}