AC Conversation Animation Sequence Question
AC Conversation Animation Sequence Question
Hi again.
So I'm now improving the look of the conversations. I've added face player when the conversation starts and am in the process of adding the animations when talking. My NPC is a bit more complex than Idle - Talk. There are two extra transitions:
Idle - Trans To Talk - Talk - Trans to Idle - Idle
When adding the Trans To Talk AnimatorPlayWait Sequence it skips straight to the Talk sequence missing the Trans To Talk completely. When the dialogue line ends, it successfully works through the Trans To Idle - Idle which is expected and wanted. Do I need to add a delay or something so the Trans To Talk Plays once before moving on to the Talk animation. Screenshot below hopefully shows my set up:
https://www.dropbox.com/s/k7neg65isin2u ... 7.png?dl=0
Any help much appreciated, thanks.
So I'm now improving the look of the conversations. I've added face player when the conversation starts and am in the process of adding the animations when talking. My NPC is a bit more complex than Idle - Talk. There are two extra transitions:
Idle - Trans To Talk - Talk - Trans to Idle - Idle
When adding the Trans To Talk AnimatorPlayWait Sequence it skips straight to the Talk sequence missing the Trans To Talk completely. When the dialogue line ends, it successfully works through the Trans To Idle - Idle which is expected and wanted. Do I need to add a delay or something so the Trans To Talk Plays once before moving on to the Talk animation. Screenshot below hopefully shows my set up:
https://www.dropbox.com/s/k7neg65isin2u ... 7.png?dl=0
Any help much appreciated, thanks.
Re: AC Conversation Animation Sequence Question
Or is there an easy way to use my already built conversations that include the talking animations in AC but use the DS bubble, response etc panels?
Just trying to avoid lots of rework. Not a problem if not as it's good practice.
Just trying to avoid lots of rework. Not a problem if not as it's good practice.
Re: AC Conversation Animation Sequence Question
Hi,
I'll outline a few options so you can choose the one you prefer.
Option 1: If you've already set up an AC actionlist to play the whole "Dink Trans to Talk -> Dink Talk -> Dink Trans to Idle" thing, then you can run that AC actionlist. Let's say the actionlist's GameObject is named "DinkTalk". Set the Sequence field (or the Dialogue Manager's Default Player Sequence) to:
(If the Sequence field is blank, the dialogue entry node will use the Dialogue Manager's Default Player Sequence.)
The AC() sequencer command plays an AC actionlist.
---
Option 2: Animator states are case-sensitive. The command you typed in your screenshot is "Dink Trans To Talk", but the animator state is "Dink Trans to Talk" (lowercase 't').
Also, all sequencer commands will try to start immediately unless you use "@" to specify when they should run.
Try changing the sequence to this:
In the first line, the AnimatorPlayWait command sends a message to the Dialogue System when the "Dink Trans to Talk" state is done. The message is a string of your choosing. I chose "Transitioned".
In the second line, the second AnimatorWaitPlay command waits until the Dialogue System receives the message "Transitioned". Then it does its thing. Without the "@Message(Transitioned)" part, it will try to start immediately, at the same time as Dink Trans to Talk.
You can imagine that the sequence above would require a lot of typing to add to all of Dink's lines. You can instead put those commands in the Dialogue Manager's Camera & Cutscene Settings > Default Player Sequence, and leave the Sequence fields of Dink's dialogue entry nodes blank.
---
Option 3: I'm not sure how your transitions are set up and if the second line in the sequence above might cause a jump. If so, and if you know the duration of the whole "Dink Trans to Talk -> Dink Talk -> Dink Trans to Idle" thing, you could change the sequence to:
where # is the duration.
The first line starts the whole thing. The second line waits for the specified duration before progressing the conversation to the next stage.
---
Option 4: If you want to vary the duration that Dink talks based on the length of the subtitle text, remove the "Dink Talk -> Dink Trans to Idle" transition, and try this sequence:
I know that's a bit of a doozy. But you can probably just enter it once in the Dialogue Manager's Default Player Sequence field.
The first line plays the transition to talk.
The second line waits until the transition is done. Then it plays the talk state.
The third line also waits until the transition is done. Then it delays for a duration based on the text length.
The fourth line waits until the third is done. Then it plays the Dink Trans to Idle state.
I'll outline a few options so you can choose the one you prefer.
Option 1: If you've already set up an AC actionlist to play the whole "Dink Trans to Talk -> Dink Talk -> Dink Trans to Idle" thing, then you can run that AC actionlist. Let's say the actionlist's GameObject is named "DinkTalk". Set the Sequence field (or the Dialogue Manager's Default Player Sequence) to:
Code: Select all
AC(DinkTalk)
The AC() sequencer command plays an AC actionlist.
---
Option 2: Animator states are case-sensitive. The command you typed in your screenshot is "Dink Trans To Talk", but the animator state is "Dink Trans to Talk" (lowercase 't').
Also, all sequencer commands will try to start immediately unless you use "@" to specify when they should run.
Try changing the sequence to this:
Code: Select all
AnimatorPlayWait(Dink Trans to Talk)->Message(Transitioned);
AnimatorPlayWait(Dink Talk)@Message(Transitioned)
In the second line, the second AnimatorWaitPlay command waits until the Dialogue System receives the message "Transitioned". Then it does its thing. Without the "@Message(Transitioned)" part, it will try to start immediately, at the same time as Dink Trans to Talk.
You can imagine that the sequence above would require a lot of typing to add to all of Dink's lines. You can instead put those commands in the Dialogue Manager's Camera & Cutscene Settings > Default Player Sequence, and leave the Sequence fields of Dink's dialogue entry nodes blank.
---
Option 3: I'm not sure how your transitions are set up and if the second line in the sequence above might cause a jump. If so, and if you know the duration of the whole "Dink Trans to Talk -> Dink Talk -> Dink Trans to Idle" thing, you could change the sequence to:
Code: Select all
AnimatorPlay(Dink Trans to Talk);
Delay(#)
The first line starts the whole thing. The second line waits for the specified duration before progressing the conversation to the next stage.
---
Option 4: If you want to vary the duration that Dink talks based on the length of the subtitle text, remove the "Dink Talk -> Dink Trans to Idle" transition, and try this sequence:
Code: Select all
AnimatorPlayWait(Dink Trans to Talk)->Message(Talking);
AnimatorPlay(Dink Talk)@Message(Talking);
Delay({{end}})@Message(Talking)->Message(DoneTalking);
AnimatorPlayWait(Dink Trans to Idle)@Message(DoneTalking)
The first line plays the transition to talk.
The second line waits until the transition is done. Then it plays the talk state.
The third line also waits until the transition is done. Then it delays for a duration based on the text length.
The fourth line waits until the third is done. Then it plays the Dink Trans to Idle state.
Re: AC Conversation Animation Sequence Question
Wow thank you.
Ok, so I went with option 4 and I muted the transition from Dink Talk blend tree to Dink Trans To Idle blend tree and it worked a treat!
So I then input the script into Dialogue Manager's Default Player Sequence field as you suggested and I also unticked Disable Internal Sequencer Commands but that didn't work, tried ticking the Disable Internal Sequencer Commands but that didn't work either. I can input it in for each line, copy and paste is fine just a bit time consuming. Is it because it's the NPC rather than Player?
I need to set up the Player's talk animations anyway so I can test it. Her's is just Idle - Talk blend tree so should be easier.
Ok, so I went with option 4 and I muted the transition from Dink Talk blend tree to Dink Trans To Idle blend tree and it worked a treat!
So I then input the script into Dialogue Manager's Default Player Sequence field as you suggested and I also unticked Disable Internal Sequencer Commands but that didn't work, tried ticking the Disable Internal Sequencer Commands but that didn't work either. I can input it in for each line, copy and paste is fine just a bit time consuming. Is it because it's the NPC rather than Player?
I need to set up the Player's talk animations anyway so I can test it. Her's is just Idle - Talk blend tree so should be easier.
Re: AC Conversation Animation Sequence Question
Doh, sorry, I forgot that Dink isn't the player.
Please try this:
1. Put that sequence the Dialogue Manager's Default Sequence so it will apply to the NPC. You might want to consider renaming the animator states to "Trans to Talk", "Talk" and "Trans to Idle" without specifying an NPC name. This way the sequence can apply generally to any NPC.
2. For now, set the Dialogue Manager's Default Player Sequence to:
When Dawes' animation is ready, you can change it. Or, if it ends up being the same as Default Sequence, you can just leave it blank. If it's blank, it will use the Default Sequence.
3. Untick Disable Internal Sequencer Commands. This checkbox turns off most of the built-in sequencer commands. It's only intended for developers who want to replace the built-in sequencer commands with their own.
Please try this:
1. Put that sequence the Dialogue Manager's Default Sequence so it will apply to the NPC. You might want to consider renaming the animator states to "Trans to Talk", "Talk" and "Trans to Idle" without specifying an NPC name. This way the sequence can apply generally to any NPC.
2. For now, set the Dialogue Manager's Default Player Sequence to:
Code: Select all
Delay({{end}})
3. Untick Disable Internal Sequencer Commands. This checkbox turns off most of the built-in sequencer commands. It's only intended for developers who want to replace the built-in sequencer commands with their own.
Re: AC Conversation Animation Sequence Question
And we are winning! Thanks yet again!
Plenty to be getting on with now. I'll be adding some Barks at some point but I'm hoping that'll be straight forward.
Plenty to be getting on with now. I'll be adding some Barks at some point but I'm hoping that'll be straight forward.
Re: AC Conversation Animation Sequence Question
You're welcome! Yup, barks are a bit easier.
Re: AC Conversation Animation Sequence Question
And I'm back!
So this time, I want to press space bar after each line of dialogue. It works up to a point but the default player talking animation continues and never stops, so I'm assuming I need to add something like an interruption source or an 'If' statement to the Default Player Sequence so the player stops talking? Also, after I press Space Bar after the Player says her line, as well as the talking animation continuing, the NPC's dialogue line only flashes on screen for a second. The gameplay continues but of course so does the talking animation. I don't want a continue button image or text so I've removed the source image and disabled the text child item.
This is what I've done so far:
1. Added a Continue Button as a child to the Bubble Panel which is a child to the Bubble Standard Template
2. Ensured On Click () points to the Bubble Standard Template which is the child of the Player
3. Runtime only, StandandUISubtitlePanel.OnContinue
4. Ensured the Dialogue Manager has the Continue Button Activated and I've tried Always, Optional etc.
I tried adding another On Click () where I selected my Player and selected StopSpeaking, but that didn't work either.
Please let me know if you need any further information or a screenshot.
Many thanks.
So this time, I want to press space bar after each line of dialogue. It works up to a point but the default player talking animation continues and never stops, so I'm assuming I need to add something like an interruption source or an 'If' statement to the Default Player Sequence so the player stops talking? Also, after I press Space Bar after the Player says her line, as well as the talking animation continuing, the NPC's dialogue line only flashes on screen for a second. The gameplay continues but of course so does the talking animation. I don't want a continue button image or text so I've removed the source image and disabled the text child item.
This is what I've done so far:
1. Added a Continue Button as a child to the Bubble Panel which is a child to the Bubble Standard Template
2. Ensured On Click () points to the Bubble Standard Template which is the child of the Player
3. Runtime only, StandandUISubtitlePanel.OnContinue
4. Ensured the Dialogue Manager has the Continue Button Activated and I've tried Always, Optional etc.
I tried adding another On Click () where I selected my Player and selected StopSpeaking, but that didn't work either.
Please let me know if you need any further information or a screenshot.
Many thanks.
Re: AC Conversation Animation Sequence Question
Hi,
Assuming your sequence looks like this:
Add the "required" keyword to the last line:
The only difference is that I added "required" at the front of the last line. This guarantees that it will play Trans To Idle even if the player skips ahead using the continue button.
By default, Unity UI uses the space bar to "click" the currently-focused UI button, which is the continue button in this case. Please try this:
1. Inspect the Dialogue Manager GameObject's Input Device Manager component. Tick Always Auto Focus. This will make sure it always focuses the continue button when it's shown.
2. Inspect your continue button. If it has a UI Button Key Trigger component, remove it. This component lets you map a hotkey to the UI button. It might be mapped to the space bar. If this is the case, then the space bar will end up clicking the continue button twice: once because Unity UI always clicks the focused button when you press space, and a second time by the UI Button Key Trigger component. If it clicks the button twice, the next line (the NPC) may interpret that as a signal to skip ahead, too.
Assuming your sequence looks like this:
Code: Select all
AnimatorPlayWait(Trans to Talk)->Message(Talking);
AnimatorPlay(Talk)@Message(Talking);
Delay({{end}})@Message(Talking)->Message(DoneTalking);
AnimatorPlayWait(Trans to Idle)@Message(DoneTalking)
Code: Select all
AnimatorPlayWait(Trans to Talk)->Message(Talking);
AnimatorPlay(Talk)@Message(Talking);
Delay({{end}})@Message(Talking)->Message(DoneTalking);
required AnimatorPlayWait(Trans to Idle)@Message(DoneTalking)
By default, Unity UI uses the space bar to "click" the currently-focused UI button, which is the continue button in this case. Please try this:
1. Inspect the Dialogue Manager GameObject's Input Device Manager component. Tick Always Auto Focus. This will make sure it always focuses the continue button when it's shown.
2. Inspect your continue button. If it has a UI Button Key Trigger component, remove it. This component lets you map a hotkey to the UI button. It might be mapped to the space bar. If this is the case, then the space bar will end up clicking the continue button twice: once because Unity UI always clicks the focused button when you press space, and a second time by the UI Button Key Trigger component. If it clicks the button twice, the next line (the NPC) may interpret that as a signal to skip ahead, too.
Re: AC Conversation Animation Sequence Question
Thank you.
Ah that'll be useful for Dink the NPC. (Deselected the trigger components and that's working now.)
I was working on the Player.
I added the below and it seems to work, not sure if this is a long winded way. though.
AnimatorPlayWait(DawesIdle)->Message(Talking); AnimatorPlay(DawesTalk)@Message(Talking); Delay({{end}})@Message(Talking)->Message(DoneTalking);
required AnimatorPlayWait(DawesIdle)@Message(DoneTalking);
AnimatorPlay(DawesIdle)@Message(DoneTalking)
Ah that'll be useful for Dink the NPC. (Deselected the trigger components and that's working now.)
I was working on the Player.
I added the below and it seems to work, not sure if this is a long winded way. though.
AnimatorPlayWait(DawesIdle)->Message(Talking); AnimatorPlay(DawesTalk)@Message(Talking); Delay({{end}})@Message(Talking)->Message(DoneTalking);
required AnimatorPlayWait(DawesIdle)@Message(DoneTalking);
AnimatorPlay(DawesIdle)@Message(DoneTalking)