Page 1 of 1

A few issues

Posted: Sun Apr 24, 2016 10:20 am
by Revolter
Hi!

Bought Dialogue System recently and wanted to mention a few issues i noticed:

1) Response buttons are set inactive before the Hide animation completes (Using new Unity UI)
Image

2) Don't know how to explain but the steps to reproduce are the following:
-Add Localization template to Dialogue Entries with the name: Ru
-Create a basic dialogue and add a few translated entries
-Change Localization entry to ru
-Go to a localization entry and update the template
-Ru is still there along with ru and impossible to remove
Image

Re: A few issues

Posted: Sun Apr 24, 2016 10:42 am
by Revolter
Just noticed in your code that the animation state is checked only in Layer 0. I had Dialogue animation in a second layer. Fixed it now.

Got another question now. I want to make the Responses appear 1 second before the NPC finishes its dialogue, like in Wolf Among Us (or setting min subtitles seconds to 0 only before response would be nice as well).
I would also rather skip Subtitle Reminder and just keep the Subtitle Panel on screen while the responses are shown. Didn't find an option to do that.

Re: A few issues

Posted: Sun Apr 24, 2016 12:09 pm
by Tony Li
Hi,

Thanks for buying the Dialogue System!
Revolter wrote:2) Don't know how to explain but the steps to reproduce are the following:
-Add Localization template to Dialogue Entries with the name: Ru
-Create a basic dialogue and add a few translated entries
-Change Localization entry to ru
-Go to a localization entry and update the template
-Ru is still there along with ru and impossible to remove
Image
This is a bug. Thanks for reporting it. I'll have it fixed very soon and put a patch on the customer download page. (Please PM me your Unity Asset Store invoice number if you'd like access to the page.) It'll also be in the next release on the Asset Store.
Revolter wrote:Just noticed in your code that the animation state is checked only in Layer 0. I had Dialogue animation in a second layer. Fixed it now.

Got another question now. I want to make the Responses appear 1 second before the NPC finishes its dialogue, like in Wolf Among Us (or setting min subtitles seconds to 0 only before response would be nice as well).
I would also rather skip Subtitle Reminder and just keep the Subtitle Panel on screen while the responses are shown. Didn't find an option to do that.
I'll clarify in the documentation that animation checks Layer 0. That, as well as always showing Subtitle Reminder with the response menu instead of Subtitle Panel, are some implementation decisions I made to strike a balance between flexibility and understandability. The scripts are exposed and subclassable (which I see you already did) because I figure some people may want to change the behavior.

You can assign the same panel to NPC Subtitle > Panel and Subtitle Reminder > Panel. I often set up dialogue UIs where the same elements (panel, portrait name, portrait image) are assigned to both, with the only difference being that NPC Subtitle > Line has a typewriter effect while Subtitle Reminder > Line doesn't. You can also play with the Always Visible checkboxes in both sections.

For the responses, there's a similar example on the Dialogue System Extras page. You can download it directly here: GoT_Style_2016-01-21.unitypackage. To keep the package small, it uses the Dialogue System's example assets. They don't fit with the subject matter of the conversation (which is copyright Telltale Games), but the point was to demonstrate how to implement a conversation like this: Game of Thrones.

The example scene uses a Response Menu Sequence to show the response menu while typing out the last subtitle line in a monologue.

If this isn't exactly what you want, you can override your dialogue UI's ShowSubtitle and ShowResponses to show/hide the subtitle line whenever you want. (For that matter, you're certainly also free to make a copy of Script/Templates/TemplateDialogueUI.cs if you find that UnityUIDialogueUI's design decisions really don't mesh with your desired design.)

Also, you might also find this sequencer command handy. Or not. I'm just including it in case it ends up being helpful at some point.

SequencerCommandWaitEndTime.cs

Code: Select all

namespace PixelCrushers.DialogueSystem.SequencerCommands {

    public class SequencerCommandWaitEndTime : SequencerCommand {

        public void Start() {
            Invoke("Stop", Sequencer.SubtitleEndTime + GetParameterAsFloat(0));
        }
    }
}
Example:

Code: Select all

WaitEndTime(-1)
This delays the sequence by a delta from the value of {{end}}, which is a keyword that represents a duration based on the length of the subtitle and the Dialogue Manager's Subtitle Chars Per Second and Min Subtitle Seconds values. In the example above, it waits one second less than {{end}}.

Re: A few issues

Posted: Sun May 08, 2016 4:38 am
by Revolter
Hi Tony,

Thanks for the help. I've played around a bit, and I decided to make my own Dialogue UI script.

Right now when I select a response, the buttons get deactivated instantly, how can I make the buttons persist till the end of the responseMenu.Hide animation?

Re: A few issues

Posted: Sun May 08, 2016 10:00 am
by Tony Li
Hi,

What if you comment out the code that deactivates the response buttons? Since the whole panel is being hidden by responseMenu.Hide, there's really no need to also hide the buttons inside them.

Re: A few issues

Posted: Mon May 09, 2016 10:42 am
by Revolter
I actually didn't do it from scratch, but using the UnityUIDialogue as a template and modifying it according to my needs. I tried commenting different blocks of code that I thought is responsible for deactivating the buttons, but couldn't find it. Are the buttons deactivated in the UnityUIResponseMenuControls?

Re: A few issues

Posted: Mon May 09, 2016 3:27 pm
by Tony Li
Hi,

Yes, the buttons that are assigned to the Dialogue > Response Menu > Buttons list are deactivated in the SetActive() method of UnityUIResponseMenuControls.cs, which starts around line 150.

SetActive(bool value) accepts a bool that specifies whether to set the response menu controls active or inactive. It loops through the buttons and sets them active if (1) the bool value is true, and (2) the button's "visible" property is also true. (If the menu doesn't need to use all of the buttons in the list, it sets the "visible" property false on the unused buttons.)

A quick way to never hide the buttons is to wrap it in a condition. So instead of this:

Code: Select all

foreach (var button in buttons) {
    if (button != null) {
        Tools.SetGameObjectActive(button, value && button.visible);
    }
} 
Try this:

Code: Select all

if (value == true) { // Only if showing. If hiding, don't mess with the buttons.
    foreach (var button in buttons) {
        if (button != null) {
            Tools.SetGameObjectActive(button, value && button.visible);
        }
    }
} 

Re: A few issues

Posted: Tue May 10, 2016 10:57 am
by Revolter
Thanks Tony, worked like a charm!

Re: A few issues

Posted: Tue May 10, 2016 11:02 am
by Tony Li
Awesome! Glad to hear it.