Page 1 of 1
Possible responses to Playmaker, then chosen response back to Dialogue System?
Posted: Wed Jun 14, 2017 6:22 pm
by PenguStudios
Hi!
I'm making a VR adventure for the Vive. I'm mostly using PlayMaker.
I'd like to skip a text based response UI menu all together. Instead I'd like to use the player's physical actions to choose a response.
To do that, I recon I would need to get the possible responses from Dialogue System to PlayMaker everytime there is a choice in the conversation. Then I would need to somehow send the chosen response from PlayMaker to Dialogue System so the conversation can continue.
How could I do that?
I've discovered the OnConversationResponseMenu event. So that's a start. But then what?
Thanks a lot for your help!
Markku
Pengu Studios
Re: Possible responses to Playmaker, then chosen response back to Dialogue System?
Posted: Wed Jun 14, 2017 7:17 pm
by Tony Li
Hi!
There are a few ways you could approach this.
Normally, as you've seen, a dialogue UI component such as Unity UI Dialogue UI shows the responses in a UI panel. You can hide that menu by setting the panel's Alpha to zero or by placing it offscreen or scaled to (0,0,0) size.
The next step might be to map the player's physical actions to UI buttons in the (invisible) response menu. So when the player nods up and down, your FSM always clicks button 0. When the player shakes his or her head left and right, it always clicks button 1, etc.
If the requirements are more complex, such as choosing between picking up a red block or a blue block in one case, and punching or hugging an NPC in another case, your FSM might need to use some kind of logic to decide how to map actions to dialogue responses.
The OnConversationResponseMenu event just informs your FSM that a response menu is about to be shown. Unlike events such as OnConversationStart (which passes the player's GameObject), the OnConversationResponseMenu event doesn't pass any additional information. I could change this if it would be helpful.
Otherwise, if you're comfortable with scripting, you can make a subclass of UnityUIDialogueUI and override the ShowResponses() method. This method receives an array of possible responses. Normally UnityUIDialogueUI shows those responses in a UI panel. But your subclass could instead wait for the player to take an action, and then pass the corresponding response to the OnClick() method.
I hope that wasn't too confusing. If you wouldn't mind describing a typical scenario that you'd like to set up, I can probably describe the steps in a more simple and direct way.
Re: Possible responses to Playmaker, then chosen response back to Dialogue System?
Posted: Thu Jun 15, 2017 4:53 am
by PenguStudios
Hi!
Thanks so much for the fast reply! I'll look into the scripting side of things.
I've emailed you (
support@pixelcrushers.com ) with a short video to explain what I'm trying to do.
It would be truly great, if somehow there was a way to pass information to Playmaker about the responses that are available upon OnConversationResponseMenu event.
And then the final step would be to pass the chosen response to OnClick() method (?) with Playmaker.
Cheers!
Markku
Re: Possible responses to Playmaker, then chosen response back to Dialogue System?
Posted: Thu Jun 15, 2017 10:43 pm
by Tony Li
The
Dialogue System Extras page has an updated PlayMaker Support package, which you can also download
here.
An example scene is here:
PlayMakerResponseMenuExample_2017-06-15.unitypackage
This package adds a new action named "Select Response". The OnConversationResponseMenu event now also passes the responses' Menu Texts as a concatenated string. You can specify the separator character (e.g., ';') in the Dialogue System Events To PlayMaker's Event Data section.