OnConversationLineEnd(Subtitle subtitle) event

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
alfonso
Posts: 104
Joined: Mon Jul 13, 2015 6:31 am

OnConversationLineEnd(Subtitle subtitle) event

Post by alfonso »

Hi tony!

i have one question / suggestion, it's possible to add this event to alert the participant of a node that the node has been finished?

it's because i have a conversation with 3 conversant, and this work perfectly by events (OnConversationLine), i start the "talking" and "idle" animation of the participant and actor of a conversation, and this works but when i put another participant in de conversation this recive the OnConverstionLine event but never knows when their nodes ended, so it stays talking forever.

Thnks :D
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnConversationLineEnd(Subtitle subtitle) event

Post by Tony Li »

Hi Alfonso,

Yes, I'll add it in the next version.

BTW, you can also control the animation using the Sequence field. For example:

Code: Select all

Animation(talking); required Animation(idle)@{{end}}
The sequence above will play the "talking" animation on the current speaker. At the end of the line, it will play the "idle" animation. The "required" keyword guarantees that it will play "idle" even if the player cancels the line early. The Animation() sequencer command is for legacy animation. If you're using Mecanim, use AnimatorPlay() instead.
alfonso
Posts: 104
Joined: Mon Jul 13, 2015 6:31 am

Re: OnConversationLineEnd(Subtitle subtitle) event

Post by alfonso »

Thanks tony :), sorry for the late response, finally i hook the event inside OnContinue method, i think is the last think the system call before the start of the next node, so in this method i already have the current actor and conversant of the node, i tested and work so fine for me :)


Thanks so much for all :D
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnConversationLineEnd(Subtitle subtitle) event

Post by Tony Li »

That was a good idea. I'll still add OnConversationLine for developers who aren't using continue buttons.
irve
Posts: 53
Joined: Fri Jan 15, 2016 9:35 am

Re: OnConversationLineEnd(Subtitle subtitle) event

Post by irve »

I actually came here to ask something similar.

We took control of showing/hiding continue button since DS did not what we wanted and we probably do not still know what we eventually want.

But we need a way to know when the sequence ends since we want to hide continue up to that point (or perhaps show a "skip" button. So getting the OnConversationLineEnd from sequencer would make worlds of difference.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnConversationLineEnd(Subtitle subtitle) event

Post by Tony Li »

I'll publish 1.6.6.4 beta 3 (with this change) to the customer download site by 18 September! :-)
irve
Posts: 53
Joined: Fri Jan 15, 2016 9:35 am

Re: OnConversationLineEnd(Subtitle subtitle) event

Post by irve »

Felt like opening christmas presents on Monday morning. Many thanks!
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnConversationLineEnd(Subtitle subtitle) event

Post by Tony Li »

Thanks for the suggestions in the first place! If any other requests come to mind, please let me now!
irve
Posts: 53
Joined: Fri Jan 15, 2016 9:35 am

Re: OnConversationLineEnd(Subtitle subtitle) event

Post by irve »

Since OnConversationEndLine runs after I click continue it is not useful for determining the suitable time when to show the button (to switch from "skip" to "continue").

Could we get OnSequenceStart() and OnSequenceEnd() on the DialogueManager gameObject? Currently we only get it on the speaker and listener.
Or is there any other way to get a callback on the sequence being ready?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnConversationLineEnd(Subtitle subtitle) event

Post by Tony Li »

irve wrote:Could we get OnSequenceStart() and OnSequenceEnd() on the DialogueManager gameObject? Currently we only get it on the speaker and listener.
Yes. I'll add that in a patch and publish it this week.
irve wrote:Or is there any other way to get a callback on the sequence being ready?
If you're using Unity UI Typewriter Effect, it has OnBegin, OnCharacter, and OnEnd events. I don't know if that would be helpful. Without having to write any code, you could add an event to OnBegin that sets the continue button's text to "Skip", and add an event to OnEnd that sets the continue button's text to "Continue".

If you don't want to time this according to the typewriter effect, another way is to use the @Message and ->Message syntax inside the sequence. For example:

Code: Select all

SendMessage(ChangeContinueText,Skip,MyGameObject);
AudioWait(Voiceover/blahblahblah)->@Message(DoneTalking);
SendMessage(ChangeContinueText,Continue,MyGameObject)@Message(DoneTalking)
This assumes you have a GameObject named MyGameObject with a script that has a method ChangeContinueText(string newValue):

Code: Select all

public UnityEngine.UI.Button continueButton;

public void ChangeContinueText(string newValue) {
    continueButton.GetComponentInChildren<UnityEngine.UI.Text>().text = newValue;
} 
Post Reply