Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Dialogue System for Unity - easy conversations, quests, and more!

Discussion in 'Assets and Asset Store' started by TonyLi, Oct 12, 2013.

  1. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    @TonyLi

    Thanks for your help on the radio UI. I was able to make it just as you advise :)

    I have a small little issue on the letterbox UI which didnt bug me in the past, but now that I am completing the cutscene, I started to notice it.
    As you can see the NPC and Player Subtitles are aligned in the top and bottom of the screen. This shows up properly in the UI Preb. There doesn't seem to be any object that can cause this behavior. I replace my UI with the default Letterbox template and still found the same issue. Could you please advise what could be happening?


    cutscene 1.PNG

    Top and bottom aligned Subtitles
    cutscene 2.PNG
    cutscene 3 -Letter.PNG

    Default letterbox template cutscene 4 -Default Prefab.PNG
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    @SamRock - I don't understand. What isn't appearing the way you want? And how do you want it to appear differently?
     
  3. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    I am sorry I didnt mention the actual problem (or atleast want I think is) The Subtitle is not vertically aligned in the middle of the Black bar. If you look at the Player Subtitle is almost touching the bottom edge of the screen. Same with Top title
     
  4. Orexx

    Orexx

    Joined:
    Jun 4, 2017
    Posts:
    26
    Thank you for your reply.
    I want to clarify.
    The method C# should simply be placed in the script TemplateCustomLua for it to work?

    Where is the registration code required?

    After the actors have spoken all the cues, the window with the text disappears. Is it possible to leave it active when all the text has already been spoken?

    Is it possible to add text from the next node (the same actor) not from a new line, but to the same line that he already used?
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Let's focus on the PC Subtitle Panel. The steps for the NPC Subtitle Panel are the same.

    In the Letterbox template, the PC Subtitle Panel's Rect Transform is anchored to the bottom, and it grows up from there:

    upload_2019-9-15_10-5-16.png

    Instead, change it so it spans the entire bottom panel, and remove the Horizontal Layout Group and Content Size Fitter:

    upload_2019-9-15_10-6-40.png

    Then change the Subtitle Text so it spans its parent and is centered vertically:

    upload_2019-9-15_10-7-55.png

    Then do the same for the NPC Subtitle Panel.

    Like the instructions in the script say, make a copy of the script and customize it where indicated. Here's a shortened version that you can drop into your project with the name BlackboardLua:

    BlackboardLua.cs
    Code (csharp):
    1. using UnityEngine;
    2. using PixelCrushers.DialogueSystem;
    3. public class BlackboardLua : MonoBehaviour
    4. {
    5.     void Awake()
    6.     {
    7.         Lua.RegisterFunction("GetBBInteger", this, SymbolExtensions.GetMethodInfo(() => GetBBInteger(string.Empty, string.Empty)));
    8.     }
    9.  
    10.     public double GetBBInteger(string gameObjectName, string variableName)
    11.     {
    12.         var go = GameObject.Find(gameObjectName);
    13.         if (go == null) return 0;
    14.         var blackboard = go.GetComponent(typeof(IBlackboard));
    15.         if (blackboard == null) return 0;
    16.         var variable = blackboard.GetVariable<int>(variableName);
    17.         if (variable == null) return 0;
    18.         return variable.value;
    19.     }
    20. }
    Add it to your Dialogue Manager GameObject. Then in your conversations you can use the function GetBBInteger() like in my previous reply. If you need to check other variable types such as Boolean, you can add similar functions.

    Yes. Inspect the subtitle panel. Tick Accumulate Text. You may also want to set Visibility to Always Once Shown.

    upload_2019-9-15_10-15-40.png
     

    Attached Files:

  6. Orexx

    Orexx

    Joined:
    Jun 4, 2017
    Posts:
    26
    I tried to do so, but for some reason, only the start is lit in green in the Conversations tab, and there is no transition to the node with the condition.
    I had to slightly modify the code because it highlighted 2 lines in red, specifically these:

    1. var blackboard = go.GetComponent(typeof(IBlackboard));
    2. if (blackboard == null) return 0;
    3. var variable = blackboard.GetVariable<int>(variableName);

    As a result, I created the script BlackboardLua.cs in assets / scripts and added it to the Gameobject with a Dialogue Manager:

    Code (CSharp):
    1. using UnityEngine;
    2. using PixelCrushers.DialogueSystem;
    3. using NodeCanvas.Framework;
    4.  
    5. public class BlackboardLua : MonoBehaviour
    6. {
    7.     void Awake()
    8.     {
    9.         Lua.RegisterFunction("GetBBInteger", this, SymbolExtensions.GetMethodInfo(() => GetBBInteger(string.Empty, string.Empty)));
    10.     }
    11.  
    12.     public double GetBBInteger(string gameObjectName, string variableName)
    13.     {
    14.         var go = GameObject.Find("managerSelectType");
    15.         if (go == null) return 0;
    16.         var blackboard = go.GetComponent<Blackboard>();
    17.         if (blackboard == null) return 0;
    18.         var variable = blackboard.GetVariable<int>("typeCab");
    19.         if (variable == null) return 0;
    20.         return variable.value;
    21.     }
    22. }
    BlackboardLua.jpg

    Assigned conditions to the required nodes:

    GetBBInt.jpg

    I tried to install according to the manual after the "blue" node an empty node before determining the choice between two nodes, but everything remained the same.
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    @Orexx - In my original script (which was just missing the "using NodeCanvas.Framework;" line), GetBBInteger() requires two parameters:
    1. The name of the GameObject with the Blackboard component, and
    2. The name of the variable.
    If you check the Console during play, you will probably see red errors because you are only using one parameter.

    Replace your script with this:
    Code (csharp):
    1. using UnityEngine;
    2. using PixelCrushers.DialogueSystem;
    3. using NodeCanvas.Framework;
    4.  
    5. public class BlackboardLua : MonoBehaviour
    6. {
    7.     void Awake()
    8.     {
    9.         Lua.RegisterFunction("GetBBInteger", this, SymbolExtensions.GetMethodInfo(() => GetBBInteger(string.Empty)));
    10.     }
    11.  
    12.     public double GetBBInteger(string variableName)
    13.     {
    14.         var go = GameObject.Find("managerSelectType");
    15.         if (go == null)
    16.         {
    17.             Debug.LogError("Can't find GameObject named 'managerSelectType'");
    18.             return 0;
    19.         }
    20.         var blackboard = go.GetComponent<Blackboard>();
    21.         if (blackboard == null)
    22.         {
    23.             Debug.LogError("managerSelectType doesn't have a Blackboard component");
    24.             return 0;
    25.         }
    26.         var variable = blackboard.GetVariable<int>(variableName);
    27.         if (variable == null)
    28.         {
    29.             Debug.LogError("managerSelectType's Blackboard doesn't have a variable named " + variableName);
    30.             return 0;
    31.         }
    32.         return variable.value;
    33.     }
    34. }
    I added logging information. If it doesn't work, check the Console window. It will indicate the problem.

    You don't need to change anything in your dialogue database.
     
    Orexx likes this.
  8. Orexx

    Orexx

    Joined:
    Jun 4, 2017
    Posts:
    26
    Thank you, this code did not show any red messages in the console because everything basically worked as it should, I’m sorry I just made a mistake that it was necessary to click on the message so that the event went to the next node.
    Everything is working.
     
    TonyLi likes this.
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Great! Glad to see that everything's working.

    BTW, the Dialogue System provides several options to customize the way blue nodes work. (A node will be blue if it's assigned to an actor whose Is Player checkbox is ticked.)

    By default, blue nodes will always appear in response menus.

    If you want to skip the response menu when there is only one blue node, inspect the Dialogue Manager. Untick Input Settings > Always Force Response Menu.

    You can later use markup tags to force a response menu for a single blue node, or to skip the response menu if there is more than one blue node.
     
    Orexx likes this.
  10. Orexx

    Orexx

    Joined:
    Jun 4, 2017
    Posts:
    26
    I guess I made a mistake somewhere, because with different prefabs, the window with the text still disappears after all the text has been expressed by the NPC.
    show.gif

    I put the meaning on Always once Shown:

    UISubtutlePanel.jpg

    Gameobject.jpg

    Conversations.jpg
    I tried it on different standard prefabs.
    In my project, I don’t think that the player’s interaction with these text windows will be used, so I would like them to turn on and off when it is provided by me in advance.
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    @Orexx - The typical configuration is that the dialogue UI disappears when the conversation ends. Do you not want this to happen? Do you want the dialogue UI to stay onscreen forever?
     
  12. Orexx

    Orexx

    Joined:
    Jun 4, 2017
    Posts:
    26
    Yes. But so that I can turn it (window) off if necessary.
    It turns on as I understand it with - [on Enable] in Dialogue System Trigger script.
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Orexx - If you want the dialogue UI to stay visible all the time (except for when you manually hide it), it will require a few steps.

    First, inspect its Standard Dialogue UI component. Unassign the Main Panel field.

    Then inspect the Dialogue Panel child GameObject. Remove the Canvas Group and Animator components.

    The dialogue UI will now stay visible. However, by default it will always deactivate its subtitle text and other UI elements except for when a conversation is active. To prevent that, you must make a subclass of StandardUISubtitlePanel. Override the SetUIElementsActive method to not deactivate the UI elements. You may also want to override the Close method to prevent it from clearing m_accumulatedText, which is the string that contains the accumulated text of the current conversation (if you have ticked the Accumulated Text checkbox).

    Then replace the StandardUISubtitlePanel component on the subtitle panel with your custom subclass. To replace it in-place while keeping the UI element assignments, use the triple-bar menu in the upper right of the Inspector view to change to Debug mode. Then drag your script into the component's Script field.

    If you don't want to do all that, you can provide your own dialogue script that implements the C# interface IDialogueUI. It's a simple interface with a few methods such as ShowSubtitle and ShowResponses. (The Dialogue System doesn't force you into using a particular set of dialogue UI scripts. You can provide your own script if you prefer, and the Dialogue System will work happily with it.)
     
  14. Orexx

    Orexx

    Joined:
    Jun 4, 2017
    Posts:
    26
    Hi @TonyLi
    Thank you, I tried to implement it today and something I can’t do.
    After reviewing your code, I decided what I need, I am satisfied with the appearance and hiding of the dialog panel, but I just want to hide the panel and text in it when, for example, the value of the third-party variable _hide becomes 0 or 1.
    scriptPlace.jpg
    I tried to override the method that you specified, but unfortunately nothing happens:

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3.  
    4. namespace PixelCrushers.DialogueSystem
    5. {
    6.  
    7.     public class StandartUiSubtitle : StandardUISubtitlePanel
    8.     {
    9.  
    10.         public int _hide = 0;
    11.  
    12.         public override void SetUIElementsActive(bool value)
    13.         {
    14.             if (value == true)
    15.             {
    16.                 Tools.SetGameObjectActive(panel, value);
    17.                 Tools.SetGameObjectActive(portraitImage, value);
    18.                 portraitName.SetActive(value);
    19.                 subtitleText.SetActive(value);
    20.             }
    21.             else
    22.             {
    23.                 if (_hide == 1)
    24.                 {
    25.  
    26.                     Tools.SetGameObjectActive(panel, value);
    27.                     Tools.SetGameObjectActive(portraitImage, value);
    28.                     portraitName.SetActive(value);
    29.                     subtitleText.SetActive(value);
    30.                 }
    31.  
    32.             }
    33.         }
    34.  
    35.         public overrride void Close()
    36.         {
    37.             if (_hide == 3)
    38.             {
    39.  
    40.                 if (isOpen) base.Close();
    41.                 m_accumulatedText = string.Empty;
    42.                 hasFocus = false;
    43.  
    44.             }
    45.  
    46.         }
    47.  
    48.     }
    49. }
    50.  
    I tried to redefine other methods, such as HideSubtitle() and HideImmediate(), but too everything remained as it was.
     
    Last edited: Sep 17, 2019
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Orexx - I'll put together an example when I get back to the office later today. It may help.
     
    Orexx likes this.
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    @Orexx - Here's an example. It's DemoScene1, except the Runic UI is always visible. We can use it as a starting point for discussion. I wasn't sure of the purpose of your _hide variable. Instead, if you want to close the dialogue UI, just deactivate its Dialogue Panel GameObject. (Example was exported from Unity 2019.1.)
     

    Attached Files:

  17. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Hello,

    I've been messing around with the wheel response menu. How would I go about setting it up so that during NPC dialogue, the responses wheel is always displayed at the bottom even if there are currently no dialogue choices to be made? Usually it sort of pops in when there is a player choice to make but vanishes away after. But for aesthetic reasons I'd like it to always stay at the bottom ideally.

    I am using the "JRPG Template Standard Dialogue UI", but with the wheel response menu in the latest Dialogue System and Unity versions.

    Thank you for your time. Regards
     

    Attached Files:

    Last edited: Sep 18, 2019
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Candy-Bomber - Move the Response Menu Panel's children (Ring Background and Panel) outside of the Response Menu Panel so they're children of the main Dialogue Panel instead:

    upload_2019-9-18_10-50-41.png
     
    DMRhodes likes this.
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Jenny LeClue: Detectivu Now Available

    Congratulations to Mografi on the release of Jenny LeClue: Detectivu, now available on Steam and GoG, and soon on Apple Arcade and Switch!

     
    Last edited: Sep 20, 2019
    P_Jong and flashframe like this.
  20. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Hello me again,

    I'm afraid I've come back with a bigger question this time please. :)

    Using the accumulate text feature, how do I have the accumulated text appear above the current dialogue rather than below it, ideally with a blank space in-between for legibility. So that the latest conversation is always at the top of the scrollview I have my subtitle text inside of and the earliest conversations at the bottom.

    Thank you
     

    Attached Files:

  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    @Candy-Bomber - So if the flow of conversation is "This is line 1" --> "This is line 2" --> "Choice B" --> "This is line 3", then you'd want the text to appear like this:

    This is line 3
    Choice B
    This is line 2
    This is line 1​

    Is that correct?

    If so, you can replace the StandardUISubtitlePanel with this script:

    Code (csharp):
    1. using PixelCrushers.DialogueSystem;
    2. using PixelCrushers;
    3. using System.Reflection;
    4. public class ReverseAccumulateSubtitlePanel : StandardUISubtitlePanel
    5. {
    6.     protected override void SetFormattedText(UITextField textField, string previousText, FormattedText formattedText)
    7.     {
    8.         // Copy of base SetFormattedText except it puts the new text at the front instead of the end:
    9.         var text = UITools.GetUIFormattedText(formattedText);
    10.         if (!string.IsNullOrEmpty(previousText)) text += "\n" + previousText;
    11.         textField.text = text;
    12.         UITools.SendTextChangeMessage(textField);
    13.         if (!haveSavedOriginalColor)
    14.         {
    15.             originalColor = textField.color;
    16.             haveSavedOriginalColor = true;
    17.         }
    18.         textField.color = (formattedText.emphases != null && formattedText.emphases.Length > 0) ? formattedText.emphases[0].color : originalColor;
    19.     }
    20.  
    21.     public override void SetContent(Subtitle subtitle)
    22.     {
    23.         base.SetContent(subtitle);
    24.         // Remove the trailing newline: (next version will expose accumulatedText so we don't have to use reflection)
    25.         var accumulatedText = typeof(StandardUISubtitlePanel).GetField("m_accumulatedText", BindingFlags.NonPublic | BindingFlags.Instance);
    26.         var text = (string)accumulatedText.GetValue(this);
    27.         accumulatedText.SetValue(this, text.Substring(0, text.Length - 1));
    28.     }
    29. }

    However, note that you should remove the typewriter effect if the subtitle text has one. Or, if you need one, write a custom typewriter effect (subclass of AbstractTypewriterEffect) that handles the typed text being at the beginning instead of the end.

    You can play with the overridden SetFormattedText method if you want to add a space.

    The script above accumulates text in a single string like the original StandardUISubtitlePanel except it puts the new text at the front of the string instead of the end.

    As an alternative approach, you could override the methods above to use two separate UI text elements -- one that contains the current line, and one that contains the previous lines.
     
    DMRhodes likes this.
  22. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Hello. For some reason I can't manage make sequence to work. I tried placing the sequence at diffrent places of my dialogue and adding ";" at the end, but it just doesn't work. I think sequences worked in my project before but then two days ago I was working and noticed that all of my SetActive sequences just don't work.
     

    Attached Files:

  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Stickeyd - The Dialogue System Extras page has a patch that fixes this. (Version 2.2.0 now allows you to activate GameObjects whose root parents aren't active, but it also introduced a bug with SetActive().) Version 2.2.1 will hopefully be available for download from the Asset Store on Monday.
     
  24. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Hello, thanks for all the help so far. I got everything working with the advice you gave.

    I have a suggestion for a quality of life addition. I don't know if it would classified as a minor or a large change but I just thought I'd throw it out there for future consideration. :)

    Would it be possible to add a set of buttons in the dialogue text area of a dialogue node, similar to a text editor like Word or Libreoffice. For things like Bold, Italic, Underline text or perhaps a color picker for text color. Basically things you can do already with tags like "</B>" but as a button which would apply said formatting quicker to the currently highlighted text.

    I find I use bold and italics or specific text colors regularly, and it would definitely streamline a few things here and there.

    Cheers
     
    Last edited: Sep 23, 2019
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    @Candy-Bomber - Excellent idea! I'll look into it for version 2.2.2.
     
    DMRhodes likes this.
  26. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    What's the best way to go about printing a field from an Actor in a conversation? Looking to print out the custom fields associated with each actor

    Also how do I go about changing the name displayed with the default UI for the NPC? I don't see a "conversation trigger" script so I'm assuming there's some way to set the actor in the conversation to the object with the trigger
     
    Last edited: Sep 25, 2019
  27. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @DespairBear - If it were a variable, you could use the [var=variable] markup tag such as:
    • Dialogue Text: "Brr! It's a bit chilly for [var=Season], isn't it?"
    For other data, you'll need to use the [lua(code)] markup tag, which shows the value of any Lua expression:
    • Dialogue Text: "What a coincidence! I'm from [lua(Actor["Fred"].Hometown)], too!"

    If you're using a Dialogue System Trigger to start the conversation and you assign a GameObject to the Conversation Conversant field (or pass a GameObject to DialogueManager.StartConversation() in C#), it will use info about that GameObject. If the GameObject has a Dialogue Actor, it will use the actor selected in the Dialogue Actor's Actor dropdown. If the GameObject doesn't have a Dialogue Actor, it will use the name of the GameObject to look up the actor. In either case, it will check if the actor has a Display Name field. If so, it will use the Display Name. Otherwise it will use the actor's Name field. (Or language-localized versions if you've defined them.)

    If you don't assign a GameObject, it will check if any GameObjects have a Dialogue Actor component whose Actor dropdown is set to the conversation's conversant. If not, it will look for a GameObject whose name matches the conversation's conversant name. If that fails, too, it will use the Dialogue System Trigger GameObject itself, including its name.

    More info: Character GameObject Assignments
     
    lo-94 likes this.
  28. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Hey so I noticed with Ultimate Character Controller (UCC) integration, after the first interaction I perform I have to click the interact button twice to successfully "OnUse" interact. Not sure if this is a bug on the Dialogue System integration or UCC

    Also with the Letterbox Template Standard Dialogue UI what's the best way to change the show/hide duration of the letterbox bars? I'm trying to get them to appear a bit slower
     
    Last edited: Sep 29, 2019
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi,
    Does this also happen in Dialogue System's Opsive UCC Dialogue Example scene? I can't seem to reproduce it. If I run up to Private Hart and press F, it plays the first branch of the conversation. Then if I run around a bit, return to Hart, and press F again (once), it plays the second branch of the conversation. I tested using the latest versions of UCC (2.1.8) and Dialogue System (2.2.0).

    The quickest way is to inspect the Letterbox Dialogue Panel Animator Controller in the Animator window and change the Speed of the Show and Hide states. However, you may want to make a copy of the animator controller, change the copy, and assign it to your dialogue UI. This way you won't overwrite your changes when updating the Dialogue System.
     
  30. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    So it seems this only happens when you interact with one object, and then interact with a different object. If you interact with the same object, it has no problems, but if you interact with an object then go to another it seems to require you to interact with the target twice for it to succeed
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    I've contacted Opsive. In the meantime, it appears that if you assign Ability Message Text to the interact ability, you don't have to interact twice. Also, if you change the Object Detection type to Trigger and use a trigger collider, you don't have to interact twice.
     
    lo-94 likes this.
  32. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Awesome! Thanks for the temporary fix. I remember on UFPS there was a similar bug with the integration that I wound up fixing due to message text/icon not being set
     
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    I'll try to have a better explanation and fix for you tomorrow after I talk with Opsive.
     
    lo-94 likes this.
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    @DespairBear - It may be the middle of next week before Opsive and I have the root issue sorted out. If you run into any issues with the workaround in the meantime, please let me know so we can come up with something that works for your needs.
     
    lo-94 likes this.
  35. Michael2790

    Michael2790

    Joined:
    Nov 27, 2017
    Posts:
    10
    NPC is continues conversation even when game is paused.
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Michael2790 - Inspect the Dialogue Manager GameObject, and set Other Settings > Dialogue Time Mode to Gameplay.

    By default, it's set to Realtime, which allows conversations to run while Time.timeScale is zero. This allows you to pause gameplay during conversations, which is a common use of the Dialogue System.

    If you set it to Gameplay, it will observe Time.timeScale.
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Dialogue System 2.2.1 Released

    Version 2.2.1 is now available on the Asset Store!

    If you're using version 2.2.0, please update to this version. It fixes the SetActive() sequencer command, which was broken in 2.2.0. It also provides several improvements to dialogue UIs and barks, and updates to third party integrations such as articy:draft.


    Release Notes:

    Core:
    • Fixed SetActive() sequencer command (broken in v2.2.0).
    • DialogueManager.BarkString() sequences now support {{end}} keyword.
    • Removed Destroy() delay when aborting active sequencer commands.
    • Standard UI:
      • Improved subtitle panel focus/unfocus handling.
      • Make StandardUISubtitlePanel.StartTypingWhenFocused is now virtual.
      • Exposed StandardUISubtitlePanel.accumulatedText.
      • Exposed StandardBarkUI properties as protected.
      • Added static utility function ConversationView.GetDefaultDuration.
      • Fixed portrait issue in response menu if NPC portraits were assigned but no player portrait was assigned.
    Third Party Support:
    • articy:draft:
    • Jumps are now converted as group nodes unless they have an output pin script. (Return to pre-2.1.10 behavior.)
      • Added option to convert slots to Technical Name.
      • Converter window now saves Other Script Fields value.
      • Lua functions such as getProp() now work with property names that include feature name.
      • self keyword now points to Dialog[#] dialogue entry, not speaker. (speaker keyword points to speaker actor.)
      • Fixed runtime conversion of reference strips to subtables when the reference strip was empty.
    • Chat Mapper: Fixed dialogue entry non-Normal Condition Priority not being correctly imported to link priorities.
    • Corgi Platformer Engine: Updated for v6.0; added "Hide Prompt Only During Conversation" checkbox; re-shows prompt as soon as conversation ends.
    • ORK: Updated for 2.26.
     
    DMRhodes likes this.
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    UI Localization Patch Available

    The Dialogue System Extras page has a patch that allows DialogueManager.SetLanguage("") and UILocalizationManager.SetLanguage("") to revert localized UIs to the default language. This will also be in the next Dialogue System update.

    This patch also applies to Quest Machine and Love/Hate.
     
  39. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Hello, I have a question about modding, for example if I want the users to be able to create their own story in my game without installing unity, is there a way to do that with the asset? Like display the dialogue editor in-game and then save all of the data they have written.
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @skinwalker - The Dialogue System supports modding. You can create dialogue databases at runtime, either through code such as this example, or by importing XML from Chat Mapper or articy:draft. (Runtime import: Chat Mapper, articy) Modders can't use the Dialogue System's Unity editor-based Dialogue Editor window, though, since it's designed to work in the Unity editor.

    You can also add your own Lua functions and sequencer commands that your modders can use -- for example to tell NPCs to do things, or work with the player inventory, etc.
     
    skinwalker likes this.
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Designing the personality-based narrative system of Jenny LeClue

    Mografi wrote a great article on how they used the Dialogue System for Unity with scriptable objects to weight player choices in Jenny LeClue: Detectivu: Designing the personality-based narrative system of Jenny LeClue

    They also shared the importer they developed to import their own simplified text-based format into the Dialogue System. It's available on the Dialogue System Extras page.

    Jenny LeClue is out now on Steam, GOG, iOS, and Apple Arcade, and coming soon to PS4 and Switch!
     
    flashframe likes this.
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
  43. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Hello, I have a simple unity UI button in my scene. How would I go about hiding this button automatically while a conversation is playing and having it reappear on the conversations end? Is there an easier way than using a SetActive sequence at the start and end of every conversation?

    Cheers
     
  44. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi,
    If your UI button survives scene changes along with the Dialogue Manager, add a Dialogue System Events component to the Dialogue Manager. Configure the OnConversationStart() event to hide the button and OnConversationEnd() to show it again:

    upload_2019-10-9_8-13-50.png

    If the UI button only exists in a single scene, add the Dialogue System Events component to one of the conversation's participants. (OnConversationStart/End is only called on the Dialogue Manager and the conversation's participants.)
     
    DMRhodes likes this.
  45. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    Hi @TonyLi

    Is it possible to save inventory items, player stats (current HP, MP etc) with dialogue system's save tools? I was watching the youtube video, but I didn't see any mentions of it.



    Thanks!
     
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @indieDoroid - Sure. The save system is extendable. You just need to provide saver scripts that know how to work with your inventory and player stat systems. The Dialogue System already includes integrations for several inventory systems such as Inventory Engine and Inventory Pro, as well as the inventory systems and stat systems in other assets such as ORK Framework, Opsive's controllers, TopDown Engine, etc. If there isn't already an integration for your systems, you just need to copy the SaverTemplate.cs and fill in your code where the comments indicate.
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Updated Integration Packages & Patches

    The Dialogue System Extras page currently has these updates for version 2.2.1:
    • Patch: Allows DialogueManager.SetLanguage("") to revert to the default language.
    • Emerald AI: Updated for Emerald AI 2.3.0.2 API change.
    • uMMORPG: Adds server-side authorization of Lua functions. Updates example scene for uMMORPG 1.178.
    • uRPG: Adds more Lua functions for gold and stats. Updated for uRPG 1.18.
     
  48. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Hello. I currently use Easy Save 3 for saving in my game. I'm not sure how to approach saving in this case, because your asset has its own save system. Can I integrate Easy Save into dialogue system somehow or should I... just use 2 save systems at the same time(at one trigger save both easy save and dialogue system)
     
  49. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    Great thank you. I'll look more into it!
     
  50. Orexx

    Orexx

    Joined:
    Jun 4, 2017
    Posts:
    26
    Hi @TonyLi
    Can a dialog box display size be fixed?
    In my case, in the Unity editor in the Game tab, the size of the dialog box changes if you put the tab in full screen mode with a ratio of 16:9 (In full screen, the dialog box visually decreases at times).