Playing a sequence between dialogue text

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
samcsss
Posts: 9
Joined: Thu Sep 17, 2015 6:06 am

Playing a sequence between dialogue text

Post by samcsss »

I've been trying to figure this out for a while and I've got a working solution. I just wanted to check if there is an easier way I should be handling things, because what I've come up with is not exactly obvious.

The behaviour I want is as follows:
- Text will display using the 'continue' button. The player must click 'continue' to advance the conversation (this is a language learning game so the player needs to confirm they read and understood the text)
- I have 3 dialogue texts display and then I want the player character to (automatically) move to a new location in the level and the dialogue continue
- I've written a custom sequence command to handle moving the player (called NavigateTo)
- The sequence to move the player must activate at the end of the 3rd piece of text, and then the next text in the sequence displays once the player has arrived at the new location

I've been trying for a while to find something that will work. This is the first solution I've found that works:

- put the 3 dialogue texts into 3 separate Dialogue Entries
- turn on the 'continue' button in the Dialogue Manager
- Add an empty Dialogue Entry and link it to the last text entry. This entry has no text and no actor/conversant, only the following script:

Code: Select all

NavigateTo(Player, Living Rm Marker)->Message(Done);
SendMessage(OnContinue, , Generic Unity UI Dialogue UI)@Message(Done);
- Then I have the next text sequence in Dialogue Entries linked from the entry containing only the sequence

(The "Generic Unity UI Dialogue UI" object is the one with the UnityUIDialogueUI script attached. The SendMessage function simulates the 'continue' button being pressed. Without this, this Dialogue Entry never actually ends - I guess because the Dialogue Text field is empty)

I tried doing something like this:

Code: Select all

NavigateTo(Player, Living Rm Marker)->{{end}}
But the {{end}} seems to be based on how long the text should be displayed for - which means the NavigateTo starts automatically without the 'continue' button being pressed.
Also, if the continue button is pressed before this timeout, the NavigateTo is never called

So is there a better way to ensure my script gets processed when one dialogue message closes but before the next one opens?
Did I miss an easier way?
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Playing a sequence between dialogue text

Post by Tony Li »

Hi,

You basically have it. A few tips:

1. Use the SetContinueMode() sequencer command to disable and re-enable the continue button.

2. You don't have to type the commands manually. The "+" button to the right of the Sequence has a dropdown with common commands:

Image

Since you're also working in a custom command, you'll need to fix up the others a bit by adding "@Message(Done)":

Code: Select all

SetContinueMode(false);
NavigateTo(Player, Living Rm Marker)->Message(Done);
SetContinueMode(true)@Message(Done);
SendMessage(OnContinue,,Dialogue Manager,broadcast)@Message(Done)
Post Reply