Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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:
    200
    "Special Request" added to backlog!
    You definitely can, but its not implemented yet. Will keep you posted :)
    Azure.PNG

    Will use the Menu Framework for load screen! Thank you so much.

    BTW, I followed your example to create Main Menu screen and have the Dialogue Manager in that scene rather than the game scene. However since I use "Override UI" component on few Trigger collidiers, I get a "missing object" error on the Game scene as all UIs are under Dialogue Manager. Is it okay to keep Dialogue Manager in each scene?
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    The short answer is no. In its normal configuration, at runtime the Dialogue Manager from the Main Menu screen will survive scene changes and automatically get rid of any new Dialogue Managers that appear in subsequent scenes. It's possible to override this behavior, but that leads to its own issues. Instead, I recommend putting the Override Dialogue UI components, and the dialogue UIs that they use, in the scenes where they're used, not under the Dialogue Manager. You can point an Override Dialogue UI to a prefab, too. When the Override Dialogue UI is used, it will automatically take care of instantiating the prefab for use during the conversation.
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Last Epoch - Steam's Best of 2019 New Releases

    Check out Last Epoch, made with the Dialogue System for Unity and chosen as one of Steam's 'Best of 2019 - New Releases!'

     
    magique and SamRock like this.
  4. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    414
    Okay, that's how I was planning to do it if there wasnt a better solution. I thought it would be good to have events such as OnAnyConversationStart, OnAnyConversationEnd in case objects who arent participants can react easily, Im not saying the above solution is hard its just not visual and with lots of events I tend to forget whats going on lol, anyway I will keep them on the DialogueManager for now, even tho I have to assign them in every new scene I create.
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    It would be very inefficient to send events like those to every single GameObject in the scene. This is why events are only sent to specific GameObjects. Instead, you could create a new script using the code in my previous post. The script below can be on any GameObject and will respond to OnConversationStart/End events.

    DialogueSystemEventsAnywhere.cs
    Code (csharp):
    1. using UnityEngine;
    2. using UnityEngine.Events;
    3. using PixelCrushers.DialogueSystem;
    4.  
    5. public class DialogueSystemEventsAnywhere : MonoBehaviour
    6. {
    7.     public TransformEvent onConversationStart = new TransformEvent();
    8.     public TransformEvent onConversationEnd = new TransformEvent();
    9.    
    10.     void OnEnable()
    11.     {
    12.         var dsEvents = DialogueManager.instance.GetComponent<DialogueSystemEvents>();
    13.         dsEvents.conversationEvents.onConversationStart.AddListener(ReceivedOnConversationStart);
    14.     }
    15.      
    16.     void OnDisable()
    17.     {
    18.         var dsEvents = DialogueManager.instance.GetComponent<DialogueSystemEvents>();
    19.         dsEvents.conversationEvents.onConversationStart.RemoveListener(ReceivedOnConversationEnd);
    20.     }
    21.    
    22.     public void ReceivedOnConversationStart(Transform actor)
    23.     {
    24.         onConversationStart.Invoke(actor);
    25.     }
    26.  
    27.     public void ReceivedOnConversationEnd(Transform actor)
    28.     {
    29.         onConversationEnd.Invoke(actor);
    30.     }  
    31. }
     
    SamRock likes this.
  6. Syllvia

    Syllvia

    Joined:
    Mar 26, 2013
    Posts:
    14
    Howdy there! I picked up Quest Machine and Dialog System and i'm curious if using one of those for the basis of my game's Faction system is a good call. I don't plan naything super ocmplex, mostly jsut a Halo-esk "these units are on team 1, these are on team 2, usuallyt hey fight but i can change their relations if I want". I know quest system has a nuanced relation system, and i know dialog system has a simpler one, would either of those be a decent call to base the units on or are they a bit too tied into thier own uses to like, make such heavy use of?

    I can likely write my own, but since i do WANT to integrate into stuff like quest machine, i just wanna makes ure that however i do this is as compatible as possible, and if i can jsut use the quest machine system (even without much else attached) for all NPCS/player relations that'd b egreat.

    _edit_ I started poking at Love/Hate and it def seems alot more akin to waht i'm after. Would this work well enough for a foundational fanction system, that like, behavior trees and action combat charracters compare eachother against?
    cuz it def sounds like you could get some fascinating STALKER-esk world stuff going on using all three of these major frameworks together, and if i can just use love/hate even in a simple form for the faction stuff that'd be great.
     
    Last edited: Dec 30, 2019
  7. Ravenous

    Ravenous

    Joined:
    Mar 5, 2013
    Posts:
    5
    Heya, I've been trying to implement this with DoozyUI and I get a problem where the coroutine doesn't start because the doozy ui button is inactive once the conversation ends. I'm using the standard dialogue UI.
     
    SamRock likes this.
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Hi @Syllvia - Yes, Love/Hate is what you're looking for. It's designed to do exactly what you described. It also has integration with Quest Machine and the Dialogue System, as well as other assets such as Behavior Designer, NodeCanvas, Emerald AI, UCC, etc.

    @Ravenous - I'll put together a little DoozyUI example scene and post it here.
     
    SamRock likes this.
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    @Ravenous - I've attached a DoozyUI example to this post, exported from Unity 2019.1, Dialogue System 2.2.4, and DoozyUI 3.1.0. Here are some notes on the setup:
    • It uses 2 small scripts:
      • DontDeactivateOnHide: Tells a UIPanel to not deactivate its GameObject, since DoozyUI will handle deactivation.
      • StandardDialogueUIDoozy: Use in place of StandardDialogueUI. (To replace it, use the triple bar menu in the upper right of the inspector to change to Debug mode. Then drag StandardDialogueUIDoozy into the Standard Dialogue UI component's Script field.)
    • The Alert Panel and Dialogue Panel both have Doozy UIViews. Their UIPanels (a Dialogue System component) are configured like this:

      upload_2019-12-30_20-35-3.png

      It also has a DontDeactivateOnHide script. Although I suppose you could get away with it if you changed OnOpen() to first call UIView.InstantHide before ResetToStartValues and Show.

    • The Response Menu Panel is configured like this:

      upload_2019-12-30_20-38-53.png

      It also has a DontDeactivateOnHide script, but it's probably not necessary since the OnOpen() event calls UIView.InstantHide.

    Tip: In the example scene, you can deactivate and reactivate the GameObjects named "Alert" and "Conversation" to test starting conversations and alerts multiple times.
     
  10. Ravenous

    Ravenous

    Joined:
    Mar 5, 2013
    Posts:
    5
    Thank you! Sorry if the question had been asked before.
    Edit: Can't seem to find your example scene
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Happy to help! You're not the first to ask about DoozyUI, but I hadn't been able to make time to dig into it until today. If you run into any issues or have questions, just let me know.
     
    SamRock likes this.
  12. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    200
    @TonyLi
    WOW! That was quick and just on time! I was looking for some DoozyUI examples too.
    I am struggling with Showing a pause menu when Escape key is pressed, since all DoozyUI come from main Menu scene. My Level scene has its own camera.

    It's amazing how quickly you came up with a solution for the above query!! :eek:

    HOW DO YOU DO IT?!!!
     
    TonyLi likes this.
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    @SamRock - If you're using the Dialogue System's free Menu Framework addon, it uses UIPanel components, too, so I think you should be able to follow the same idea as the example above. And if you run into any issues, let me know.
     
    SamRock likes this.
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Disco Elysium - PC Gamer's Game of the Year

    PC Gamer just selected Disco Elysium, made with the Dialogue System for Unity, as their Game of the Year. Congratulations, Studio ZA/UM!

     
    SamRock likes this.
  15. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    200
    Congratulations again @TonyLi ! What a great way to end the year! :)
    Wish you and your loved ones a very Happy New year! Thank you so much for all the support you gave me here, the amount of work gone into your Asset is just mind blowing. You have solution for every single problem :)
     
    TonyLi likes this.
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Thanks! Happy New Year, everyone!
     
  17. Froghuto

    Froghuto

    Joined:
    Oct 4, 2012
    Posts:
    60
    Thanks for adding CustomLuaFunctionInfo in the latest update, that really comes in handy! The only thing I'm missing is "Item" as Parameter type (which would basically be the name of the item in the end), similar to Actor, Location etc. Would it be possible to add this?
     
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Sure! I'll add it in the next version.
     
    Froghuto likes this.
  19. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    232
    Hello,
    I'm trying to trigger a TMP Bark UI.
    I've prepared a prefab that has "Text Mesh Pro Bark UI" component and assigned its "TextMeshPro UGUI" parameter.
    but I can't assign it to "Dialogue Actor" component's Bark UI field. Its type is "Abstract Bark UI"
    I can assign Standard UI components though.
    I have "TMP_PRESENT" as Script Define Symbol if it makes any difference in this situation.
    I must be missing something but your example barks UIs don't use TMP versions so I couldn't figure it out.
    Thanks.
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Hi @gurayg - Please do not use the "TextMesh Pro Support" package. It was only included in older versions of the Dialogue System for compatibility with 1.x projects.

    The Dialogue System now has native TextMesh Pro integration.

    1. Remove the deprecated Pixel Crushers/Dialogue System/Third Party Support/TextMesh Pro Support folder.

    2. Select menu item Tools > Pixel Crushers > Dialogue System > Welcome Window. Then tick the TextMesh Pro checkbox.

    You can now assign TextMeshProUGUI elements to the Standard Bark UI. If a UI Text element is already assigned, unassign it to reveal the TextMeshProUGUI field.

    (Side note: Version 2.2.4 now also has native Super Text Mesh integration.)
     
    gurayg likes this.
  21. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    232
    Thanks for yesterdays ultra fast support!

    I'm trying to show some basic tutorial texts triggered by colliders (trigger)
    I decided using a Bark UI would do the job since it is just some basic tutorial.
    I tried "conversation" and "text" for Bark source but I can't make it work as I want for different reasons.

    For "conversation" source I'm keeping "tutorialProgress" as LUA int variable and triggering based on that but I couldn't manage to work Barking order.
    I use "Sequential" but it shows the first one all the time. Do I need to set an entry Invalid after I display it? How can I do that?

    For "text" source your tooltip says it can be localized if there is an assigned text table.
    So I assign it and set the language but when the bark triggers it displays the text table field directly not the language text for that field.
    Example: Field is "Tut1" in text Table and en Language is "This is tut01"
    I enter as "Tut1" in bark text and it displays just that.
    I was expecting it to display the Language text.

    Hope I was clear enough
    Thanks for the help.
     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Hi @gurayg - Set Conditions on each node so that only one is true for each value of "tutorialProgress". In the example screenshot below, I called the variable "step" instead of "tutorialProgress", but the idea is the same:

    upload_2020-1-7_10-18-44.png

    This may not be important if you use the solution above. But if you end up using the Text source, then try assigning a UILocalizationManager component to the Dialogue Manager. Assign your text table to the Dialogue Manager's Display Settings > Localization Settings > Text Table field.
     
  23. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    232
    Thanks again.

    I made it work like you said with "Conversation" as source but I also somehow need to associate each bark with a collider. Otherwise player might enter colliders in non linear order and see the wrong tutorial text at the wrong place.
    I also made the Script field as Variable["step"]= x (x is the value for the next tutorial text) but I can't get around the player going through colliders in non-linearly. Maybe I should disable the GO completely after the bark is displayed.

    I also tried Text source for this so that way I might associate a place with a tutorial text. But I couldn't make it work.
    I set up Dialogue System Controller with Text Table and language.
    I added a UI Localization Manager and assigned its text table property as well.
    I have a GO with DS on Trigger enter that bark as text source with the text "tut01"
    "tut01" field is assigned as "this is tutorial1" in the text table.
    I tried adding Localize UI components to trigger GO but didn't work either.
    I don't think the bark text field is looking at the text table.
    I ran DS in Info log mode. It says:
    Dialogue System: Tutorial Trigger (UnityEngine.Transform) barking string 'tut01'.
    I must be missing something obvious here.
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    You can use the Conditions section of each Dialogue System Trigger so it will only bark if "tutorialProgress" is the right value.

    Please import the attached patch. Sorry, it wasn't sending literal bark text through the localizer. This patch will also be in the next full release version.
     

    Attached Files:

    gurayg likes this.
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Adventure Creator Integration Updated

    The Dialogue System Extras page has an updated integration package for Adventure Creator 1.67.0.
     
  26. imump

    imump

    Joined:
    Jul 3, 2011
    Posts:
    53
    Hey mate,

    I seen that Love/Hate has integration with Catsoft Game Creator, are you planning on doing the same with your Quest and Dialogue systems?
     
  27. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    222
    Hi TonyLi,
    I have some warnings, to head this off before it becomes an issue.

    What functions do I need to migrate to?

    upload_2020-1-9_21-46-15.png
     
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Hi @Mazak - Please use StandardDialogueUI instead of UnityUIDialogueUI. If you already have a dialogue UI layout that uses the UnityUIDialogueUI script and you want to continue using it, remove the UnityUIDialogueUI script and add a StandardDialogueUI script in its place. Then do the same for the response button. (Replace UnityUIResponseButton with StandardUIResponseButton.) Finally, add a StandardUISubtitlePanel script to each of your subtitle panel(s) and a StandardUIMenuPanel script to each of your response menu panel(s). Then make all the assignments in the inspector for those scripts.

    You can find a bunch of StandardDialogueUI prefabs in Plugins / Pixel Crushers / Dialogue System / Prefabs / Standard UI Prefabs. The Basic Standard Dialogue UI prefab is a good one to examine for an example, or as a starter prefab if you want to set up a UI from scratch.
     
  29. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    222
    I examined your advice, this looks like I will need to redo most if not all of my UI. This makes me grouchy.
     
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    @Mazak - The StandardDialogueUI is a big improvement over UnityUIDialogueUI, incorporating the user feedback gained from all the 1.x versions. It's easier for people to set up and customize, without all the workarounds required for situations such as overriding subtitle panels for specific characters. And it provides other feature

    However, you can keep using UnityUIDialogueUI if you prefer. I put the warning in there to let folks know that it might not be included in the main package at some point, at which time it will be be moved into a separately-importable unitypackage. This probably won't happen until/if there is a version 3.x, which may very well be after you release your game. In the next update, I'll add support for a scripting define symbol SUPPRESS_UI_DEPRECATION_WARNING that you can add to suppress the warning about UnityUIDialogueUI etc. being deprecated.
     
    Mazak likes this.
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Text Animator Now Includes Dialogue System Integration

    Febucci Creations' Text Animator now has Dialogue System for Unity integration.



    This opens up UI designers to use Unity UI, TextMesh Pro, Super Text Mesh, and/or Text Animator all with native integration in the Standard Dialogue UI system. (You can also still use NGUI and TK2D with integration packages for them, too.)
     
    Mazak likes this.
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
  33. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    414
    Hello,

    Im using EasySave3 and I want to extract all the data and save it from my own code, so I read about this:

    string s = SaveSystem.Serialize(SaveSystem.RecordSavedGameData());

    Is it optimal to use it for just saving just the dialogues (not NPC position like in the demo)? I also have your quest system and love/hate, maybe there is a system that saves all 3?
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Hi @skinwalker - Yes, that line of code will save all 3. Make sure you've set up a GameObject (typically the Dialogue Manager) with these components:
    • SaveSystem
    • DialogueSystemSaver
    • JsonDataSerializer or BinaryDataSerializer
    • PlayerPrefsSavedGameDataStorer, DiskSavedGameDataStorer, or ESDataStorer. It doesn't matter which one you choose; they aren't used in this case, but they remove a warning about the SaveSystem not having a saved game data storer available,
    Quest Machine's Quest Journal and Quest Giver components will automatically include their save data if you've ticked the save options in their Save Settings foldout.

    To save Love/Hate, add a FactionManagerSaver to the Faction Manager and FactionMemberSavers to the faction members.

    After running that line of code, you can save the string using ES3.

    To restore it, get the string from ES3 and run:
    Code (csharp):
    1. SaveSystem.ApplySavedGameData(SaveSystem.Deserialize<SavedGameData>(s));
     
    skinwalker likes this.
  35. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    414
    Okay, I hope there wont be any problems when I start adding more quests, relationships or dialogue variables in the future.

    I should be able to load old saves that dont have these new variables to new builds that have them, pretty much I want to add support for old saves in new versions of the game.
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Keep the Dialogue Manager's Persistent Data Settings > Initialize New Variables checkbox ticked. When you load a game that was saved before new variables were added, the variables will be initialized to their initial values, and SimStatus will be set up for any new dialogue entries if you've enabled SimStatus. New quests will be initialized to "unassigned". (In the next update, quests will be initialized to their starting values in the database.)
     
  37. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    414
    Okay, I will wait for that new version of quest machine.

    My last question is when using this line to save the dialogues, quests and relationships

    string s = SaveSystem.Serialize(SaveSystem.RecordSavedGameData());

    should I use a different key in easy save for each scene to make sure it wont override the settings from another scene? Or it will save everything for every scene and is safe to keep it under one key?
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Sorry, I thought you were talking about Dialogue System quests. Quest Machine quests are already fine.

    You can use the same key. It will save everything for every scene unless you have UNticked a saver's 'Save Across Scene Changes' checkbox.
     
  39. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    414
    Ah, I have unchecked that because I thought it would save to disk, since I want to handle that myself with easy save, so if its ON it wont save to disk just keep the data ready for me to save it right?
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    That's correct. Keep them ticked. Otherwise when you change scenes it will drop the data for any savers in the old scene whose checkboxes are unticked.
     
    skinwalker likes this.
  41. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    200
    @TonyLi

    I have used your awesome Menu System to create my main menu! Thank you so much.

    I am trying to show the Loading Screen. How ever I am not able to find the options described in your documentation. Did I miss something?

    SaveHelper.PNG
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    @SamRock - That section of the manual is a little outdated. It's automatic now. Just assign your loading scene to the Dialogue Manager's Standard Scene Transition Manager > Loading Scene Name. You may want to turn off the Leave Scene Transition animation if it's the default (fade to black) or change it to fade back in so you can see the loading screen.
     
    SamRock likes this.
  43. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    200
    Thank you! That fixed it :)
     
    TonyLi likes this.
  44. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    40
    Dialogue System Events not getting raise.
    I attatched dialogue system events script to an empty game object and linked a method at OnConversationStart() and started conversation but my method is not calling. what i did wrong?
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Hi @goutham12 - Make sure the Dialogue System Events component is on a GameObject that will receive the conversation's OnConversationStart() and OnConversationEnd() events -- that is, the Dialogue Manager GameObject or one of the two primary participants (or their children). This table lists which GameObject receives each event.
     
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Updated Integrations: Adventure Creator, Corgi, Inventory Engine, uMMORPG, uSurvival, uRPG

    Some third party supported assets have recently had updates with API changes. You can download updated integration package from the Dialogue System Extras page for: Adventure Creator, Corgi Platformer Engine, Inventory Engine, uMMORPG, uRPG, and uSurvival.
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Last Epoch at PAX South

    At PAX South right now? Visit the team behind Last Epoch, the highly anticipated ARPG using the Dialogue System for Unity, at booth 17043.

     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    articy:draft & Aurora Toolset (Neverwinter Nights) Importers Updated

    The Dialogue System Extras page has updates for the articy:draft and Aurora Toolset importers. The articy:draft importer patch saves and observes the Use Default Actors If None checkbox. The Aurora importer patch updates the importer window for .NET4.x compatibility.
     
  49. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    40
    Thank you very much... but got one more how can i play sfx on continue button click.
     
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,554
    Hi @goutham12 -
    1. Add an Audio Source to the dialogue UI GameObject (not the button).
    2. Untick Play On Awake.
    3. Configure the OnClick() event to call the Audio Source's PlayOneShot method, and assign an audio clip. Configure this as the first element in the OnClick() list.
      OR: Add an Event Trigger component. Click Add New Event Type, and select Submit. Do it again and select PointerClick. Configure both to call the Audio Source's PlayOneShot, and assign an audio clip.
    You can use this technique for any UI button, not just the Dialogue System.
     
unityunity