Page 1 of 1
Dialogue System Events + Playmaker
Posted: Sat Jan 02, 2021 8:07 am
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!
Re: Dialogue System Events + Playmaker
Posted: Sat Jan 02, 2021 8:21 am
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.
Re: Dialogue System Events + Playmaker
Posted: Sat Jan 02, 2021 10:17 am
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.
Re: Dialogue System Events + Playmaker
Posted: Sat Jan 02, 2021 11:11 am
by Tony Li
Hi,
There are two PlayMaker Support packages. Please also import the one in Plugins / Pixel Crushers / Dialogue System / Third Party Support.
Re: Dialogue System Events + Playmaker
Posted: Sat Jan 02, 2021 2:17 pm
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.
Re: Dialogue System Events + Playmaker
Posted: Sat Jan 02, 2021 3:15 pm
by Tony Li
Hi,
Yes, that's correct. Assign each of your FSMs to "Dialogue System Events To PlayMaker":
- dialogueSystemEventsToPlayMaker.png (46.84 KiB) Viewed 1046 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 (33.81 KiB) Viewed 1046 times
Re: Dialogue System Events + Playmaker
Posted: Sun Jan 03, 2021 8:04 am
by maxrostov
Now it works!
Here's a recording of the solution:
https://share.vidyard.com/watch/mYuUgYEyKqMR8mcvtKEYo6?
Thank you!
Re: Dialogue System Events + Playmaker
Posted: Sun Jan 03, 2021 9:09 am
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.
Re: Dialogue System Events + Playmaker
Posted: Sun Jan 03, 2021 2:17 pm
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
Re: Dialogue System Events + Playmaker
Posted: Sun Jan 03, 2021 2:42 pm
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.