Pawn Conversation

If a pawn has a script associated with conversations then placing the cursor over him and pressing the Use key will activate it. You will be switched to a Conversation screen where the Pawn speaks and you choose a reply.

General Conversation Definitions

General information about conversations like the used GUI schemes, scripts etc. have to be defined in the conversation.ini file located in the install folder.

[Schemes]

section to define all CEGUI schemes required by conversations
default default scheme used by conversations
... any other scheme required by conversations

[Layouts]

section to define any CEGUI layout required by conversations
default default layout used for conversation if not specified by Pawn entity
... any other layout that may be needed for conversations

[Windows]
textwindow window receiving subtitles, this can be changed using the SetTextWindow script method
iconwindow window displaying speaker's icon, this can be changed using the SetIconWindow script method

[Scripts]
default default script typically used for general conversation orders such as starting up end exiting
... any other script that may be required by conversations

Conversation Text

The text used in conversations is defined in a utf-8 encoded conversation text file as specified in the language.ini file. This allows for each language you wish to support to have its own text file. Each conversation snippet in the conversation text file is defined by a section declaration followed by the actual text.

The character sequence <CR> indicates a new line in the conversation text and must be placed on a separate line in the TXT file. The expression <Player> will be replaced automatically with the player's name.

Conversation Dubbing

Sound files used for conversations have to be stored in the folder specified as dubbingdirectory in the language.ini file.

Conversation Script

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.

When a conversation is started the conversation layout (given by the Pawn entity or the default conversation layout if none is specified) will receive a show command. You must react to this event by binding a script method to the Shown event (see GUI Event Reference and Handling GUI Events from Simkin). This is a required task because you explicitly have to switch to the dialog state by using

DialogState.Enter();

This will make the conversation layout visible and redirect input to the GUI (player controls are disabled). You can use this event handler to do any setup work required for the conversation like hiding or showing specific windows. Finally, to start the conversation order specified in the Pawn entity use the following code fragment in the event handler:

To return to the play state you will have to call:

DialogState.Exit();

Camera, Conversation, Player and Pawn methods used in conversation scripts are executed asynchronously. For the camera, however, sync points are automatically inserted after each Speak command. When pressing the space bar to skip the text display and/or the audio playback the camera will fast-forward its movements till the next sync point is reached.

Special Pawn Conversation Methods

Speak

Special Player Conversation Methods

Speak

Camera Conversation Methods

See Camera scripting reference.

Conversation Methods

See Conversation scripting reference.