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

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    That's actually what I'm already doing, I was just wondering if there was a way to combine it into one trigger, but if not it's no big deal.
    Thanks
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    No, you're doing it perfectly. Different conditions go to different actions, so they use different triggers.
     
    Deckard_89 likes this.
  3. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    @TonyLi As you can see I slowly starting to customize the Quest Log Windows! Its not the best yet . will get there :)
    I tried following your advice , however I am not able to make the Tabs work. I have three categories - Main Mission/Side Quest/Completed. I have used the default button for "Main Mission" and "Completed" on your QuestLog template. How do I make the "Side Quest" button work? I know you asked me to create a subclass for ShowQuest. How do I tell ShowQuest to show only the "Side Quest" group?
    In my screenshot : "Talk to the Colonel" is the main mission. And "Missing Son" is a side quest. Right now both appear under main quest
    I really need some more help here, may be a code snippet
    Screenshot.PNG
     
    Last edited: Aug 17, 2019
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Hi @SamRock - Looks good so far! Here's an example:

    TabbedQuestLogWindowExample_2019-08-17.unitypackage

    It looks like this:

    upload_2019-8-17_9-5-33.png

    It uses a small subclass. The Main Mission button only shows active quests whose Group is "Main". The Side Quests button only shows active quests whose Group is "Side".

    Tip: To replace a script with a subclass in the Inspector and keep all of its assigned values, temporarily set the Inspector to Debug mode:

    upload_2019-8-17_9-9-54.png

    Then drag the subclass into the Script field, or select it by clicking the target on the right side of the field.

    upload_2019-8-17_9-12-13.png
     
    Last edited: Aug 17, 2019
    SamRock and Razmot like this.
  5. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    @TonyLi Thank you so much! I can't express how awesome your support is . I will use this when I am back from work tonight and share my progress.
     
    TonyLi likes this.
  6. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    872
    upload_2019-8-20_6-48-50.png
    upload_2019-8-20_6-50-29.png

    When i change my build to android, for some reason the UI doesn't work and the timeline script stops working.

    It's definitely progressing dialogue and going through the motions, it detects which character should be speaking but the actual dialogue does not display.

    It shows fine in the console too.

    EDIT: Switching back to PC build target the issues persists but the timeline error goes away?

    I've tried reimporting the plugin folder and reloading unity...

    I know i encountered this before when i tried switching to android but i forget how i fixed it... -_-
    upload_2019-8-20_7-34-42.png
     
    Last edited: Aug 20, 2019
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Hi @sacb0y - After switching to Android, enable the Dialogue System's integration for Timeline. Select Tools > Pixel Crushers > Dialogue System > Welcome Window, and tick the Timeline checkbox.

    In version 2.2.0, when you tick one of the integration checkboxes, it will attempt to set it for all of the common build targets, including Android. Currently it only sets it for the current build target.

    Is your UI linked to Timeline? For example, does it rely on the Dialogue System Timeline integration to appear?

    Is the screenshot above while you're playing the conversation in play mode? As a test, what if you use the Basic Standard Dialogue UI prefab? Does the conversation appear in the UI then?
     
  8. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    872
    I just now changed build targets again before reading this so i'll i'll let you know later today lol.

    And alright fair enough about the timeline thing! Thanks for letting me know!

    I'll try other templates.

    EDIT: And yeah both screens are in play mode.
     
  9. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    872
    OH MY GOD I DIDN'T KNOW THIS WAS HERE! AWESOME!!!!

    upload_2019-8-21_0-36-17.png
     
  10. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    872
    Ok so it seems my dialogue UI prefab is broken? how did that happen?

    I tried the other default templates and they worked fine :/

    here's the prefab.

    EDIT: No wait, so i think i see what happened, thanks to text mesh pro not being enabled on android it disconnected the portrait and dialogue text from their scripts.
     

    Attached Files:

  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    @sacb0y - Just checking -- is the issue resolved now? (After reconnecting the TMP text elements.)
     
    SamRock likes this.
  12. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Hello. I have 2 questions.

    1. How do I make no images of characters appear when actors are set on "none" (for authors words) of dialogue entry.
    2. For some reason my dialogue hides player character and skips some of the dialogue entries. How do I fix it?

    Here's the video https://gyazo.com/a1831418899c51cc0ac4ff5ce4f41d06
     
    Last edited: Aug 21, 2019
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Hi @Stickeyd - Please make sure you're using version 2.1.8 or higher and that no portrait image is assigned to that actor. In version 2.1.8+, if no portrait image is assigned then the portrait image UI element will be deactivated.

    Inspect the Dialogue Manager. Tick Display Settings > Subtitle Settings > Show PC Subtitles During Line. You may also want to untick Skip PC Subtitle After Response Menu.

    If a specific dialogue entry doesn't appear, check its Sequence field. If the Sequence runs immediately -- such as Audio(foo) for example -- the subtitle text won't appear. To resolve this, you can use a Sequence that runs for a duration, such as AudioWait(foo) or Audio(foo); {{default}}.
     
  14. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Set the panels' Visibility dropdown to Always From Start or Always Once Shown. See the Focus Template Standard Dialogue UI prefab for an example. (You can temporarily assign this prefab to the Dialogue Manager's Dialogue UI field to see how it looks.)
     
  16. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    It's still the same. It seems that subtitle panels are just deactivated each entry.
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Hi @Stickeyd - Are you talking about the Visibility dropdown or the Focus UI? If a panel's Visibility is set to Always From Start or Always Once Shown, it will not be deactivated until the conversation ends.
     
  18. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    I'm talking about visibility dropdown on subtitle panels. I don't have visibility dropdown on the UI istelf. It is set to Always From Start so I don't get it. I tried your prefab and they deactivate there as well
     
  19. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    872
    yes it is!
     
    TonyLi likes this.
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    In your screen capture, the Portrait Name for both characters is "Player". Is this intentional?

    Are you using [panel=#] tags or SetPanel() sequencer commands to change which panel the Player actor(s) use?

    If it's the same actor, the Dialogue System will ensure that it only appears in one panel at a time, and it will hide the other panel. If they're different actors,

    Have you tried the Focus UI? It will tell us if the issue is with your UI or with the conversation.
     
  21. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    I tried Focus UI and problem is still there. No, it's not intentional. I don't know why it is so though because in database they are different characters https://gyazo.com/ff69fb36b9357fd2fffba9dcbedbbed5

    I don't use any sequences
     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    I have attached an example scene to this reply. (DS_FocusExample_2019-08-22.unitypackage)

    If it works correctly in your project, can you check for differences between the example and your UI?

    I noticed that this is happening in your screen capture:

    upload_2019-8-22_9-38-48.png

    If the player is on the left, then the first node shows the player unfocused. This is correct if the NPC is speaking. But I don't know why the NPC is not visible on the right.

    Is it possible that the Dialogue Manager is using the wrong version of your UI? Maybe it's instantiating the UI from a prefab instead of using the version that is in the scene. Check the Dialogue Manager's Dialogue UI field.
     

    Attached Files:

  23. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    How do I use barks from Adventure Creator. I have a conversation with over 7 lines using 2 NPC's. I use dialog actor on the npc's and when the conversation play,s it only shows the first line and that's it.
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Hi @namdo - Barks are always only one line.

    If you need to show more than one line, please use a conversation. You can assign a bubble style subtitle panel to the NPC if you want it to look like a series of barks.
     
  25. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    So can i se the bubble ui for normal conversation then? I need text to appear over the character speaking.

    also how can I add a delay before each line
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Yes. Example: Set the Dialogue Actor's Subtitle Panel Number dropdown to Custom. Then assign the Bubble Template Standard UI Subtitle Panel.

    Please see here.
     
  27. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Okay I fixed almost all of my problems. The only one left is that the first dialogue entry is supposed to be without characters showing. Authors words. But my player shows because its visibility is always visibile after start. https://gyazo.com/0a11619a7d842d7bf907bcf891951775

    And if I set to always visible after show, it shows my player way to late, because my player talks after NPC
     
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Hi @Stickeyd - The easiest solution is to:
    1. Set the panels' Visibility to Always Once Shown.
    2. Add a blank dialogue entry for the player.
    Also, assign an actor to the first dialogue entry. It doesn't have to be associated with a GameObject. In the screenshot below, I assigned an actor named "Author":

    upload_2019-8-23_9-20-11.png

    Notice that the node has the actor's name in front ("Author:"). This is because it different from the conversation's primary Actor & Conversant.

    This is how I added a blank dialogue entry:

    upload_2019-8-23_9-21-52.png

    The Dialogue Text is [auto], which makes it plays automatically instead of appearing in a response menu.

    The Sequence is Continue(), which makes it continue immediately to the next dialogue entry.
     
  29. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
  31. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Thanks, it's working. But I don't want focus on my player at first. And as I see because of this auto entry it focuses on character first, it's noticable https://gyazo.com/9efb22ba7b93610a6cb96e620bf0b577
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Hi,
    Adjust your animator controller. I think this animator controller works the way you describe. Assign it to the NPC and PC subtitle panels' Animator components.
     

    Attached Files:

  33. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Thank you so very much for this code! This worked like charm. I went ahead and enhanced it further. The Tabs are working perfectly now! :)
    I swear I would have never figured it out by myself! Is the code Class/Code document available somewhere?
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Glad to help!

    The API reference is part of the Dialogue System Manual. You can search for any class documentation using the search bar in the upper right. Here's a link to the QuestLogWindow API. You may also be interested in the Dialogue System's Scripting chapter.
     
  35. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    @TonyLi I am now working on the Radio UI. I followed your instructions. Below are the screenshots from my project. I am sorry I couldn't figure out how to call the Radio UI instead of the regular Letterbox UI. I read this on your API manual:

    Overrides the dialogue UI for conversations involving the game object.

    To use this component, add it to a game object. When the game object is a conversant, the conversation will use the dialogue UI on this component instead of the UI on the [URL='https://www.pixelcrushers.com/dialogue_system/manual2x/html/class_pixel_crushers_1_1_dialogue_system_1_1_dialogue_manager.html']DialogueManager[/URL].


    Is the Actor component mandatory? When I trigger a Conversation , can I select the UI to be shown? And will the Conversant be take from the Conversation instead of being manually assigned here?

    Radio.PNG Radio2.PNG Radio3.PNG
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Hi @SamRock - What GameObject represents the character who is speaking over the radio? I'll refer to that GameObject as "RadioCharacter".

    Set up your Dialogue System Trigger for the radio conversation(s) so RadioCharacter is the Conversation Conversant. You can do this by assigning RadioCharacter to the Dialogue System Trigger's Start Conversation > Conversation Conversant field, or by leaving the field unassigned and putting the Dialogue System Trigger on RadioCharacter.

    Then add an Override Dialogue UI component on RadioCharacter, and assign a GameObject that has a Standard Dialogue UI component. Don't assign a child such as Dialogue Panel. Assign the GameObject or prefab that has the StandardDialogueUI script.
     
    SamRock likes this.
  37. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    I fixed everything! Thanks. Now I'm wondering how do I preserve aspect for character images?
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Hi @Stickeyd - The most common solution is to use a consistent size for all of your character portraits. However, if you want to use different sized portraits, you can add this script to the dialogue UI.
     
  39. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    I tried to put it on different objects and it doesn't do anything. It seems that OnConversationStart and OnConversationLine events don't happen
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    If your dialogue UI is not a child of the Dialogue Manager or one of the conversation's primary participants, it will not receive the messages.

    More info:
    If you can't adjust the the primary participants or move the dialogue UI to the Dialogue Manager, then add a Dialogue System Events component to the Dialogue Manager, and configure its OnConversationStart() and OnConversationLine() events to call the script.

    If the script is in a different scene from the Dialogue Manager, you can modify the script. In OnEnable(), get the Dialogue Manager's DialogueSystemEvents component and add listeners for OnConversationStart() and OnConversationLine(). In OnDisable(), remove the listeners. Example:
    Code (csharp):
    1. void OnEnable()
    2. {
    3.     var dialogueSystemEvents = DialogueManager.instance.GetComponent<DialogueSystemEvents>();
    4.     dialogueSystemEvents.conversationEvents.onConversationStart.AddListener(OnConversationStart);
    5.     dialogueSystemEvents.conversationEvents.onConversationStart.AddListener(OnConversationLine);
    6. }
    7.  
    8. void OnDisable()
    9. {
    10.     var dialogueSystemEvents = DialogueManager.instance.GetComponent<DialogueSystemEvents>();
    11.     dialogueSystemEvents.conversationEvents.onConversationStart.RemoveListener(OnConversationStart);
    12.     dialogueSystemEvents.conversationEvents.onConversationStart.RemoveListener(OnConversationLine);
    13. }
     
  41. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174

    Okay, I made dialogue manager parent. But now OnConversationStart doesn't happen so UI is null
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Hi - Move the script to the Dialogue Manager GameObject. Actually I hadn't looked at the script in a while. The dialogue UI doesn't need to be a child of the Dialogue Manager after all. Sorry about the incorrect info. But if you move the script to the Dialogue Manager it should work.
     
  43. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    As always thanks a lot! Really really appreciate your support. I am working on this... will keep you posted! :)
    I am definitely supporting you by buying your other Assets. The amount of thought gone into each functionality is mind blowing
     
    TonyLi and hopeful like this.
  44. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Thanks! I fixed it. But now one more problem, for some reason it unfocuses of NPC words even though he haven't finished yet https://gyazo.com/ef287a3d9175a0341a346b836025befa
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    On your subtitle panels, what is the Visibility dropdown set to? Have you tried Always Once Shown or Always From Start?

    At runtime, open the Animator window. Inspect the subtitle panel. Do you see any pattern when the focus changes?

    The next update is pending on the Asset Store. It has improvements to the subtitle panel scripts, mostly related to focusing them and adding an option to delay typing until the panel is fully open. I will PM you an advance copy of the scripts, although I hope that it will also be available on the Asset Store in the next few days.
     
  46. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Your game looks beautiful! What is it called? Would love to follow it's updates
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Updated Corgi Support Package Available

    The Dialogue System Extras page has an updated integration package for Corgi Platformer Engine 6.0.
     
    SamRock likes this.
  48. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    It works better with your new scripts. But now at the first entry when characters appear they are both focused. After the first entry it works fine but I need to work it good always https://gyazo.com/35de49b42e40d131cb1f3559e8326279

    Thanks! I PMed you with the name and some details
     
    SamRock likes this.
  49. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Thanks! Followed :)
     
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,688
    Try setting it up like the Focus Standard Dialogue UI prefab in the package I sent you:
    • Both panels configured as unfocused at design time (e.g., Canvas Group > Alpha: 0.5)
    • Both panels' OnOpen() event sets the panel to unfocused (e.g., Canvas Group > Alpha: 0.5)
    • Both panels' Has Focus checkbox unticked at design time.