Adding Dialogue

From Tripwire Interactive Wiki
Jump to navigation Jump to search

Dialogue can be a good way to get players interested in your map's story. It can be presented as text only, or as a combination of text and audio. There can only be one dialogue box active at any given time on the player's screen.


Creating a Dialogue Spot

To add dialogue to your map, you must first place a KF_DialogueSpot actor. You can find it in the actor classes browser under Info-->KF_DialogueSpot. There is no limit to the number of Dialogue Spot actors you should have in your map. Tripwire maps generally have one Dialogue Spot for each major 'conversation'.

AddingDialogue.jpg

Adding a Dialogue Entry

Once you have created a Dialogue spot actor you need to create a new dialogue entry. Select the Dialogue Spot and press F4 to open its properties window. Expand the KF_DialogueSpot category and click on the 'Dialogues' array. Click 'Add' to create a new Dialogue entry.

NewDlgEntry.jpg

As with any other array, dialogue entries will try to play in the order they are entered. So if you want to have multiple people speaking to each-other in a single Dialogue Spot, try to order them in a way that is logical the first time around. It's pretty easy to add entries to the Dialogues array, but it can be a pain if you have to delete and re-order them at a later time.


Configuring your Dialogue Entry

There are a number of configurable properties available for each dialogue entry in the dialogue list. You can change the appearance of the dialogue window, add voice overs and set headers or portrait materials which appear next to the dialogue as it displays.

DialogueBox.jpg

General Dialogue Properties

Variable Name Variable Type Description
bLooping Bool If set to true, this dialogue will continue playing over and over.
BroadcastScope Enum This determines which players will receive the dialogue broadcast. By default, all players will hear / see dialogue as it is triggered. If you set the scope to 'instigator only', then only the person who caused the dialogue to play will see it.

Display Properties

These properties control the appearance of the dialogue on the HUD, as well as storing the text that should be displayed.

Variable Name Variable Type Description
Dialogue_Header Localized String This text will appear at the top of the dialogue window. It is often the name of the person who is speaking, but it doesn't have to be. If you type 'self' in this field it will display your steam name.
Dialogue_Text Enum This determines which players will receive the dialogue broadcast. By default, all players will hear / see dialogue as it is triggered. If you set the scope to 'instigator only', then only the person who caused the dialogue to play will see it.
Portrait_BinkMovie String If you would like to play an animated movie next to your dialogue you can do that by entering the name of the .bink movie file here. (needs to be in your KillingFloor\Movies\ folder). Do not include the extension.
Portrait_Material Material If you would like to show a texture next to your dialogue text you should enter that here. In Tripwire maps it is usually the face of the person who is speaking to you.
Screen_BGMaterial Material This is the material that will render behind the dialogue text. If you leave it empty it will default to the standard Killing Floor 'Red box' texture. If you want there to be no background at all then plug an invisible material in here.
Screen_Position Struct Sets the Horizontal and Vertical screen position of the Dialogue window as a percentage of the total pixels on the screen. A value of (0.5,0.5) would be dead-center in the middle of the player's screen.
Screen_Scaling Enum Determines how the Screen_BGMaterial gets scaled to fit the text block. Only relevant if you have a background material that tiles a particular way.

Dialogue Events

This category contains a list of events that dialogue can trigger before, during and after it plays.

Variable Name Variable Type Description
DisplayedEvent Name This event will be triggered after the dialogue has completely finished playing.
DisplayingEvent Name This event will be triggered the very second the dialogue begins playing.
RequiredEvent Name If you have multiple dialogues, setting an event here will cause the dialogue chain to halt until it receives an event of that name. Think of it like a 'pause' command.

Dialogue Voiceover

This category contains a list of variables relevant to playing dialogue voiceover audio.

Variable Name Variable Type Description
SourceActor Actor This is the actor you'd like the voiceover audio to emanate from. The actor's sound properties will determine volume and attenuation. If you leave this blank the voicover will play non-spatialized/attenuated audio which is probably preferable in most cases.
VoiceOverSound Sound This is the sound wave file you want to play with your dialogue text. The duration the dialogue will appear for is determine by the length of this audio file. If there is none, it will default to 0.5 seconds per word in the text string.


Playing the Dialogue

Dialogue will not play automatically, it needs to be triggered to do so! Set a 'tag' value for your Dialogue Spot actor and trigger it when you would like the first line of dialogue to commence. Subsequent dialogue entries will play one after another until it reaches an entry with a 'Required Event' at which point it will pause the dialogue playback until the event is received. If a Required Event is received for a dialogue that is not next in the list, it will automatically skip to and play this entry. Something to be aware of if you plan to play dialogue out of order.

Randomization

Dialogue can also be randomized. This can be useful if you want to have continuous taunting from an enemy, or encouragement from an allied NPC. To randomize dialogue you must have more than one entry in your dialogues array. By setting the bRandomize flag in the Dialogue Spot's properties your dialogue spot will randomly pick one entry from its list each time the Dialogue Spot is triggered, instead of playing the entries in order.