Questions around Custom Speech Bubbles
-
- Posts: 46
- Joined: Thu Nov 08, 2018 5:47 am
Questions around Custom Speech Bubbles
Hi Tony,
I open a new thread following this one (https://www.pixelcrushers.com/phpbb/vie ... 016#p16016).
I have some different questions, but they are all about my DSFU setup which is basically a comic book setup (many speakers freely positioned in 2D Canvas, having many portraits/emotions with different speech bubbles that are instanced).
I'd like to start with this question:
How do I change the current sequence of a dialogue entry so that it's change reflects in the current spoken line to trigger an animation?
My setup:
1. a default sequence on DialogueManager:
AnimatePortrait(Idle)@{{end}};
AudioWait(entrytaglocal, speaker, silence_1s);
2. each dialogue entry's sequence is:
{{default}}
3. now I'd like to change the dialogue entrys sequence to:
AnimatePortrait("Animation");
{{default}}
-> where "Animation" is a variable. I have several portrait animations (e.g. Talking, Idle, Shouting, Screaming..) and depending on the speakers' emotion (a custom field I added) a defined portrait animation should be played.
I have defined the link between emotion and animation in a scriptable object. On DialogueManager, I have a class with OnConversationLine(Subtitle subtitle) and in this, I change "subtitle.dialogueEntry.currentSequence" in a way so it equals what I've written under 3.
What happens now is that OnConversationLine changes the currentSequence AFTER the sequencer already executed whatever sequence is defined (in this case the default sequence from 1.) - therefore of course, "AnimatePortrait("Screaming") is not played. But what I would need is that the sequencer executes the current lines' sequence AFTER I've set it in OnConversationLine so that the "AnimatePortrait("Screaming") points to the proper animation that is associated with the current emotion/portrait.
AnimatePortrait itself is a custom sequencer command as you have suggested in the linked thread.
(Sidenode, it is not a good option for me to not use the default sequence and instead manually add a custom sequence to each sentence)
Could you please help me how to achieve this?
- Michael
I open a new thread following this one (https://www.pixelcrushers.com/phpbb/vie ... 016#p16016).
I have some different questions, but they are all about my DSFU setup which is basically a comic book setup (many speakers freely positioned in 2D Canvas, having many portraits/emotions with different speech bubbles that are instanced).
I'd like to start with this question:
How do I change the current sequence of a dialogue entry so that it's change reflects in the current spoken line to trigger an animation?
My setup:
1. a default sequence on DialogueManager:
AnimatePortrait(Idle)@{{end}};
AudioWait(entrytaglocal, speaker, silence_1s);
2. each dialogue entry's sequence is:
{{default}}
3. now I'd like to change the dialogue entrys sequence to:
AnimatePortrait("Animation");
{{default}}
-> where "Animation" is a variable. I have several portrait animations (e.g. Talking, Idle, Shouting, Screaming..) and depending on the speakers' emotion (a custom field I added) a defined portrait animation should be played.
I have defined the link between emotion and animation in a scriptable object. On DialogueManager, I have a class with OnConversationLine(Subtitle subtitle) and in this, I change "subtitle.dialogueEntry.currentSequence" in a way so it equals what I've written under 3.
What happens now is that OnConversationLine changes the currentSequence AFTER the sequencer already executed whatever sequence is defined (in this case the default sequence from 1.) - therefore of course, "AnimatePortrait("Screaming") is not played. But what I would need is that the sequencer executes the current lines' sequence AFTER I've set it in OnConversationLine so that the "AnimatePortrait("Screaming") points to the proper animation that is associated with the current emotion/portrait.
AnimatePortrait itself is a custom sequencer command as you have suggested in the linked thread.
(Sidenode, it is not a good option for me to not use the default sequence and instead manually add a custom sequence to each sentence)
Could you please help me how to achieve this?
- Michael
-
- Posts: 46
- Joined: Thu Nov 08, 2018 5:47 am
Re: Questions around Custom Speech Bubbles
Supplement to my question, I've read the doc:
https://www.pixelcrushers.com/dialogue_ ... 93837096b1
and since it mentions Get/Set I assumed that I could set the sequence OnConversationLine, but as said if I do that (checked - the sequence gets changed for the current line) it has no effect on the current spoken line.
https://www.pixelcrushers.com/dialogue_ ... 93837096b1
and since it mentions Get/Set I assumed that I could set the sequence OnConversationLine, but as said if I do that (checked - the sequence gets changed for the current line) it has no effect on the current spoken line.
-
- Posts: 46
- Joined: Thu Nov 08, 2018 5:47 am
Re: Questions around Custom Speech Bubbles
Update, one way I found how to achieve this, but I'd like to check with you if thats a "good" way or if I should use another approach:
1. Custom Class on DialogueSystemController GO, OnConversationLine - call GetComponent<Sequencer> to get a ref to the default sequencer
2. build a string containing my targeted animation (e.g. string customSequence = "AnimatePortrait(Talking)")
3. call on default sequencer.PlaySequence (customSequence)
4. add "AnimatePortrait(Idle)@{{end}};" to the DialogueSystemControllers' default sequence to stop whatever animation is playing at the sentence' end.
It does work, but is it the way to go as you would suggest?
1. Custom Class on DialogueSystemController GO, OnConversationLine - call GetComponent<Sequencer> to get a ref to the default sequencer
2. build a string containing my targeted animation (e.g. string customSequence = "AnimatePortrait(Talking)")
3. call on default sequencer.PlaySequence (customSequence)
4. add "AnimatePortrait(Idle)@{{end}};" to the DialogueSystemControllers' default sequence to stop whatever animation is playing at the sentence' end.
It does work, but is it the way to go as you would suggest?
Re: Questions around Custom Speech Bubbles
Hi Michael,
If you go back to your original implementation, in OnConversationLine do not change subtitle.dialogueEntry.sequence. This points to the actual Sequence field in the dialogue database. If you change this during runtime in the editor, it will actually change the dialogue database (unless you have ticked the Dialogue Manager's Instantiate Database checkbox).
Instead, change subtitle.sequence, which is the processed, runtime-ready and changeable version of the sequence that's ready to play in the sequencer. I think everything should work correctly then.
If you go back to your original implementation, in OnConversationLine do not change subtitle.dialogueEntry.sequence. This points to the actual Sequence field in the dialogue database. If you change this during runtime in the editor, it will actually change the dialogue database (unless you have ticked the Dialogue Manager's Instantiate Database checkbox).
Instead, change subtitle.sequence, which is the processed, runtime-ready and changeable version of the sequence that's ready to play in the sequencer. I think everything should work correctly then.
-
- Posts: 46
- Joined: Thu Nov 08, 2018 5:47 am
Re: Questions around Custom Speech Bubbles
Hey Tony, thanks, it works!
Re: Questions around Custom Speech Bubbles
Great! Glad to help.
-
- Posts: 46
- Joined: Thu Nov 08, 2018 5:47 am
Re: Questions around Custom Speech Bubbles
Hi Tony,
After the last line of the very first dialogue played, I see a label saying "Default" in the middle of the screen (weirdly this happens only in the very first played dialogue after starting the app, with every following dialogue there is no label any more/Alert Panel does not get enabled any more).
I figure its the "Alert Panel" in the "Basic Standard Dialogue UI" which is linked in "DialogueSystemController/DisplaySettings/Dialogue UI" that is enabled at the end of the dialogue.
Since I only use Dialogue Actors with Custom Subtitle Panels (the speechbubbles) I though removing "DialogueUI" solves that problem but it seems I cannot remove that (gives me an Animator.Play exception based on our last conversation about the Dialogue Actor reference script pointing at the animator). Disabling the Canvas/elements in the "Basic Standard Dialogue UI" also does not help (leads to the same issue described first).
How do I prevent popping up that Alert Panel (obviously, I never use alerts)? (Furthermore, it seems that the elements in "Basic Standard Dialogue UI" get enabled (the Dialogue Panel) even though I never use it/its not visible on screen because of the custom speech bubbles.. is there any way to not use these default panels at all?)
Thanks,
Michael
After the last line of the very first dialogue played, I see a label saying "Default" in the middle of the screen (weirdly this happens only in the very first played dialogue after starting the app, with every following dialogue there is no label any more/Alert Panel does not get enabled any more).
I figure its the "Alert Panel" in the "Basic Standard Dialogue UI" which is linked in "DialogueSystemController/DisplaySettings/Dialogue UI" that is enabled at the end of the dialogue.
Since I only use Dialogue Actors with Custom Subtitle Panels (the speechbubbles) I though removing "DialogueUI" solves that problem but it seems I cannot remove that (gives me an Animator.Play exception based on our last conversation about the Dialogue Actor reference script pointing at the animator). Disabling the Canvas/elements in the "Basic Standard Dialogue UI" also does not help (leads to the same issue described first).
How do I prevent popping up that Alert Panel (obviously, I never use alerts)? (Furthermore, it seems that the elements in "Basic Standard Dialogue UI" get enabled (the Dialogue Panel) even though I never use it/its not visible on screen because of the custom speech bubbles.. is there any way to not use these default panels at all?)
Thanks,
Michael
Re: Questions around Custom Speech Bubbles
Hi,
You can deactivate the Basic Standard Dialogue UI's Alert Panel and the subtitle panels and response menu panel. Conversations will always activate the Basic Standard Dialogue UI's Dialogue Panel so it's ready in case the conversation needs to show something in its subtitle panels or response menu panel -- for example, but including a [panel=#] tag in a node's Dialogue Text. But it won't activate the subtitle panels or response menu panel otherwise.
It's possible you're seeing some kind of animation issue when GameObjects are being activated or deactivated. You can remove all of the Animators from the panels. This will make the dialogue UI immediately deactivate them, ensuring they don't play any animations such as "fade out" animations.
You can deactivate the Basic Standard Dialogue UI's Alert Panel and the subtitle panels and response menu panel. Conversations will always activate the Basic Standard Dialogue UI's Dialogue Panel so it's ready in case the conversation needs to show something in its subtitle panels or response menu panel -- for example, but including a [panel=#] tag in a node's Dialogue Text. But it won't activate the subtitle panels or response menu panel otherwise.
It's possible you're seeing some kind of animation issue when GameObjects are being activated or deactivated. You can remove all of the Animators from the panels. This will make the dialogue UI immediately deactivate them, ensuring they don't play any animations such as "fade out" animations.
-
- Posts: 46
- Joined: Thu Nov 08, 2018 5:47 am
Re: Questions around Custom Speech Bubbles
Hi Tony,
just to confirm I understand you correctly, I have duplicated "Basic Standard Dialogue UI" then
1. placed that duplicate in "DialogueManager/Canvas/Dialogue UI" and linked it to "DialogueSystemController/DisplaySettings/DialogueUI"
2. removed all Animators from "DialogueUI" prefab: Alert Panel is still shown at the end of the first dialogue (which only uses custom speech bubbles)
3. disabled all 3 child elements of "DialogueUI" prefab (Alert Panel, Dialogue Panel, QTEs): Alert Panel still shown
4. completely deleted Alert Panel, Dialogue Panel, QTEs: as wanted, nothing shown at the end (of course, nothing there) -> but this gives me Console Warnings: "Dialogue System: No UI Text element/subtitle panels/response menu panles assigned to Standard Dialogue UI's Alert UI Elements" etc.
-> I understand the warning since nothing is there/linked in "StandardDialogueUI", but to confirm this is the way to go that you suggested?
just to confirm I understand you correctly, I have duplicated "Basic Standard Dialogue UI" then
1. placed that duplicate in "DialogueManager/Canvas/Dialogue UI" and linked it to "DialogueSystemController/DisplaySettings/DialogueUI"
2. removed all Animators from "DialogueUI" prefab: Alert Panel is still shown at the end of the first dialogue (which only uses custom speech bubbles)
3. disabled all 3 child elements of "DialogueUI" prefab (Alert Panel, Dialogue Panel, QTEs): Alert Panel still shown
4. completely deleted Alert Panel, Dialogue Panel, QTEs: as wanted, nothing shown at the end (of course, nothing there) -> but this gives me Console Warnings: "Dialogue System: No UI Text element/subtitle panels/response menu panles assigned to Standard Dialogue UI's Alert UI Elements" etc.
-> I understand the warning since nothing is there/linked in "StandardDialogueUI", but to confirm this is the way to go that you suggested?
Re: Questions around Custom Speech Bubbles
That is very strange. You really shouldn't have to do any of that. I was just trying to eliminate variables, but apparently that wasn't it.
Please check the value of the "Alert" variable in the Dialogue Editor's Variables section. Make sure it's a blank string, and not something else such as a single space character. Also check your conversation for any Script fields that are Variable["Alert"].
Whenever a conversation ends, the Dialogue System checks the value of Variable["Alert"]. If it's not a blank string, it shows the value as an alert message in the Alert Panel.
Please check the value of the "Alert" variable in the Dialogue Editor's Variables section. Make sure it's a blank string, and not something else such as a single space character. Also check your conversation for any Script fields that are Variable["Alert"].
Whenever a conversation ends, the Dialogue System checks the value of Variable["Alert"]. If it's not a blank string, it shows the value as an alert message in the Alert Panel.