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, but there can be an infinite number of dialogues in any given dialogue list. The idea is that after one dialogue finishes playing, the next begins. You can use 'RequiredEvents' to control the timing and flow of dialogue.


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.

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.

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.


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 it's list each time the Dialogue Spot is triggered, instead of playing the entries in order.