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. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    I'm basically using your prefab in this screen share
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    As a test, does it work correctly if you use the Focus Standard Dialogue UI as provided in the package?

    Can you send me an example scene?
     
  3. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Okay I figured out that Player focuses because of auto dialogue entry. NPC focuses at first correctly but player focuses as well because he had auto dialogue entry before
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @Stickeyd - Were you able to resolve the issue, or would to continue investigating this?
     
  5. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    No I haven't resolved it. I know that the problems is because of auto entry but I don't know how to make it so auto entry doesn't make player focused. As you remember I created auto entry so that player character is showed at the entry of another character
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Try removing the auto entry and setting both panels' Visibility to Always From Start.
     
  7. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Than the player is showed at the very first entry which is authors word. I don't want this. We changed visibility to Always One Shown and created auto entry so that character doesn't appear on start.

    I'm using your focus prefab.

    I want it like that

    Entry 1 - Authors words. No characters appear
    After that there is auto entry so the player is showed in next one.
    Entry 2 - NPC talking to Player. Both character appear, but only NPC is focused. But at this entry they actually appear both focused

    It's a little bit hard to send you a project as my scene is very heavy and I need to create new one and reproduce dialogue there. Maybe we can do smth like screen share?
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    I will be out of the office for a few hours. When I return, I'll send you an example scene. If that doesn't help, we can do a screen share.
     
  9. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Okay. Waiting for scene
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @Stickeyd - Sorry for the delay. Here's the example scene. (Other readers: Note that this example works properly in version 2.2.0, which is pending release on the Asset Store.) I exported it from Unity 2019.1. [Edit: Replaced with 2017.4.1 version below.]
     
    Last edited: Sep 2, 2019
  11. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    For some reason I have missing prefabs there. My unity version is 2017 4.5f1(I can't update because of other assets in the project). Could it be related?
     
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @Stickeyd - Yes. Unity 2018.3+ uses a new prefab system. I'll build a version in Unity 2017.4. I just discovered a bug in the Dialogue Editor window that wasn't covered by any test cases. I need to pull the pending update, fix the bug, and resubmit the update. I'll send you an updated example and an updated patch.
     
  13. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    I hope that we can finish it soon because I have a very big deadline at 8 of September and I need this to work in 1-2 days
     
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Here's the updated Focus Example scene. (Other readers: This is designed for version 2.2.0+.)
     

    Attached Files:

  15. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    The problem with your example is that first NPC appears and then player(after pressing continue). And I need them at the same entry, at the same time
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Did you import the patch that I PM'ed you? The example scene uses a new sequencer command OpenPanel() so you don't have to create a dummy node for the player. If you haven't imported the patch, then it won't use the sequencer command, and the player's panel won't appear until the player speaks.
     
  17. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Solved all the problems! Thank you for your amazing asset, your great work and support.
     
    TonyLi likes this.
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Happy to help!
     
  19. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    @TonyLi
    Quick Question: How do I perform(simulate) a "Continue" for my Player's response? I want my Player to say monoglues sometime that doesn't need a user response. Like: "Looks like this door is locked. need to find another way"
    Same when he receives a Radio call.
    Is tried this:
    Dialgoue-skip response.PNG
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @SamRock - Set the Default Player Sequence field to:

    Continue()@{{end}}

    This tells the Continue() command to run after the {{end}} duration, which is based on the Dialogue Text length.

    Then clear the Default Response Menu Sequence, which is only played while showing a response menu, not once the player has selected a response.
     
    SamRock likes this.
  21. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Awesome! Thank you so much :)
     
    TonyLi likes this.
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Dialogue System 2.2.0 Released

    Version 2.2.0 is now live on the Asset Store!

    This is a big update packed with improvements, bug fixes, and third party integration updates, including new support for Look Animator, which makes your conversations feel much more alive when naturally characters look at each other while talking.

    IMPORTANT UPGRADE NOTES:
    • Minimum version is now Unity 2017.4.
    • For best upgrade results, delete the previous Plugins / Pixel Crushers / Dialogue System folder before importing this version.
    • Back up your project before importing or updating any asset, including this update.


    Release Notes:
    Core:
    • CHANGED: Minimum version is now Unity 2017.4.1f1.
    • Editor:
      • Improved: Better recognition of Welcome Window options changes (e.g., Cinemachine, articy:draft, etc.).
      • Improved: Enabling an option now applies to all installed build targets, not just current.
      • Improved: Can now double-click nodes to enter Dialogue Text directly on them.
      • Improved: Added character count in Dialogue Text & Menu Text entry.
      • Improved: Default Sequence fields are now multiline text areas in the DialogueManager and conversation Override Display Settings.
      • Improved: Localization import now has option to import main text updates as well.
    • Engine:
      • Added: Lua functions GetEntryText(), GetEntryBool(), GetEntryNumber().
      • Added: Sequencer commands AudioStop(), OpenPanel(), SendMessageUpwards().
      • Improved: Reports warnings when using {{shortcut}} sequencer tags that don't exist.
      • Improved: Usable component now uses target's Dialogue Actor name if present.
      • Improved: Sequencer commands can now find inactive GameObjects by name even if root parent is inactive.
      • Improved: ConversationView.GetDefaultSubtitleDuration now factor in RPGMaker code lengths.
      • Fixed: Possible NullReferenceException when splitting on pipes.
      • Fixed: When barking from a conversation, the speaker & listener were swapped.
    • UI:
      • Improved: Added option to delay typewriter effect until Show animation completes.
      • Improved: Typewriter effect handles StartTyping(fromCharacter) with pause codes in text preceding fromCharacter.
      • Improved: Standard Bark UI's isPlaying property stays true until continue button click if Wait For Continue is ticked.
      • Improved: UIPanel.OnHidden method is now virtual.
      • Fixed: TextMesh Pro Typewriter Effect now handles special TMP tags when starting typewriter at an offset.
      • Fixed: Subtitle panels that can focus/unfocus and whose Visibility was set to Only During Content sometimes showed subtitle unfocused.
      • Fixed: ClearSubtitleText() didn't clear when subtitle panel was configured to accumulate text.
      • Fixed: If Standard Bark UI's Use Name checkbox is unticked, it now hides the Name GameObject.
      • Fixed: If Standard Bark UI didn't have a canvas in its hierarchy, it didn't play Hide animations.
      • Fixed: Bark Group Members now automatically register their groups on start.
    • Save System:
    • Improved: Disk Saved Game Data Storer methods are now virtual.
    • Fixed: Disk Saved Game Data Storer WebGL build error message.
    • Fixed: Bug in Position Saver with Multiscene ticked.
    Third Party Support:
    • articy:draft: Convert Markup now converts \&lt; and \&gt; back to < and >; added checkbox to enable/disable Split Text On Pipes.
    • Corgi: Updated for Corgi 6.0; updated BarkUI prefab to use StandardBarkUI instead of older UnityUIBarkUI; Added PermitAbility sequencer command.
    • Emerald AI: Added Lua function to get enemy's health.
    • Inventory Engine: Optimized Lua functions.
    • Look Animator: Added support.
    • ORK Framework: Added example scenes.
    • SuperTextMesh: Updated to support Delay Typing Until Open.
    • TextMesh Pro: Removed legacy TextMesh Pro Support package since Dialogue System has native TextMesh Pro integration. (Legacy package is on Extras page.)
     
    DMRhodes and SamRock like this.
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    SamRock likes this.
  24. Clancy92

    Clancy92

    Joined:
    Oct 10, 2016
    Posts:
    2
    Hi there,

    I'm trying to get the Inkle unity integration up and running and I think I'm doing something wrong when it comes to the step of adding a blank database to the Dialogue Manager object. According to the instructions -

    "The Dialogue System Ink Integration component will create another database at runtime and add it to the Dialogue System's runtime environment."

    This does not seem to be happening when I hit play. The only databases visible are the blank database I created and the sample databases.

    I'm not sure where I'm going wrong, any help would be greatly appreciated!
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @Clancy92 - Does the example scene work correctly for you? It's in Plugins / Pixel Crushers / Dialogue System / Third Party Support / Ink Support / Example. If you don't see the example, make sure you've imported the Ink Support unitypackage located in the Third Party Support folder.

    Did you add a Dialogue Manager prefab to your scene and assign your blank database to it?

    The database that the Ink integration creates at runtime is only in memory. It's not an asset file, so it won't be visible in your Project view.
     
  26. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    242
    Hi, I'm using DS and Salsa suite textsync, which is the sequencer line to stop using textsync (for thoughts for example) ?
     
  27. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Can you point those lines (thoughts, narrator, etc.) to a different GameObject, such as a child GameObject? As long as the different GameObject doesn't have a TextSyncActor, it won't use TextSync.

    If that doesn't cover your needs, I can add a sequencer command to turn the TextSyncActor on and off.
     
    shredingskin likes this.
  28. Clancy92

    Clancy92

    Joined:
    Oct 10, 2016
    Posts:
    2
    Hi Tony,

    I'm not sure what was going wrong but I restarted Unity and it's working for me. Thank you for the prompt response anyway!
     
    SamRock likes this.
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    You're welcome! I'm glad it's working now.
     
    SamRock likes this.
  30. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    For some reason my player image fades like several times when I have more than one dialogue
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Do you need to change the subtitle panel's Visibility dropdown?
     
  32. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    No, I don't think so. Why are you asking?
     
    Last edited: Sep 7, 2019
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    I'm trying to understand why it fades (focus/unfocus) several times. If Visibility is set to Only During Content, then it will focus and unfocus for each dialogue entry node.

    Can you please send me steps to reproduce the issue?
     
  34. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    I think it's because it changes color of the Portrait Image at all. At the first dialogue it works perfectly fine even without this image change. I think it works fine because you sent me script which changes alpha of the canvas. But at the end of each dialogue for some reason it makes my image more transparent.

    My visibility is Always Once Shown

    https://gyazo.com/669f4846fdef76bef194fa0ee5c3abc0

    Here is my player subtitle panel https://gyazo.com/db6c6cf21d9a29fb6b101f356fac993d
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    I had assigned one thing wrong in one of the focus examples I sent you, but I attached a fixed version to a later reply. Check these:
    1. Show and Hide animations change the subtitle panel's CanvasGroup.Alpha. (Show changes Alpha from 0 to 1.)
    2. Focus and Unfocus animations set the subtitle panel's CanvasGroup.Alpha to 1 and change the Portrait Image's CanvasGroup.Alpha. (Focus changes Portrait Image CanvasGroup.Alpha from 0.5 to 1.)
     
  36. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Fixed. Is there a way to put 3 characters on the dialogue? I need 3 portrait images. It will work like in Pyre, where sometimes 2 characters are on one side. Here is video with timestamp.
     
    TonyLi likes this.
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    @Stickeyd - Yes, add another subtitle panel for the extra character. This will make 4 subtitle panels for you: Narrator, Player, general NPC, extra NPC. Tell the extra NPC to use the new panel.

    Look at the VN template for an example. It has 3 subtitle panels: one for the Player and two for NPCs.
     
  38. bholland

    bholland

    Joined:
    Mar 24, 2017
    Posts:
    28
    Good Afternoon! I've just started getting my feet wet with Dialogue System and so far I'm loving it. I'm using it with Opsive's UFPS from a first person view and when I do a cut scene with a camera zoom in, the camera snaps back after the movement time. I used Dialogue System Events to disable then enable the camera controller in the main camera during the conversation, but it seems like UFPS is still taking camera control back after the initial movement time. Any information would be extremely helpful. Thanks!
     
  39. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @bholland - Thanks for using the Dialogue System! Are you using UFPS version 1 or version 2?

    If you're using version 2, please follow the Opsive Character Controllers Support steps. If you're running a cutscene during a conversation, and if the Converse action's Detach Camera is ticked (the default value), then it will free up the camera to be controlled by the Dialogue System during the conversation.

    If you're running a cutscene outside of a conversation, try setting the Dialogue System Events to disable the UFPS CameraController component during the cutscene.
     
  40. bholland

    bholland

    Joined:
    Mar 24, 2017
    Posts:
    28
    Thanks for the reply @TonyLi I followed that proceedure, ensured I was up to date on everything and worked my way through all the warnings on my scene, it is still snapping back (during a conversation). I'll keep looking at it, any other tips are always appreciated. Great asset though, it has been a lot of fun to work with.
     
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @bholland - Thanks! If you get stuck, please let me what version of UFPS you're using, whether the cutscene is part of a conversation, and how you're triggering it.
     
  42. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    How to exactly assign my extra character to the new panel? It seems that even with a narrator I use only 2 panels. Thanks.
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Add a Dialogue Actor component to the extra NPC's GameObject. Set its Dialogue UI Settings > Subtitle Panel Number.

    If the extra NPC doesn't have a corresponding GameObject, you can use the SetPanel() sequencer command at the beginning of the conversation.
     
  44. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    For some reason extra character doesn't appear. I figured out that only characters which are setted as conversant or actor in Dialogue System Trigger appear. But I can't set extra character there because there are only two slots. What do I do?
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    You don't need to set it in the Dialogue System Trigger. Let's say your database has three actors:
    • Player
    • NPC1
    • NPC2
    And your conversation uses Player and NPC1 as the primary participants:

    upload_2019-9-11_10-26-31.png

    However, the conversation also uses additional actors:

    upload_2019-9-11_10-31-44.png

    Assign Player and NPC1 to the Dialogue System Trigger.

    Then add a Dialogue Actor component to a GameObject that represents NPC2. From the actor dropdown, select NPC2. Then set Dialogue UI Settings > Subtitle Panel Number to Panel 2:

    upload_2019-9-11_10-25-15.png

    The conversation will find NPC2 because of the Dialogue Actor component.

    By default, NPCs (that is, NPC1) will use panel 0.

    By default, the Player will use panel 1.

    Because NPC2 has a Dialogue Actor that tells it to use panel 2, it will use panel 2.

    I've attached an example scene. It ends up looking like this:

    upload_2019-9-11_10-29-27.png
     

    Attached Files:

    Last edited: Sep 11, 2019
  46. Grimir

    Grimir

    Joined:
    Sep 5, 2017
    Posts:
    20
    Hi @TonyLi. I've recently udpated from 1.8 to newest version. Everything seems fine except one thing. All dialogue entries in all my conversations are unreachable for cursor, hidden in upper left corner. I can use auto arrange to gain access to them, but I would really like to know if there is a way to restore my pre-update node arrangement?
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @Grimir - Do you remember the previous version number? Version 1.8.0+ should have kept the node arrangement intact. If you still have access to a version of your project in that version, you can export your database to Chat Mapper XML format. Make sure to tick all the checkboxes (Export Actors, Export Items/Quests, etc.) including Export Canvas Positions. Then use the Chat Mapper Import window to import the database into your version 2.2.0 project.

    If you want to just use auto-arrange, version 2 now lets you select a portion of the tree and auto-arrange it. So you can selectively auto-arrange parts and move them around to fine-tune your arrangement.
     
  48. Grimir

    Grimir

    Joined:
    Sep 5, 2017
    Posts:
    20
    Thanks @TonyLi, importing this way helped.
     
    TonyLi likes this.
  49. Orexx

    Orexx

    Joined:
    Jun 4, 2017
    Posts:
    26
    Hello, I'm trying to learn how to work with your plugin Dialogue System for Unity.
    I read the manual and never dealt with the lua language, so I had a few questions.
    I use two plugins in the Unity - FlowCanvas and NodeCanvas, and there I create most of the variables of various types.
    Is it possible to take the value of a variable from the permissible FlowCanvas in the tab Conversations? (I attach the picture 0 where it is shown more clearly).
    How to make the next child node out of three, for example, randomly selected? (I attach the picture 1).
    In my project, I need to repeat the dialogue many times, but every time I try to use random words from randomly selected child nodes. Is it possible to repeat the dialogue to infinity again, for example, when the Boolean variable is equal to true?
    sometimes after the backup your plugin makes, this red message appears in my console and I have to close the Dialogue Editor tab and reopen so that when I click on a child node in the inspector, the node editing window opens.
    i used latest version Dialogue System for Unity and Unity3D 2018.3.14f1
     

    Attached Files:

    • 0.jpg
      0.jpg
      File size:
      167.1 KB
      Views:
      482
    • 111.jpg
      111.jpg
      File size:
      347.9 KB
      Views:
      495
    • red.png
      red.png
      File size:
      12 KB
      Views:
      494
    Last edited: Sep 14, 2019
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @Orexx - Thanks for using the Dialogue System!
    Yes. Register a C# method with Lua (see Registering Functions) to read a FlowCanvas or NodeCanvas Blackboard variable. There is a starter template script named TemplateCustomLua in Dialogue System / Templates / Scripts. For example, to read an Integer Blackboard variable, you could register a C# method called GetBBInteger(). Then use GetBBInteger() in the Conditions field of a node to check the value of X.

    The C# method might look something like this:
    Code (csharp):
    1. public double GetBBInteger(string gameObjectName, string variableName)
    2. {
    3.     var go = GameObject.Find(gameObjectName);
    4.     if (go == null) return 0;
    5.     var blackboard = go.GetComponent(typeof(IBlackboard));
    6.     if (blackboard == null) return 0;
    7.     var variable = blackboard.GetVariable<int>(variableName);
    8.     if (variable == null) return 0;
    9.     return variable.value;
    10. }
    You'd register it like this:
    Code (csharp):
    1. Lua.RegisterFunction("GetBBInteger", this, SymbolExtensions.GetMethodInfo(() => GetBBInteger(string.Empty, string.Empty)));
    And use it like this:

    upload_2019-9-14_9-38-13.png

    Blue nodes are assigned to the player. When there is more than one player node, the Dialogue System shows a response menu. If you link to three gray NPC nodes, then you can use RandomizeNextEntry() in the Script field:

    upload_2019-9-14_9-11-52.png

    The conversation will randomly choose one of the gray NPC nodes.


    Yes. Link back to the beginning of the loop. I like to use a Group node for this. (See the node labeled <Restart> below.) When you tick a node's Group checkbox, it doesn't show any text. It's a good way to organize branches of nodes:

    upload_2019-9-14_9-22-6.png

    To randomize text inside a node, you can use the RandomElement() function. In the screenshot above, the node on the right will randomly show "It's rainy." or "It's wet." or "It's stormy."


    Something has locked the file "Dialogue Database (Auto-Backup).asset". Are you editing this file? You should edit the original database, not the auto-backup. BTW, you can turn off auto-backups entirely by going to the Database tab. Expand Editor Settings and set Auto Backup Frequency to 0. You can also change the Auto Backup Folder. Maybe Unity is having an issue replacing backup files in the root Assets folder for some reason.
     
    Last edited: Sep 14, 2019
    SamRock and Orexx like this.