Page 1 of 1

[Help] Multiple child objects with Dialogue System Events

Posted: Thu May 23, 2019 8:44 pm
by jnhasty7
Hello,

I'm trying to disable/enable dialogue interactions after one is complete.
I'm trying to use the Dialogue System Events to achieve this, but the Dialogue System event doesn't seem to be switching the next child object to active.

So I'm trying to set active true the game object of the next dialogue, and then next set active false of the previous like shown below, but it's not working.

Image

Re: [Help] Multiple child objects with Dialogue System Events

Posted: Thu May 23, 2019 9:32 pm
by Tony Li
Hi,

What you're showing in the screenshots should work. However, the conversation must use 'Seranez' or 'Seranez explains it' as the actor or conversant GameObject. For example, if you're starting the conversation using a Dialogue System Trigger, then Seranez should be assigned to Actions > Start Conversation > Conversation Conversant or Conversation Actor. This table explains which GameObjects receive OnConversationStart and OnConversationEnd messages. If the GameObject doesn't receive the message, then the Dialogue System Events won't run.

Re: [Help] Multiple child objects with Dialogue System Events

Posted: Fri May 24, 2019 10:48 am
by jnhasty7
Thanks for the response Tony. Is this what you're talking about

Image

I have that set on both.

Could it be that I have two children with Dialogue System events, and when one conversation ends, both of those dialogue system events are running their OnConversationEnd()?

Re: [Help] Multiple child objects with Dialogue System Events

Posted: Fri May 24, 2019 11:09 am
by Tony Li
Yes, that looks correct. Here is an example scene in which I tested it:

ActivateDeactivateExample_2019-05-24.unitypackage

Perhaps you can compare it to your own scene to see if there are any important differences.

Please feel free to send an example to tony (at) pixelcrushers.com. I'll be happy to take a look.

Re: [Help] Multiple child objects with Dialogue System Events

Posted: Fri May 24, 2019 12:41 pm
by jnhasty7
By using your scene and doing some debugging, it looks like this conversation here

Image

is also triggering the Dialogue system event here

Image

before the 2nd conversation starts.
I wondering if this is intended behavior, if it is, I could try to work around it.

Re: [Help] Multiple child objects with Dialogue System Events

Posted: Fri May 24, 2019 2:05 pm
by Tony Li
Yes, that can happen. It's the way Unity handles messages.

You could remove the GameObject.SetActive entry from Dialogue System Events, and instead use the SetActive() sequencer command with a very short delay to prevent it from coming active on the same frame that the OnConversationEnd message is being sent:

setActive.png
setActive.png (22.06 KiB) Viewed 689 times