Page 1 of 1

OnConversationLineEnd(Subtitle subtitle) event

Posted: Tue Sep 13, 2016 12:41 pm
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

Re: OnConversationLineEnd(Subtitle subtitle) event

Posted: Tue Sep 13, 2016 1:29 pm
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.

Re: OnConversationLineEnd(Subtitle subtitle) event

Posted: Thu Sep 15, 2016 4:41 am
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

Re: OnConversationLineEnd(Subtitle subtitle) event

Posted: Thu Sep 15, 2016 5:05 am
by Tony Li
That was a good idea. I'll still add OnConversationLine for developers who aren't using continue buttons.

Re: OnConversationLineEnd(Subtitle subtitle) event

Posted: Thu Sep 15, 2016 5:29 am
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.

Re: OnConversationLineEnd(Subtitle subtitle) event

Posted: Thu Sep 15, 2016 5:58 am
by Tony Li
I'll publish 1.6.6.4 beta 3 (with this change) to the customer download site by 18 September! :-)

Re: OnConversationLineEnd(Subtitle subtitle) event

Posted: Mon Sep 19, 2016 5:04 am
by irve
Felt like opening christmas presents on Monday morning. Many thanks!

Re: OnConversationLineEnd(Subtitle subtitle) event

Posted: Mon Sep 19, 2016 5:19 am
by Tony Li
Thanks for the suggestions in the first place! If any other requests come to mind, please let me now!

Re: OnConversationLineEnd(Subtitle subtitle) event

Posted: Mon Sep 19, 2016 11:12 am
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?

Re: OnConversationLineEnd(Subtitle subtitle) event

Posted: Mon Sep 19, 2016 11:58 am
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;
}