Dialogue System Events + Playmaker

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
maxrostov
Posts: 7
Joined: Tue Dec 29, 2020 11:49 am

Dialogue System Events + Playmaker

Post by maxrostov »

Hi,
I'm trying to disable Player Character controller (Made in Playmaker) on conversation start, and enable it again on conversation end.

I have two FSM's. One is the controller, and other one is the direction that the player faces (left and right, using Set Scale on Get Key Down).

I successfully disabled the controller by choosing PlaymakerFSM -> Bool Enabled.
I did the same for the FSM that controls the facing direction. But it didn't work.

Is there a way to disable the whole FSM component, instead of disabling the Bool in it?

See pictures for reference.

All help is appreciated :)
Thank you!
Attachments
This does not work
This does not work
Screenshot 2021-01-02 at 14.05.46.png (477.42 KiB) Viewed 1063 times
This is working
This is working
Screenshot 2021-01-02 at 14.04.38.png (537.03 KiB) Viewed 1063 times
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System Events + Playmaker

Post by Tony Li »

Hi,

There are a few different ways you can do it.

You can add a Dialogue System Events To PlayMaker component to the player. In PlayMaker, define events named "OnConversationStart" and "OnConversationEnd". The Dialogue System Events To PlayMaker component will raise these events when the player is involved in a conversation. Your FSMs can transition to a new "In Dialogue" state while the conversation is active. I like this solution because you can easily see the current state of the FSMs in the PlayMaker editor window.

Your Dialogue System Events solution should work, but instead of investigating why it doesn't, I recommend the approach above. A problem with disabling the FSM is that it might reset values in the FSM that you don't want to reset.
maxrostov
Posts: 7
Joined: Tue Dec 29, 2020 11:49 am

Re: Dialogue System Events + Playmaker

Post by maxrostov »

Hi,
I've imported the Dialogue System Support and Playmaker Support - But I still can't find Dialogue System Support to Playmaker under Component > Dialogue System > Third Party > PlayMaker > Dialogue System Events to PlayMaker.

The only thing I've found was Message System to Playmaker, I assume that's not the same thing.
Attachments
Screenshot 2021-01-02 at 16.17.30.png
Screenshot 2021-01-02 at 16.17.30.png (885.92 KiB) Viewed 1055 times
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System Events + Playmaker

Post by Tony Li »

Hi,

There are two PlayMaker Support packages. Please also import the one in Plugins / Pixel Crushers / Dialogue System / Third Party Support.
maxrostov
Posts: 7
Joined: Tue Dec 29, 2020 11:49 am

Re: Dialogue System Events + Playmaker

Post by maxrostov »

Hi,
I've found the right plugin, thank you!

I couldn't figure out what to do with it though.
You said I need to define "OnConversationStart" and "OnConversationEnd" in the FSM component.

Do you mean that I have to create two new events in my "Character Direction"-FSM, in which "OnConversationStart (and End) will be defined? If so, what action should I use in the state (the state that will disable actions if conversation is active)?

Or do you mean that I have to create an additional FSM, which will control the dialogue (instead of having Dialogue System Trigger component)?
If so, should I add the FSM to the Dialogue System Events To PlayMaker, as I did in the attached photo?
Also, could you please refer to a manual that describes how to use The Dialogue System with Playmaker?

Thank you for your patience.
Attachments
Is this correct?
Is this correct?
Screenshot 2021-01-02 at 20.13.31.png (436.01 KiB) Viewed 1052 times
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System Events + Playmaker

Post by Tony Li »

Hi,

Yes, that's correct. Assign each of your FSMs to "Dialogue System Events To PlayMaker":

dialogueSystemEventsToPlayMaker.png
dialogueSystemEventsToPlayMaker.png (46.84 KiB) Viewed 1047 times

In each FSM, add OnConversationStart and OnConversationEnd events, and add a state that makes that FSM do nothing while in a conversation:

playMakerHandleEvent.png
playMakerHandleEvent.png (33.81 KiB) Viewed 1047 times
maxrostov
Posts: 7
Joined: Tue Dec 29, 2020 11:49 am

Re: Dialogue System Events + Playmaker

Post by maxrostov »

Now it works!

Here's a recording of the solution:
https://share.vidyard.com/watch/mYuUgYEyKqMR8mcvtKEYo6?

Thank you!
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System Events + Playmaker

Post by Tony Li »

Hi,

Great! Using the "Is Conversation Active" PlayMaker action like you're doing will work fine, too. It polls the Dialogue System every frame, whereas Dialogue System Events To PlayMaker (as in my previous reply) is slightly more efficient because it only checks when a conversation actually starts and ends. But, in practice, both should be totally fine performance-wise.
maxrostov
Posts: 7
Joined: Tue Dec 29, 2020 11:49 am

Re: Dialogue System Events + Playmaker

Post by maxrostov »

Hi!
I suspected that I misinterpreted your solution.

What Action should I use in the "Idle" and "In Dialogue" state? (what action checks when a conversation starts and ends)?
Are there specific actions that "plays together" with the "Dialogue system events to playmaker" component in the FSM?

I would like to do it the right way from the get go :)
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System Events + Playmaker

Post by Tony Li »

Hi,

I depends on what your FSMs do. The "In Dialogue" state should stop the player and then not respond to player movement input. For example, if your Player Controller FSM uses "Set Animator Float" and "Set Velocity 2D", then your "In Dialogue State" could use those same actions to set the "speed" parameter to zero and the velocity to zero.
Post Reply