Dialogue System Events to PlayMaker (?)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

Dialogue System Events to PlayMaker (?)

Post by Abelius »

Hi there,

I've read this manual section...:

http://www.pixelcrushers.com/dialogue_s ... akerEvents

...but I can't get to work the thing as I am expecting it to behave. And to be honest, I'm not even sure if I've understood correctly what it's supposed to do.

My main objective is to trigger PlayMaker actions inside an FSM, in an "ENGINE" GameObject, when a conversation starts and ends. To hide and show some UI elements, to be accurate.

I know I could do that the normal way, with the conventional Dialogue System Events component but, from what I've understood in the manual, Dialogue System Events to PlayMaker could be a better solution as it seems to "broadcast" events to all active FSMs (?).

So I went and added that component to Dialogue System Manager and then I've created an 'OnConversationStart' event on an FSM, declared it as 'global' and made this test FSM...:

Image

'Disable UI' deactivates my UI panels... but it never gets executed, as 'OnConversationStart' doesn't get called.

I then went and filled out these fields inside the component...:

Image

...just in case, but it's still not working.

So, what am I doing wrong here? Did I misunderstand what 'Dialogue System Events to PlayMaker' is supposed to do?

Thank you.
Unity 2019.4.9f1
Dialogue System 2.2.15
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System Events to PlayMaker (?)

Post by Tony Li »

Hi,

That's what this component is supposed to do. For this component to receive OnConversationStart messages (so it can pass them to PlayMaker), it needs to be on a GameObject that receives the messages. Make sure the component is on your Dialogue Manager GameObject or one of the conversation participants.

If that looks OK, then prior to assigning an FSM to the FSMs list the Unity editor's Console window probably showed this message:

Code: Select all

Dialogue System: Want to send event OnConversationStart but no FSMs are assigned to Dialogue System Events To Play Maker.
Now that you've assigned your FSM, it shouldn't log that message. If you tick Debug, the Console should log a line similar to this:

Code: Select all

Dialogue System: Sending OnConversationStart to ENGINE
If you see that line but the FSM still isn't receiving the event, double-check that your event is spelled correctly and that it doesn't have any leading or trailing space characters.

Here's an example scene: DialogueSystemEventsToPlayMakerExample_2017-12-31.unitypackage
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

Re: Dialogue System Events to PlayMaker (?)

Post by Abelius »

Hi Tony, happy new year! :D

I've activated the Debug checkbox and it says this...:

Image

So it is sending events alright, but not to all FSMs in ENGINE. Only 'RunOnceFSM' (first one) get them, which won't have any use for them.

Anyway, what I've done is to create a GameObject with an FSM that forwards ALL events to ENGINE, and set it as the receiver of DS2PM events...:

Image

Image

This implies an additional step, but as it is automated and I won't need to do anything more when I add more reactions to DS events in 'ENGINE', I don't mind it at all.

I'm just curious about if receiving events by the original FSM only, is a known limitation or not (?).

Thank you!
Unity 2019.4.9f1
Dialogue System 2.2.15
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System Events to PlayMaker (?)

Post by Tony Li »

Happy New Year!

Dialogue System Events To PlayMaker sends events to all FSMs assigned to the FSMs list. If you have multiple FSMs on a GameObject, Unity's inspector doesn't show it in a very helpful way because for each FSM it shows the GameObject name, which is the same for all of them:

Image

But it will still work fine. It's just a visual limitation with Unity default inspector.
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

Re: Dialogue System Events to PlayMaker (?)

Post by Abelius »

Oooh... okay, now I understand what was happening...!

I've assigned DS2PM events script to the Dialogue System Manager, not the ENGINE GameObject itself, so I couldn't drag & drop those FSM components to the list in the same Inspector window. :P

You may want to clarify that in the Manual then, because it could be interpreted as if this script could be placed in ONE gameobject only. ;)

Many thanks!

Edit: Mmm, I've written this before actually trying it, and now I don't get any message from the Console saying the script is sending any DS event. :?

Image

The script doesn't seem to work for me, if it's outside Dialogue System Manager (?)
Unity 2019.4.9f1
Dialogue System 2.2.15
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System Events to PlayMaker (?)

Post by Tony Li »

Abelius wrote: Mon Jan 01, 2018 11:07 amYou may want to clarify that in the Manual then, because it could be interpreted as if this script could be placed in ONE gameobject only.
Will do.
Abelius wrote: Mon Jan 01, 2018 11:07 amThe script doesn't seem to work for me, if it's outside Dialogue System Manager (?)
It needs to be on the Dialogue Manager or one of the conversation participants because those are the GameObjects that receive the OnConversationXXX messages.
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

Re: Dialogue System Events to PlayMaker (?)

Post by Abelius »

Ah, that explains why it wasn't doing anything.

Okay, I'll stick to the 'Forward All Events' FSM in the middle then.

Thank you!
Unity 2019.4.9f1
Dialogue System 2.2.15
Post Reply