Page 1 of 2

Link to Another Conversation

Posted: Tue Aug 07, 2018 5:18 pm
by Alatriste
Hi,

I'm trying to polish my small game and I found out that when I change dialogues through the option "Link to", usually the last text from the previous conversation still shows up and it doesn't clean up until the new dialogue starts.

I could work around with an empty text to clean it up, but I'm not sure whether there is a better way to do that.
What I do before I change to a new conversation (and usually change the background) is using the following sequence:

Conversation A - Last Node

Code: Select all

SendMessage(Close,, Subtitle Panel 0)@2;
SendMessage(Close,, Subtitle Panel 1)@2;
SendMessage(Close,, Subtitle Panel 2)@2;
Fade(stay, 2);
Continue()@2
Conversation B - First Node (Start)

Code: Select all

Fade(in,2)
Thanks!

Re: Link to Another Conversation

Posted: Tue Aug 07, 2018 5:22 pm
by Alatriste
Also I would like to take the oportunity to ask how the SendMessage works. I read the documentation and if I understood correctly basically is just a way to communicate with other gameObjects in the scene. But, how those GO are receiving the message?

In the example above:

Code: Select all

SendMessage(Close,, Subtitle Panel 0)@2;
I see the GO Subtitle Panel 0 with the "On Close()" field. But there is nothing in. Is it working correctly or I should be attaching something?

Re: Link to Another Conversation

Posted: Tue Aug 07, 2018 5:30 pm
by Tony Li
Alatriste wrote: Tue Aug 07, 2018 5:18 pmI'm trying to polish my small game and I found out that when I change dialogues through the option "Link to", usually the last text from the previous conversation still shows up and it doesn't clean up until the new dialogue starts.
Hmm, it should work just like you linked to another node in Conversation A. Is this not the case?
Alatriste wrote: Tue Aug 07, 2018 5:22 pmAlso I would like to take the oportunity to ask how the SendMessage works. I read the documentation and if I understood correctly basically is just a way to communicate with other gameObjects in the scene. But, how those GO are receiving the message?
They use Unity's GameObject.SendMessage() method. In your example, the sequencer command will find the GameObject named "Subtitle Panel 0". This GameObject must be active. Then Unity's GameObject.SendMessage() method will examine all scripts on the GameObject. If any script has a Close() method, it will call that method.

Re: Link to Another Conversation

Posted: Wed Aug 08, 2018 3:50 am
by Alatriste
They use Unity's GameObject.SendMessage() method. In your example, the sequencer command will find the GameObject named "Subtitle Panel 0". This GameObject must be active. Then Unity's GameObject.SendMessage() method will examine all scripts on the GameObject. If any script has a Close() method, it will call that method.[
I used the send "SendMessage(Close,, Subtitle Panel 0)@2;" because I saw it in one post about how to achieve a nice fadein/fadeout effect when you do the cleaning while the fade takes places. I was assuming that the Subtitle Panel 0 which is part of the VN UI is prepared to receive this message, right?


Alatriste wrote: ↑Tue Aug 07, 2018 10:18 pm
I'm trying to polish my small game and I found out that when I change dialogues through the option "Link to", usually the last text from the previous conversation still shows up and it doesn't clean up until the new dialogue starts.
Hmm, it should work just like you linked to another node in Conversation A. Is this not the case?
It works, but the previous line is visible during a few seconds before the new conversation starts. This delay happens because I have a Fade(in, 2) in the sequence of the new conversation. My question is how to remove the previous line during the fade because something is not working (perhaps the SendMessage that I was talking about above is not doing the job because the GO is not listening anything?)
My suggestion here is that no matter what when we start a new dialogue, all UI panels should clean their content. At the moment the content seems to be there until is overwritten by a new conversation.

Re: Link to Another Conversation

Posted: Wed Aug 08, 2018 8:49 am
by Tony Li
I'll update the Close() method to clear the text. I'll post a patch file later today.

Re: Link to Another Conversation

Posted: Wed Aug 08, 2018 1:37 pm
by Alatriste
Thanks Tony! ;)

Re: Link to Another Conversation

Posted: Wed Aug 08, 2018 8:32 pm
by Tony Li

Re: Link to Another Conversation

Posted: Thu Aug 09, 2018 4:00 am
by Alatriste
Awesome! I'll try as soon as I get home!

Re: Link to Another Conversation

Posted: Fri Aug 10, 2018 9:57 am
by Alatriste
Hi,

Importing didn't fix the error. I replaced the script you sent me by the one I'm using in the Subtitle Panel of the VN Template Standard Dialogue prefab. However, after coming back from the fade, the latest text displayed in the last conversation is still displayed.

I attach the image of the parameters I'm using and the sequences used in Conversation 1 and 2. (last node and Start node respectively)

https://www.dropbox.com/s/de6trzip57zzz ... 2.jpg?dl=0

Conversation 1

Code: Select all

SendMessage(Close,, Subtitle Panel 0)@2;
SendMessage(Close,, Subtitle Panel 1)@2;
SendMessage(Close,, Subtitle Panel 2)@2;
Fade(stay, 2);
Continue()@2
Conversation 2 - Start Node

Code: Select all

Fade(in,2)

Re: Link to Another Conversation

Posted: Fri Aug 10, 2018 12:06 pm
by Tony Li
Hi,

I'm not sure how to reproduce the issue. Here is the simple example scene I'm testing with:

CloseFadeExample_2018-08-10.unitypackage