Search Unity

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

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

  1. YOAJ1

    YOAJ1

    Joined:
    Jul 17, 2014
    Posts:
    26


    I want to create a conversation scene with a camera angle where the player and NPC can be seen at the same time like this game
    What should I do?
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Do exactly what they do. Lake uses the Dialogue System. :)

    There are two easy ways to do it:

    1. Use Camera() sequencer commands. (See the Sequencer Command Tutorials.) Position an empty GameObject where you want the camera to go. Then use Camera(GameObject) in a conversation's Sequence field(s) to move the camera there.

    2. Or use Cinemachine. The Dialogue System includes components and sequencer commands to tell Cinemachine to move the camera to different vcams (positions).
     
  3. kuromatu

    kuromatu

    Joined:
    Dec 27, 2019
    Posts:
    22
    When I used the demo database as it was, the conversation was not written in the visual novel UI, but the conversation was written in the balloon above.
    How do I write to the visialnovelUI?

    Thank you for everything.
     
    Last edited: Apr 15, 2021
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @kuromatu - Assign the VN Template Standard Dialogue UI to the Dialogue Manager's Dialogue UI field:

    upload_2021-4-15_8-33-41.png

    You may also be interested in the free VN Starter Framework on the Dialogue System Extras page. It has features like backtracking, auto skip, history, etc., that are commonly seen in visual novels.
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Ova Magica - Available to Wishlist on Steam

    Check out Ova Magica, which is made by a solo developer using the Dialogue System for Unity and recently had a massive Kickstarter success in which the game was fully funded in the first 3 hours and reached over 1200% of its funding goal. You can wishlist it on Steam, and it's coming out on all the platforms, too.

    As one person wrote:


    Reminder: The Dialogue System, Quest Machine, and Love/Hate are all 50% off in the Sprint Into Spring Sale.
     
  6. kuromatu

    kuromatu

    Joined:
    Dec 27, 2019
    Posts:
    22
    I'm sorry, it's about cogiExample.
    The npc conversation is displayed in a speech bubble and the vnUI is blank.
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Inspect the character's Dialogue Actor component. Set Dialogue UI Settings > Subtitle Panel Number and Menu Panel Number to Default. This will use the UI assigned to the Dialogue Manager.

    upload_2021-4-15_13-13-40.png
     
  8. kuromatu

    kuromatu

    Joined:
    Dec 27, 2019
    Posts:
    22
    I’ve done it.
    Thank you very much.
     
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Glad to help!
     
  10. yangkairong

    yangkairong

    Joined:
    Aug 20, 2015
    Posts:
    16
    If the sequence is written in this way, an error will be thrown.

    Code (CSharp):
    1. CameraMove(700, -1325, 0);
    2. CharacterCreate(Employee_1)->Message(Yes);
    3. CharacterLocation(Employee_1, 37, 173)@Message(Yes);
    4. Continue()@Message(Yes);
    Error message:
    Code (CSharp):
    1. ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    2. Parameter name: index
    3. System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    4. System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    5. System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    6. PixelCrushers.DialogueSystem.Sequencer.CheckActiveCommands () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:893)
    7. PixelCrushers.DialogueSystem.Sequencer.Update () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:496)
    8.  
    This error does not occur when I put the command "Continue () @ Message (Yes);" on the first line.

    Code (CSharp):
    1. Continue()@Message(Yes);
    2. CameraMove(700, -1325, 0);
    3. CharacterCreate(Employee_1)->Message(Yes);
    4. CharacterLocation(Employee_1, 37, 173)@Message(Yes);
     
  11. yangkairong

    yangkairong

    Joined:
    Aug 20, 2015
    Posts:
    16
    1. Dialogue Editor feedback is slow, clicking on a task or conversation node does not respond for a long time, and the monitoring panel will not be refreshed, which makes people feel very stuck. It will be better after restarting the unity editor, but it will become very stuck after using it for a period of time.
    2. The loading speed is very slow. When I package the database into AB, it takes more than 1 second to complete the file loading and initialization of 200KB.

    Can you improve and optimize the above two points?
     
  12. yangkairong

    yangkairong

    Joined:
    Aug 20, 2015
    Posts:
    16
    When I use the command in the following way, the string does not get the default value I want.
    Code (CSharp):
    1. // Suppose this command can pass three parameters, all of which can use default values, and I can get the correct default values when I pass none of them.
    2. Cmd();
    3.  
    4. // When I write this as in the following example, the second parameter is of type string and is not passed, so there is no way to get the default value, but an empty string.
    5. Cmd(a, , c)
    The parsing code for C# parameters is as follows:
    Code (CSharp):
    1. // Here is an empty string.
    2. string second = GetParameter(1, "defaultValue");
    3. // I have to write this to get the default value I want.
    4. second = string.IsNullOrEmpty(second) ? "defaultValue" : second;
     
    Last edited: Apr 16, 2021
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @yangkairong - This sounds like a problem outside of the Dialogue System. Check your other scripts and assets for memory leaks. Also watch for any errors or warnings in the Console window.

    If you're using Unity 2019.2 or 2019.3, please update to 2019.4 or higher. Unity 2019.2 and 2019.3 have a serialization bug that causes major performance issues. Unity fixed it in 2019.4 and 2020.1.

    If you're using an older version of the Dialogue System, please back up your project and update to version 2.2.16. This contains performance updates for the Actors, Quests/Items, Locations, and Variables sections.

    For general Dialogue System editor performance, on the Dialogue Editor's Database page tick Editor Settings > Fast Undo for Large Databases. Also make sure the Auto Backup Frequency is not too frequent. (If it's set to zero, it will not make auto backups.)

    upload_2021-4-16_7-54-32.png

    You can also review the fields in the Templates page. Delete any fields that you don't need. Dialogue System versions 2.2.15 and earlier creates new databases with the default fields used by Chat Mapper. You really only need these fields if you're going to be importing and exporting between the Dialogue System and Chat Mapper. If not, you can delete these fields in the Dialogue Entry template, for example, to make your database smaller and faster to edit:

    upload_2021-4-16_7-54-6.png


    There should be no performance issues with a 200 KB database. However, if your database gets very large (e.g., 50-100 MB), you can split it into multiple databases. See: Working With Multiple Databases for considerations and tips.


    There should be no runtime loading issues with the database. Please review your scripts.

    You can, however, speed up Unity UI's runtime initialization of the dialogue UI layout by setting the Dialogue Manager's Warm Up Conversation Controller dropdown to Extra:

    upload_2021-4-16_7-57-27.png
     
  14. kuromatu

    kuromatu

    Joined:
    Dec 27, 2019
    Posts:
    22
    Is there a tutorial like "Gestalt: Steam & Cinder" in the demo video where 2d sprites face each other and talk?

    Is it possible to change facial expressions flexibly?
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    See the Dialogue UI Tutorial. That link has a link to the video version. I recommend the video version.

    Yes. Assign multiple portraits to the actor's Portrait Images section. Each one will have a number (1, 2, 3, etc.). Use the [pic=#] markup tag in Dialogue Text to use a specific image for that node, or use SetPortrait() to change the image permanently. For example, say pic 3 is a scared facial expression:
    • Dialogue Text: "It's scary in here! [pic=3]"
     
    Last edited: Apr 16, 2021
  16. kuromatu

    kuromatu

    Joined:
    Dec 27, 2019
    Posts:
    22
    Thank you for your reply.
    I changed the image of Portrait Image in Response Image of vnUI to a standing picture image, but when I play it, it is not displayed.
    Do I need to do anything from the Dialogue Manager Conversation?
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    In the Dialogue Editor, assign the images to the actor's Portrait Sprites:

    upload_2021-4-17_12-4-44.png

    Each one has a number. The first one is 1. Then they are numbered 2, 3, 4, etc.

    Then use that number in a [pic=#] tag in a dialogue entry node's Dialogue Text:

    upload_2021-4-17_12-6-55.png
     
  18. YOAJ1

    YOAJ1

    Joined:
    Jul 17, 2014
    Posts:
    26
    Using the MoveTo sequence command
    I want to move the character out of the camera
    It will return to its original position after moving

    I want you to stay outside the camera during the conversation

    MoveTo (Moonwell, Wisp, 3)
     
  19. kuromatu

    kuromatu

    Joined:
    Dec 27, 2019
    Posts:
    22
    Oh, I didn't have to change the portrait image to a standing image.

    I assigned the image to the actor Portrait Sprites and it was displayed successfully.
    Can I adjust the size and position of the image after assigning it? Or do you need to adjust before assigning?
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @AJD1 - Create an empty GameObject that is outside of the camera range. For example, call it "Off Camera Position".

    You can use the special keywords speaker and listener in sequences. If the dialogue entry node is assigned to the player, then the player will be speaker. So you can use this Sequence:

    upload_2021-4-18_8-12-37.png

    If the dialogue entry node is assigned to the NPC, then the player will be listener. (Technically, the character who is assigned to the Conversant dropdown will be listener.) So you can use this Sequence:

    upload_2021-4-18_8-14-54.png


    Hi @kuromatu - Yes, you can adjust the size and position. Inspect the dialogue UI and change the Portrait Image. For example, you can move its Rect Transform position or size:

    upload_2021-4-18_8-19-12.png
     
    Last edited: Apr 18, 2021
  21. kuromatu

    kuromatu

    Joined:
    Dec 27, 2019
    Posts:
    22
    Thank you.
    By the way, how should I specify the images of Subtitle Panels 0, 1 and 2?
    If I didn't do anything for the time being, an image appeared in Subtitle Panel 1 on the left.
     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Panel 1 should show the player's portrait image. If you don't want it to show, inspect panel 1 and change the Visibility dropdown from Always From Start to Always Once Shown.
     
  23. kuromatu

    kuromatu

    Joined:
    Dec 27, 2019
    Posts:
    22
    I understand a lot.
    If I want to make Actor 4 or later, I can make a standing picture by copying Subtitle Panel 3.

    By the way, when I click Subtitle Panel 1, the image of Response Menu Panel seems to overlap. What is this image?
     
    Last edited: Apr 18, 2021
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Yes. Remember to assign Subtitle Panel 4 to the Standard Dialogue UI component's Subtitle Panels list.

    The Response Menu Panel has its own portrait image for the player. If you don't want this image, just remove it:

    upload_2021-4-18_11-45-55.png

    Or, if you prefer, you can position it in the same position as Subtitle Panel 1's image.
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
  26. YOAJ1

    YOAJ1

    Joined:
    Jul 17, 2014
    Posts:
    26
    hideUccplayer.PNG

    How to hide the ucc player
    I want to hide the ucc player until the conversation scene is over
     
  27. kuromatu

    kuromatu

    Joined:
    Dec 27, 2019
    Posts:
    22
    Is there a way to turn off the ability to darken standing pictures that I'm not talking about in vnUI?
     
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @AJD1 - Since you're using UCC, you can use the UCC camera's Object Fader. While it might be more concise to handle it in a script, you can do it without any scripting:

    1. Add a child GameObject with a Dialogue System Trigger that starts the conversation. Assign the main NPC GameObject to the Conversation Conversant field:

    upload_2021-4-19_9-13-59.png

    2. Configure the main Dialogue System Trigger (the one that the UCC Interactable component uses) to do two things:
    • Set the Camera's Object Fader > Start Fade Distance to a high value such as 99 so it will fade the player.
    • Use SendMessage() to trigger the child GameObject after a short delay to give the Object Fader time to work.
    Add another Dialogue System Trigger set to OnConversationEnd that resets Start Fade Distance back to its original value:

    upload_2021-4-19_9-13-44.png
     

    Attached Files:

    YOAJ1 likes this.
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @kuromatu - Yes. You can edit the animations, or remove them entirely. To remove them, remove the Animator components from the subtitle panels.
     
  30. SOSolacex

    SOSolacex

    Joined:
    Jan 10, 2018
    Posts:
    121
    Hey Tony, after updating Dialogue system and Opsive's assets + integrations, I've had the little issue where my cursor doesn't get disabled upon first start (when playing). This cursor will disable itself after opening up and closing an inventory panel from UIS, however after closing a dialogue conversation, it stays on. I've tried playing around with the cursor settings (Unity Input component from FPC, Inventory canvas settings from UIS and cursor control settings in the dialogue manager), however I've not had any luck so far.

    Do you have any ideas?
     
  31. kuromatu

    kuromatu

    Joined:
    Dec 27, 2019
    Posts:
    22
    When the standing picture of Player is set in the Visual Novel Dialogue UI, Subtitle Panel 1 and Response Menu Panel are displayed at the same time.
    I tried erasing the Response Menu Panel, but this time the standing picture animation (eg, the standing picture that is not talking becomes darker) does not work.
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @SOSolacex - Inspect the Dialogue Manager GameObject's Input Device Manager component. Untick 'Control Cursor State'.

    Also, make sure your player's UCC "Input" component (e.g., UnityInput) has the "Conversing" state in its States list.
     
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Check if they share the same Image GameObject. If so, then don't delete it. If that doesn't help, please post a screenshot to help me understand what's going on.
     
  34. SOSolacex

    SOSolacex

    Joined:
    Jan 10, 2018
    Posts:
    121
    Hey Tony,
    What you said helped, to a certain extent- it would cause my cursor to either keep being enabled, or keep being disabled.
    And for example, did some more changes and I got to the point where my cursor would still keep getting disabled, even though I was in my inventory.. This would cause the cursor to get disabled when I had my inventory open whenever I'd move my mouse off the panel or if I moved my panel too quickly.

    So I noticed that on the Gameplay panel, the "select on hover" was automatically enabled after one of the updates.
    Turned that off and everything was fine!

    Thanks for the help. Cheers
     
    TonyLi likes this.
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Glad to help!
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Made With Unity Spring Showcase - Submit Your Game

    If you're making a WebGL game with the Dialogue System for Unity, Quest Machine, and/or Love/Hate, you can submit it here and Unity may feature it in their live Twitch stream. This is a great chance for some high profile exposure for your WebGL game!

    Made With Unity Spring Showcase Submission

    Reminder: The Dialogue System for Unity, Quest Machine, and Love/Hate are all 50% off right now in the Sprint Into Spring Sale.
     
    SickaGames1 likes this.
  37. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    When I have two characters with the same name like here:



    If I put the bottom one in the dialogue, it just doesn't show up. If I change his name he shows up perfectly clear with a portrait, but if it's the same as the top one it doesn't.
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    @Stickeyd - Give each actor a unique, non-blank name. Then set the Display Name to ???:

    upload_2021-4-20_14-15-4.png

    When the player learns the actor's name, you can set Display Name to another value.

    The Dialogue System Extras page has a "Discover Name Example" scene.
     
  39. Venominus

    Venominus

    Joined:
    Sep 5, 2015
    Posts:
    25
    I use Quest Trigger with OnTriggerEnter, the alert message is shown on trigger, but doesn't hide, it stays, even after several minutes in game.
    And second thing, when I have only one choice of dialogue player can deselect it, so when dialogue starts there is 1 choice with white color (selected), but then it is grey (deselected).
     
    Last edited: Apr 21, 2021
  40. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Thanks TonyLi! That issue solved.

    Another one. I need to hide the portrait name when the conversant(not the actor) of current dialogue node is "(None)". These nodes signify the author words. I tried to just put ("None") talking with("None") but that hides the NPC the dialogue is going with.
     
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Venominus - Are there any errors or warnings in the Console window? Check your dialogue UI's Alert UI Elements. Are Alert UI Elements > Panel and Alert Text assigned? Try unticking Wait For Hide Animation as a test.

    Then check the timing settings on the Dialogue Manager's Display Settings > Alert Settings.

    If you're not on the latest version of the Dialogue System, please try backing up your project and updating.

    Inspect the Dialogue Manager GameObject's Input Device Manager, and tick Always Auto Focus.[/QUOTE]
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Stickeyd - Add a script with an OnConversationLine method to the Dialogue Manager. In this method, check if there is no conversant. If there is no conversant, hide the portrait name/image. Example:

    Code (csharp):
    1. void OnConversationLine(Subtitle subtitle)
    2. {
    3.     // (Your code here may vary depending on your dialogue UI:)
    4.     var ui = DialogueManager.dialogueUI as StandardDialogueUI;
    5.     ui.conversationUIElements.defaultNPCSubtitlePanel.portraitName.gameObject.SetActive(subtitle.listenerInfo.id  != -1);
    6. }
     
  43. SOSolacex

    SOSolacex

    Joined:
    Jan 10, 2018
    Posts:
    121
    Hey Tony, I've noticed that whenever the user gets a response presented, the conversation doesn't auto scroll to the bottom.

    How can I make it so that the player doesn't have to manually scroll to the bottom to select their response after all the text has been shown?
     
  44. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Add a UI Scrollbar Enabler to your dialogue UI's Scroll Rect if it doesn't already have one. Then make sure it's assigned to the Standard UI Menu Panel's Scrollbar Enabler:

    upload_2021-4-21_10-41-25.png
     
  45. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    It works, but seems that my method of doing author words is still wrong for some reasons...

    So I'm doing it different right now. Sometimes I have "Author" actor talking to conversant "Player". But when that happens, for some reason NPC portrait hides. I don't want NPC that has been talking before to hide when author words appear. The only way I managed to make NPC not disappear is if "Player" talks to "Author" but that makes "Player" portrait get highlighted which I don't want.
     
    Last edited: Apr 21, 2021
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Stickeyd - Can you allow the Author to use a third subtitle panel that doesn't have a portrait image? That way it won't take over the NPC's subtitle panel.
     
  47. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Thanks! It works. Also, how do I hide one of panels with sequence/script? I want one of the NPCs to disappear at one point.
     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    There isn't a built-in way, but you can use the SendMessage() sequencer command. For example, to hide the subtitle panel named "Subtitle Panel 0", use this command:
    Code (sequence):
    1. SendMessage(Close,,Subtitle Panel 0)
    Or you could write a custom sequencer command if you don't want to go by panel name.
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Twilight Tower - Made with the Dialogue System

    Check out Twilight Tower, a survival horror/roguelite/dark decision-making card game hybrid with a creepy, other-worldly narrative.



    Reminder: The Dialogue System for Unity, Quest Machine, and Love/Hate are all 50% off right now in the Sprint Into Spring Sale.
     
    YevgenG likes this.
  50. YevgenG

    YevgenG

    Joined:
    Oct 17, 2018
    Posts:
    22
    Hey, @TonyLi ! Have a question about scroll bar behavior of the dialogue vindow in Runic template

    As you may see inn the attached video when there is too much text to fit in one screen the scroll handler twitches but part of the text, mainly answers, remains hidden and player should scroll to see them. Please, may you tell is there any way to make scroll window to show answers when they appear, without a neccesity to scroll each time to see them?

    I was truying to use Autoscroll functionality but it seems either I made it wrong, or it didn't work for me properly. If this is the solution I need, maybe there is somewhere an example of this in the asset pack? :)