Conversations that can be "heard" only at certain distance

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Haytam95
Posts: 23
Joined: Sun Mar 15, 2020 5:56 pm

Conversations that can be "heard" only at certain distance

Post by Haytam95 »

Hi!

I'm working with SLATE sequencer and Dialogue System to time the conversations and animations. It works pretty well, you really did a good job with the integration.

Now I'm implementing some NPC dialogues (with other NPC), that triggers when the player enters certain range (I just play the SLATE sequence) and that sequence have all fragments from the conversation.

Now what i'd like to do is, that when the player is outside the range, the dialogue system don't show the UI. The conversation should continue as normal.

I thought about making a new action in the SLATE sequencer that evaluates the player distance and then decide to execute or not the fragment in the conversation, while the sequence keeps playing but i'd like to know if there is a better way to aproach this.

Edit: Also this could make two conversations active at the same time. This would be a trouble? (I'm trying to use SLATE sequencer every time i can, to adjust the time of each fragment of dialogue)
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conversations that can be "heard" only at certain distance

Post by Tony Li »

Hi,
Haytam95 wrote: Mon Mar 30, 2020 11:24 amNow what i'd like to do is, that when the player is outside the range, the dialogue system don't show the UI. The conversation should continue as normal.
You could add a big trigger collider to the NPC's area. Add a Trigger Event component to it. Configure the OnTriggerEnter() event to enable the dialogue UI's Canvas. Configure OnTriggerExit() to disable the Canvas.
Haytam95 wrote: Mon Mar 30, 2020 11:24 amEdit: Also this could make two conversations active at the same time. This would be a trouble? (I'm trying to use SLATE sequencer every time i can, to adjust the time of each fragment of dialogue)
That's fine. Tick the Dialogue Manager's Other Settings > Allow Simultaneous Conversations, and use separate dialogue UIs for them. Use Override Dialogue UI components to specify which NPC should use which dialogue UI.
User avatar
Haytam95
Posts: 23
Joined: Sun Mar 15, 2020 5:56 pm

Re: Conversations that can be "heard" only at certain distance

Post by Haytam95 »

Thanks Tony. I'll try that!
Post Reply