Search Unity

  1. 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. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Hi @dinaloraven234 - Inspect a conversation. Click on empty canvas space to inspect the conversation's properties. Then use the Conversant dropdown to select the correct NPC:

    convSetParticipant2.png

    That should take care of it. Here's some extra info that may be useful in the future: You can also assign a different actor in the scene by adding a Dialogue Actor component to a GameObject. Then assign that GameObject as the Dialogue System Trigger's Conversant.
     
  2. anilo

    anilo

    Joined:
    Feb 7, 2013
    Posts:
    31
    Can you share some mobile screenshots and if you have any tips on how to make it work correctly for various screen sizes I would greatly appreciate it?
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Hi @anilo - Mobile is like any other environment; you just need to be judicious about limited screen space. But you can have traditional gamey UIs like Terra Monsters:



    or Father and Son:



    Or more of a full screen text experience like When Silence Fell:



    As for adjusting orientation and resolution, the best guide is Unity's Designing UI For Multiple Resolutions guide. The Dialogue System's Standard Dialogue UI is just regular Unity UI (with optional, native TextMesh Pro integration), so treat it like any other Unity UI.
     
  4. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi does the latest version supports emerald ai 2.2.0? Emerald ai have rewritten their code and I want to know if the latest version supports integration of emerald ai
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Soon! :) I've been working on the updated integration. It will be in the next Dialogue System update and should be on the Extras page in a couple days.
     
  6. HamFar

    HamFar

    Joined:
    Nov 16, 2014
    Posts:
    89
    What is the cleanest way to remove this asset from a Unity project without leaving any bits behind?
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Delete these files and folders:

    upload_2019-3-8_7-22-18.png

    If there is nothing left in the parent folders Editor Default Resources, Gizmos, or Plugins, you can delete them, too.
     
    HamFar likes this.
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Mage VR: The Lost Memories

    Check out Mage VR: The Lost Memories, an indie VR action game just released for Vive and Rift that uses the Dialogue System:



    If you're not in VR, I recently learned about a quirky little adventure called Bottleworks that's reminiscent of Night in the Woods:

    bottleworks.png

    I for one hope they have a chance to expand it into a full length game.

    And of course The Last Epoch (which uses the Dialogue System for dialogue and quests) is looking fantastic with its UI enhancements in version 0.6:



    If you're into Diablo or Path of Exile, you'll want to check out what reviewers are calling the next great ARPG.
     
  9. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi does dialogue system supports reward system for invector like in quest machine?
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Hi @dinaloraven234 - Yes, but you specify them manually, for example using vAddItemByID in a dialogue entry's Script field:

    upload_2019-3-8_8-5-36.png

    (Invector identifies items by ID number, which is why it uses "3" instead of "Sword".)
     
  11. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    What does 1 mean in the line {3,1,true} no of item to be given?
     
  12. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    And also I'm currently using 2.0.6 in my project if I'll update it to the latest version will it affect my dialogue database? Like get replaced or start again?
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    That's the number of swords to give the player. The description of what everything means is here.

    No problem at all. Everything should be perfectly intact. (That said, before you import any package of anything -- not specifically the Dialogue System -- it's always a good idea to make a backup to be on the safe side.)
     
  14. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Thanks for your immediate response. One last thing I have a collection quest and does dialogue system will detect if I got the item(I'm using the invector pick up system) and it is in the invector inventory?
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    In the upcoming update. The Invector API doesn't expose that, but I implemented around it to make it work.
     
  16. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    But is it possible to make a collection quest or other quest that will be compatible for invector ?
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Yes. I'll try to include an example in the updated Invector integration package.
     
  18. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Thanks man I hope you include an integration for invector 1.2.3 as this was the version of invector I'm using. I don't wanna update to 1.3 as my project is 70% done and updating invector might cause some issues because invector made changes in some part of their code
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    The example scene won't work for 1.2 because it's built for 1.3, but the integration scripts and documentation should. If you need to see the example, you can create a new, temporary project containing 1.3 and play with the example there.
     
  20. anilo

    anilo

    Joined:
    Feb 7, 2013
    Posts:
    31
    For Mobile I followed the steps in the Quick Start guide, and got this.
    Notice the text is hidden behind the iPhone X Notch area.
    How can I move the text for NPC lower for iPhone X+ (notch devices) only.

    https://ibb.co/879spcv

    I know I have to put in some code for the Safe Area to account for the Notch.
    Maybe this article will do it.
    https://connect.unity.com/p/updating-your-gui-for-the-iphone-x-and-other-notched-devices

    But where do I need to put this code?
    OR
    Do others have used some other code?
     
    Last edited: Mar 8, 2019
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Hi @anilo - The Dialogue System uses standard Unity UI, so that script will work fine. Just add it to the dialogue UI's Dialogue Panel.

    The Quick Start tutorial uses the default Dialogue Manager prefab. Its Dialogue UI field points to a prefab named Basic Standard Dialogue UI. To move on from there, use these steps (or something similar if you prefer):
    1. Add an instance of the Basic Standard Dialogue UI prefab to the Dialogue Manager's Canvas.
    2. Assign this instance to the Dialogue Manager's Dialogue UI field. This tells the Dialogue Manager to use the instance instead of instantiating a new instance from the prefab.
    3. Expand the instance until you see Dialogue Panel. Add the script to Dialogue Panel.
     
  22. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi is it possible dialogue system can be integrated with evilas RPG pack? I'm using the RPG pack for the shop system
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Hi @dinaloraven234 - The Dialogue System provides several scripting hooks and features such as custom Lua functions and custom sequencer commands to integrate with other assets. A built-in integration for that asset isn't planned, but if you have general questions about integrating it yourself, just let me know.
     
  24. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    I just
    I just want to know how can I access the shop menu of evils RPG pack while in a dialogue. For example: NPC: good day sir want to see my goods?, Player: yes, I'd like to see it. Then the shop menu screen appears. I think the shop menu is similar to that of the inventory menu but with some modifications
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    It looks like you just need to call the vItemSeller's DoAction() method. You can use the Dialogue System's SendMessage sequencer command. Example:
    • Dialogue Text: "Yes, I'd like to see your goods."
    • Sequence: SendMessage(DoAction,,listener)
    I'm using Invector 1.3.0, so I can't test this, but that's the principle.
     
    Last edited: Mar 9, 2019
  26. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Thanks Ill try it tomorrow
     
  27. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hey I'm sorry for asking many questions but in the SendMessage method what function will I call the vItemSeller? Like this : SendMessage(vItemSeller,listener) I'm not good at coding and I'm in a rush to finish my project and I'm sorry for asking many questions but I'm grateful for your patience in answering my questions

    Also I think evilas RPG pack is compatible with 1.3 but you will need to change a line in the script but will cause some minor bugs
     
    Last edited: Mar 10, 2019
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Hi - I'm here to help, so ask any questions that come up. If you're editing a dialogue entry node that's spoken by the player, then the special keyword speaker refers to the player, and the special keyword listener refers to the NPC.

    The SendMessage() sequencer command takes exactly three parameters in this order:

    SendMessage ( function, argument, GameObject )​

    where:
    • function is the function name -- in this case, DoAction
    • argument is an argument to pass to the function. DoAction doesn't take any arguments, so leave this blank
    • GameObject is the name of a GameObject in the scene or the special keyword speaker or listener
    So if the dialogue entry node is spoken by the player, then set the node's Sequence field to exactly:

    SendMessage(DoAction,,listener)

    Note the two commas between DoAction and listener. This is because the second parameter is blank.
     
  29. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi I've tried the SendMessage function but the shop menu doesn't pop up. Here's a screenshot at my conversation tab
     

    Attached Files:

  30. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi I have encountered an error regarding the rewards using the vAddItemByID. When I use the 2.0.6 version the vAddItemByID(2,5,true) works perfectly fine and I receive my items in the inventory but when I updated it to 2.1.2 I get an error

    "Dialogue System: Lua code 'vAddItemByID(2,5,true)' threw an exception 'Tried to invoke a function call on a non-function value. If you're calling a function, is it registered with Lua?"
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    I'll see if I can get EviLa's RPG pack to work with Invector 1.3.0 to test this.

    BTW, you can press PrintScreen to take a screenshot and copy it to your clipboard. Then you can press Ctrl+V to paste the screenshot from the clipboard into a reply here on the forum.

    Make sure you've added the scripting define symbol as described here and that your Invector player still has a Dialogue System Invector Bridge component.
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    When using the SendMessage() sequencer command, you must specify the GameObject that has the vItemSeller component.

    Looking at the demo scene, the vItemSeller component isn't on the main VBOT2.0_Seller GameObject. It's on a child GameObject that's also named VBOT2.0_Seller. To get this working in my test, I used these steps:
    1. Renamed the child VBOT2.0_Seller to VBOT2.0_Seller_X
    2. Set the dialogue entry node's Sequence field to: SendMessage(DoAction,,VBOT2.0_Seller_X)
    In your scene, make sure you specify the GameObject with the vItemSeller component. To do this, you can do one of these:
    • Put the vItemSeller on the Female Vendor GameObject (not a child GameObject).
    • Or give the child GameObject a unique name, and use that name instead of listener.
     
  33. jrackley

    jrackley

    Joined:
    Jan 26, 2017
    Posts:
    55
    @TonyLi I am having an issue when changing scenes with Invector and Dialogue System. It seems that if I untick the Use Instance bool on the vThirdPersonController like instructed in the docs, then when I load to a new scene the vAddItemByID will not work anymore and I receive the following error.....

    Dialogue System: Lua code 'SetQuestState("Shrines of the Godess", "active");vAddItemByID(19,3,true);' threw exception 'Exception has been thrown by the target of an invocation.'
    UnityEngine.Debug:LogError(Object)

    The quest Activates as it should, but I get the error from it trying to add the items to the inventory. If I do check "Use Instance" bool then it seems to work as it should, but this causes other issues.

    DialogueSytemConversation.PNG

    I have all the things set up correctly, as I stated it works when I am using instanced character. Also I have tried this with both ScenePortal and vLoadLevel scipts as well as a custom one, all with the same results. Anyhow thank you for your time and hopefully you can inform me on what I may be overseeing with this.
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Hi @jrackley - Sorry, that was an oversight. It's fixed in the next release. You can download the package from the Extras page right now. (Expand "Updated support packages for 2.1.2" to see the download button.)
     
    jrackley likes this.
  35. jrackley

    jrackley

    Joined:
    Jan 26, 2017
    Posts:
    55
    Thank you very much I will check it out. (EDIT) Tested and working great! Thanks again!
     
    Last edited: Mar 11, 2019
  36. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @jrackley are you making an RPG game using invector and dialogue system? Does your game have a quest journal like in quest machine? If you have can you help me how to do it? I am also creating an RPG game for my thesis
     
  37. jrackley

    jrackley

    Joined:
    Jan 26, 2017
    Posts:
    55
    This particular game is not a full blown RPG, more of an Action Adventure with a lot of RPG elements. As for the quest journal, I am not familiar with quest machine as I do not use that one, but I do use the quest journal that is built into Dialogue System for tracking the quests and or states. I also have a custom objectives system that I have built as well.
    I am very familiar with Invector As I have used the controller for many years now, basically since it came out. If you have any specific areas that I may be able to help, I will gladly give you some input if I can.
     
    TonyLi likes this.
  38. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    I mean is the quest journal like in quest machine where you can view your finished quest and can be accessed with a specific button like 'j' to bring it up
     
  39. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi does dialogue system also have a quests journal entry like in quest machine where you can view your quest?

    By the way the SendMessage function you taught me for the shop system works well thanks man!
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Yes. To see an example, play the Dialogue System's Demo, pick up a quest by talking to Private Hart, and then press Escape to open the menu where you can choose the quest journal.

    To assign a hotkey, add a Quest Log Window Hotkey component to the Dialogue Manager. By default, it's mapped to 'J'.

    Glad to help!
     
  41. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Thanks for your immediate response. Youre the best when it comes to customer support. One question though how do I enable the overhead indicator like in quest machine. I've red the feature comparison list with quest machine and they both have overhead indicators to know NPCs that have quests. I've checked the demo and there's no overhead indicators on the NPCs
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Add a Quest State Indicator component and Quest State Listener component to the NPC. To see it in action, play the Dialogue System's demo. In DemoScene2 (the second room), Sergeant Graves has these components. When he has a quest to offer, a question mark appears above his head. When you can turn in a quest to him, an exclamation mark appears.

    To set it up:

    1. Add a Quest State Indicator to the NPC. Assign one or more icon GameObjects, typically children of the NPC. Leave the first element blank. This indicates the state where the NPC isn't showing any icons. Make a note of their element numbers. On Sergeant Graves, the icons are organized under a GameObject named Quest Indicator Canvas. The element numbers are:
    • Element 0: none
    • Element 1: Question Mark
    • Element 2: Exclamation Mark

    2. For each quest that the NPC offers, add a Quest State Listener.
    • Select the quest from the dropdown.
    • Add one or more elements to the Quest State Indicator Levels list. In each one, specify a quest state and the indicator element number that it should show when the quest is in that state. For example, in the screenshot below, when "Enemy Attack" is unassigned, it will show element 1 (question mark):
    image.png


    This component also has OnEnterState() UnityEvents, but I omitted them from the screenshot above for clarity.
     
  43. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi in the quest state listener is it possible to add more quest? Like for example after I finished my quest in that specific NPC the next quest in queue will be active.
     
  44. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Sure! Add one Quest State Listener for each quest.
     
  45. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi thanks for your immediate response. But I have encountered a slight issue before the vAddItemById works perfectly fine and I receive rewards after I finished the quest but now I don't receive the rewards anymore after I finished the quest. I tried recreating the whole player setup and the same thing happened. Tried switching the item list data and its the same I don't receive the rewards anymore. I think it started when I applied a patch file the "DS Invector Support" but that's just a speculation.
     
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Hi @dinaloraven234 - Did you add the Dialogue System Invector Bridge script to your player in every scene?

    As a test, open the Dialogue Editor window during play. Go to the Watches tab. Paste this into the text field at the bottom of the window:

    vAddItemByID(3, 1, true)​

    Then click the Run button. Your player should get a sword. (This assumes that item ID 3 is still the sword in your project.) If it works, then check your script and quest setup. If it doesn't work, check for any messages in the Console window.
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Good Localization Article On Gamasutra

    Benjamin Glover recently published a useful article on Gamasutra: Thirteen tips for your next localization. If you're considering localization, it's worth reading. Among the many good tips:
    • Make sure your fonts can display all the characters in your target languages.
    • Make sure your UI elements are large enough to fit languages like German whose words tend to be longer.
    • Keep the format simple for translators. (For example, the Dialogue System can export/import simple CSV spreadsheets for each language.)
    You can read more about localization in the Dialogue System here: Localization and the Localization Tutorial. If you prefer to use i2 Localization, the Dialogue System also has i2 Localization Support.
     
  48. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi I know now what's causing the problem probable when I applied the patch file the use_invector_inventory got removed in the scripting define symbols. Thanks for the help man
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Glad you got it working again!
     
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,723
    Here are two options to show a message to the player during gameplay:

    1. If you want to show the message as soon as the player receives the item:
    • Tick the Dialogue Manager's Display Settings > Alert Settings > Allow Alerts During Conversations.
    • In the dialogue entry node's Script field, use the "..." dropdown to select Alert > "(your message)":
      upload_2019-3-13_9-55-26.png

    2. If you want to wait until the end of the conversation to show the message:
    • Set the Alert variable using the "..." dropdown:
      upload_2019-3-13_9-58-6.png
      At the end of the conversation, the Dialogue System will check the value of this variable. If it has any text, it will show that text as an alert message.
     
unityunity