I have questions on dialogue system

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
HaiiroMukuro
Posts: 80
Joined: Sun Jul 17, 2016 3:38 pm

I have questions on dialogue system

Post by HaiiroMukuro »

Good day! :) I have questions on dialogue system.
Through Set Animation on Dialogue event, can I trigger animations by putting script in dialogue database?
How to disable the components like the third person controller, the Simple camera rotator? I'm using the third personcharacter prefab and I put a script or component on the pivot of multi purpose camera. I'm using unity standards assets.
What is the custom position from the component Selector?
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: I have questions on dialogue system

Post by Tony Li »

Hi,
HaiiroMukuro wrote:Through Set Animation on Dialogue event, can I trigger animations by putting script in dialogue database?
You will normally use Set Animation On Dialogue Event to set animation at the start or end of a conversation. For example, you can force the character into an idle animation when the conversation starts.

To trigger animations at specific dialogue entry nodes, use the Animation() sequencer command (for legacy animation) or AnimatorXXX() commands (for Mecanim). For example, to make a Mecanim character dance:
  • Dialogue Entry 1:
    • Dialogue Text: "Watch me dance!"
    • Sequence: AnimatorPlayWait(dance)
  • Dialogue Entry 2:
    • Dialogue Text: "Whew! I'm tired now!"
    • Sequence: AnimatorPlay(idle); Delay({{end}})
An alternate way is to assign an event handler to the dialogue entry node's OnExecute() event, which works similarly to the UI Button component's OnClick() event.
HaiiroMukuro wrote:How to disable the components like the third person controller, the Simple camera rotator? I'm using the third personcharacter prefab and I put a script or component on the pivot of multi purpose camera. I'm using unity standards assets.
Use Set Component Enabled On Dialogue Event to enable/disable components and/or Set Active On Dialogue Event to activate/deactivate GameObjects. For an example, see the Feature Demo scene's Player. When the player starts a conversation, it disables the movement and camera control components. When the conversation ends, it re-enables them.
HaiiroMukuro wrote:What is the custom position from the component Selector?
This allows you to specify your own screen position instead of using the Center Of Screen or Mouse Position. The Selector runs a raycast from the position into the scene to look for objects that it can select.
HaiiroMukuro
Posts: 80
Joined: Sun Jul 17, 2016 3:38 pm

Re: I have questions on dialogue system

Post by HaiiroMukuro »

Am I doing right in animations?
Image
Because I got an error.
Image


Also I got a problem for set enable on dialogue which the character moves continuously without pressing the controls. The problem occurs when you keep holding the movement controls and starts a conversation.
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: I have questions on dialogue system

Post by Tony Li »

Hi,

The error means that the animation clip ("laughing" or "Talking") isn't in the list of animation clips on Shirley's Animation component.

If Shirley has an Animator component (and not an Animation component), you should use a Set Animator State On Dialogue Event component instead. However, if you're using Unity's Standard Assets ThirdPersonController, see below.
HaiiroMukuro wrote:Also I got a problem for set enable on dialogue which the character moves continuously without pressing the controls. The problem occurs when you keep holding the movement controls and starts a conversation.
You may need to disable additional components or perform additional steps.

If you're using Unity's Standard Assets ThirdPersonController, here are the steps:

1. Add ThirdPersonUserControl to the Set Component Enabled On Dialogue Event component.

2. Add a Start Sequence On Dialogue Event component.
2a. Set the Trigger to OnConversation.
2b. Add an element to OnStart.
2c. Assign the ThirdPersonController GameObject as the element's Actor.
2d. Set the element's Sequence to:

Code: Select all

AnimatorFloat(Forward,0);
AnimatorFloat(Turn,0)
This will:

1. Turn off ThirdPersonUserControl during conversations. This prevents the user from issuing movement commands to the ThirdPersonController.

2. At the start of the conversation, set the ThirdPersonController's Animator parameters to tell the Animator to stop playing the movement animation (i.e., tell it to stop running).

Here's an example scene:

StdTPC_Example_2016-10-04.unitypackage
Post Reply