Last NPC response gets cut short while conversation is ended

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Hyrad
Posts: 26
Joined: Fri Jan 13, 2017 5:11 pm

Last NPC response gets cut short while conversation is ended

Post by Hyrad »

Hello again, I feel somehow inadequate since I seem to be the only one with this issue (and it's probably something obvious that I am missing), but when the last line of my dialog plays, I want to make sure the player has a chance to read it. Obviously I could do it by asking for player input, but I would also like to be able to set a condition for waiting until the whole response has been displayed on screen (followed by a small time delay) before gameplay resumes.

Also, I tried finding the settings for changing text speed in the DialogueManager but was unsuccessful.

Thanks,
-Jeff
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Last NPC response gets cut short while conversation is ended

Post by Tony Li »

Hi Jeff,

When the conversation is on a dialogue entry node, its Dialogue Text stays onscreen until its Sequence is done. If the dialogue entry node's Sequence field is blank, it uses the Dialogue Manager GameObject's Default Sequence (which you can find in Display Settings > Camera Settings > Default Sequence).

The Default Sequence is:

Code: Select all

Delay({{end}})
which simply waits for a duration based on the length of the Dialogue Text and some timing values set on the Dialogue Manager's Display Settings > Subtitle Settings > Subtitle Chars Per Second and Min Subtitle Seconds. (You can change the Default Sequence if you want.)

Let's say Subtitle Chars Per Second is set to 30. If your Dialogue Text is 90 characters, the Default Sequence will wait for 90/30 = 3 seconds. If you want to wait for 5 seconds instead, set the dialogue entry node's Sequence to:

Code: Select all

Delay(5)
Most people just do this. However, if you want to get more programmatic, you can use the "->Message" and "@Message" syntax in your Sequence. The "->Message" syntax sends an arbitrary message string to your sequence. The "@Message" syntax waits until it receives a message string. So, for example, to wait for 2 extra seconds:

Code: Select all

Delay({{end}})->Message(Done);
Delay(2)@Message(Done)
The first line waits for the regular {{end}} duration. When it's done, it sends a "Done" message to the sequencer. The second line waits until it receives a "Done" message, and then delays an additional 2 seconds.

Another twist to this whole topic is that the typewriter effect, if you're using it, uses an entirely different Chars Per Second than the Dialogue Manager's Display Settings > Subtitle Settings. This is intentional. It lets you separate the speed of the typewriter from the duration of the dialogue entry node. Typically your typewriter Chars Per Second should be faster (higher) than the Dialogue Manager's Subtitle Settings. This allows the typewriter to finish typing before the end of the dialogue entry node's duration. In fact, increasing the typewriter's Chars Per Second or decreasing the Dialogue Manager's Subtitle Chars Per Second may be all that you need to do to get the effect you want.
Hyrad
Posts: 26
Joined: Fri Jan 13, 2017 5:11 pm

Re: Last NPC response gets cut short while conversation is ended

Post by Hyrad »

Tony, top notch and thorough answer. Nailed it. Your quick feedback is greatly appreciated. Your help makes a big difference in putting all the pieces together quicker. Can't wait to acquire love /hate as well once we have a proper NPC setup going.

Cheers!
-Jeff
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Last NPC response gets cut short while conversation is ended

Post by Tony Li »

Always happy to help! :-)
Post Reply