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

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    hi there,
    am trying to play voice over when dialogue appears. i made it and it's working fine. am facing small problem there.
    Actually am doing a conversation where dialogue will change when we click continue button. when the conversation ends the dialogue is disabling but still am hearing voice over of the last dialogue.
    how can i stop playing voice over after conversation end.
     
  2. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    Hi there,
    I got a problem on Portrait Image of player. In my scenario player portrait image is not single image.
    Player has a menu where he can choose his hair shirt and skin color. so i need three images to portrait for the player.
    is there a way to do it. please do help me out in this.
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Use the AudioWait() sequencer command, not Audio(). The AudioWait() sequencer command will stop the audio if you continue before it's finished playing. The Audio() command starts the audio and then forgets about it, so it doesn't stop it if you continue early.

    Here are some options:
    • Use an animated portrait (see the Dialogue UI video tutorial) and set parameters based on the player's choices.
    • Or make a subclass of StandardUISubtitlePanel and override the SetContent() method to handle your special player portrait.
    • Or make each possible combination a separate image. Assign them all to the player actor's Portrait Sprites list. Then use the SetPortrait() sequencer command to set the portrait number to the combination that the player has chosen.
     
  4. Venominus

    Venominus

    Joined:
    Sep 5, 2015
    Posts:
    25
    Is it possible that choices wouldn't be on ui canvas, but in game world floating around head of NPC?
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @Venominus - Sure. Technically they'll be on a world space UI canvas. The Dialogue System Extras page has an example called Bubble Subtitle Example that has subtitle and menu choices in bubbles over the characters' heads.

    (The entire UI system is modular, so if you don't want to use world space canvases for some reason, you can supply your own UI code and the rest of the Dialogue System will work happily with it.)
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Disco Elysium Wins Twice at New York Videogame Awards

    Congratulations to Studio ZA/UM for winning the Herman Melville Award for Best Writing and Off Broadway Award for Best Indie at the New York Videogame Awards for Disco Elysium, made with the Dialogue System for Unity!

     
    hopeful likes this.
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Jenny LeClue - Detectivu Available on Steam, GOG, and Apple Arcade

    Next time you're in an Apple Store, check out the promos for Mografi's Jenny LeClue - Detectivu, made with the Dialogue System for Unity:



     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Wishlist Lake on Steam

    Gamious's pretty, chill new game, Lake, being made with the Dialogue System for Unity, is available to wishlist on Steam.

     
  9. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    Thanks for that,
    *Added an object that has hair, shirt and skin images as child.
    *Added a script to the statndard UI element.
    *Created a delegate in the script StandardUISubTitlePanel.cs. and "setcontent" method am invoke the event by passing
    speaker name as parameter.
    *Comparing the name in my script.
    is it fine that what am doing?

    and also could you please tell me
    how can show question and answer in same dialogue. like
    What color do you like?
    [options]
    Black
    Green
    Red
    White
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @goutham12 - Yes, that sounds fine.

    Make sure the subtitle panel's Visibility dropdown is not set to Only During Content. Any other setting is fine.

    Then set the question's Sequence to: Continue()

    This will make it show the question and immediately show the answers in the player response menu.
     
  11. Venominus

    Venominus

    Joined:
    Sep 5, 2015
    Posts:
    25
    I have buttons in game world that are clickable. If mouse lockstate is none so it is visible and can move I can click on buttons. When I use mouse lockstate locked when it is in center, not visible I can't click anything. How to fix this?
     
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @Venominus - Sorry, I don't understand. Is this related to the Dialogue System? If you don't want the Dialogue System to touch the mouse cursor state, inspect the Dialogue Manager's Input Device Manager component and untick Control Cursor State.
     
  13. lcizzle

    lcizzle

    Joined:
    Jun 13, 2016
    Posts:
    18
    Loaded question here but what is the minimal import. I will be using Ink so lots of stuff I won't need but I don't want to break the Dialog System by excluding needed items.
     
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @lcizzle - You can omit these folders:
    • Plugins / Pixel Crushers / Common / Third Party Support
    • Plugins / Pixel Crushers / Common / Templates
    • Plugins / Pixel Crushers / Dialogue System / Demo
    Make sure you have imported any third party support packages that you need first, such as the Ink integration.

    You can optionally remove these:
    • Plugins / Pixel Crushers / Common / Templates
    • Plugins / Pixel Crushers / Dialogue System / Templates
    You may want to keep the Templates folders if you expect to use them. They're tiny, and the template scripts
    are commented out so they won't have any impact compile times or build sizes.
    • All folders in Plugins / Pixel Crushers / Dialogue System / Prefabs
      Keep the Dialogue Manager prefab which is located in the Prefabs folder. You may also want to keep the Basic Standard Dialogue UI prefab locaited in the Standard UI Prefabs/Templates/Basic folder to use as a reference when designing your own dialogue UI.
    If you want to go ultra minimal, you can really just remove everything except the Scripts and Wrappers folders. But it's helpful to have the Dialogue Manager prefab, for example, as a starting point that you can drop into a scene instead of manually adding its script to an empty GameObject.

    Full details here: FAQ: What files can I move or delete?
     
  15. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    This makes Question Fade off and options are getting into the scene. i mean only options are in the scene. i wan't to show question and answer at a time

    What color do you like?
    RED
    GREEN
    BLUE

    like in the above all as single dialogue.
     
  16. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    Got it ... The response panel is overlapping the subtitle panel. i can handle it.
     
  17. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    Hi sir,
    Am doing question and answer conversation. my conversation is like
    5+1 ?

    there is ans chooses menu over top. until player select correct answer the question should not skip. but currently whenever i press continue button the question gets skipped. if i put condition to the next dialogue(like ans == 6) it causes end of conversation.

    how can stop dialogue until player select correct answer?
     
  18. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    Hi sir,
    I got some wired problem i don't know it is a bug or am doing something wrong.
    Check the below image.
    There is four dialogues are linked with first dialogue with a variable called item as condition.
    Am setting up the item variable after execution of first dialogue.
    Here is the problem,... setting variable value is not updating immediately. i mean if we set the variable value before two dialogues it working fine. but just before it is not working.
    I checked the editor in run time (how the flow is going) i observed that whenever the first dialogue is executed immediately the link to the next dialogue is established this causing the problem.
    Can you tell me how can i over come this problem?
     

    Attached Files:

  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @goutham12 -
    Sorry, I'm having trouble understanding.

    Let's look at this example:

    upload_2020-1-27_9-8-36.png

    The node that asks "What is 5+1?" is gray. This means it's a non-player node. It will appear as a subtitle. The answer nodes (3, 6, 51) are blue. this means they are player nodes. They will appear in a response menu. If the gray node's Sequence is Continue(), it will show the subtitle and immediately show the response menu.


    Now let's say your conversation looks like this:

    upload_2020-1-27_9-12-37.png

    where the "What is 5+1?" node uses the TextInput() sequencer command to wait for the player to type input. (Regarding <Delay Evaluation>, see my answer to your next question below.)

    If you have set the Dialogue Manager's Subtitle Settings to show a continue button, you can temporarily turn it off for that node. Set the Sequence to something like:

    SetContinueMode(false);
    TextInput(Text Field UI, Answer, answer)

    Then in the Correct and Incorrect nodes, turn it back on: SetContinueMode(true)


    Please see: Conversations Evaluate Conditions One Extra Level Ahead
     
  20. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    Thank you very much for you patience sir.
    In above i asked three question in that two are solved.
    I'll try to explain you my last question much clear way.

    *Let's assume i have a question that has 5 options in that one is wrong and the remaining is correct.
    *answer panel is not response panel it's custom panel. it is enable when the question is executed. (that panel has 5 button's where player can choose answer like 6 , 51 , 10(these are buttons)
    *So whenever user clicks on these buttons it should go for the next dialogue.
    *if the answer is wrong continue button should not work.

    Please do check the below image that how my editor is
     

    Attached Files:

  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @goutham12 - Set the question node's Sequence to:
    Code (csharp):
    1. SetContinueMode(false);
    2. SetContinueMode(true)@Message(ClickedButton);
    3. Continue()@Message(ClickedButton)
    The first line hides the continue button. The second and third lines wait until something sends the sequencer message "ClickedButton". Then they re-enable the continue button and immediately continue.

    When the user clicks one of the correct buttons, run this line of C# code:
    Code (csharp):
    1. PixelCrushers.DialogueSystem.Sequencer.Message("ClickedButton");
    This sends the sequencer message that the quest node's Sequence is waiting for.

    Remember to put an empty node between the question and the 5 responses. Set that node's Sequence to: Continue()
     
  22. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    Thank you very much sir,
    It's done.
    How can i enable or instatiate an object when perticular dialogue is exicuted.
    Currently am doing it in way that each dialogue entry contains onExicute event. you defenetly know about game event (scriptable object) . i added game event to the onExicution event and in eventListnerScript am doing my stuff.

    I just want to know is there any other better way to enable or instantialte an object when perticular dialogue is exicuted.
     
  23. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    Hi sir,
    How can i know Particular npc conversation is ended.

    I have 4 npc characters each one has separate conversation. i want to rise an event when the conversation end.
    Note that event should rise by the respective npc.
    i know dialogue system has an event i.e OnConversationEnd(), but this will call on every conversation.
    I need call some method when the npc finishes his conversation.
    in usable script we have the event only for onuse()
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Add a SetActive() sequencer command to the dialogue entry node's Sequence field. A quick way to do this is to hold down the Alt key and drag the GameObject into the Sequence field:

    upload_2020-1-28_8-21-58.png

    You can use the "+" menu to change the sequencer commands that are added when you drag things into the Sequence field:

    upload_2020-1-28_8-23-5.png


    The Dialogue Manager GameObject receives all "On Conversation End" events. An NPC will only receive the "On Conversation End" event if it is involved in the conversation.

    If you add a Dialogue System Events component to the NPC (not the Dialogue Manager), its OnConversationEnd() event will only run when that particular NPC's conversation has ended.

    The same is true for a Dialogue System Trigger component set to OnConversationEnd, or a script with an OnConversationEnd(Transform) method.
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Stars Die on itch.io

    Check out sci-fi mystery adventure Stars Die, a largely one-man project made with the Dialogue System for Unity.

     
  26. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    Tnk you sir
    How can i properly disable interaction of an npc in collision with player.
    my app is for mobile so i have to use a button to interact with npc. So am using OnSelectUsable() and OnDeselectUsable() events from proximity selector to enable and disable button.
    everything is working fine.
    Here npc can speak only once. So i need disable usable component of the conversation. what am doing is, after the conversation ends am calling this line of code usable.enable = false.
    It disables the component but am facing a problem that the interaction button not getting disable ever. even go and talk to the another npc also.
     
  27. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    I added the dialoguesystemevents component to the npc. and assign the method to onconversationend(). but it is exicuting two times.
    Please do check the below image for reference to the NPC inspector
     

    Attached Files:

    • npc.PNG
      npc.PNG
      File size:
      48.9 KB
      Views:
      408
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    @goutham12 - Add a Dialogue System Events component to the player. Configure OnConversationStart() to disable the player's Selector/ProximitySelector component. Configure OnConversationEnd() to re-enable it. For an example with screenshots, please see the bottom part of the Interaction Tutorial.
     
  29. Wolpertinger-Games

    Wolpertinger-Games

    Joined:
    Mar 4, 2015
    Posts:
    19
    @TonyLi Since we're currently working on a new project with Unity's new Input System, do you already have an ETA on the next planned update of DialogueSystem with support for the new package?

    Thanks a lot
     
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @Wolpertinger-Games - The new input system is still in preview mode. It hasn't been released yet. Its API may change. The next update of the Dialogue System (2.2.5) is scheduled for mid-February. It will have unofficial support for the new input system, so you should be able to start using it (although I wouldn't recommend releasing anything with a preview package). Official support will come when the new input system is released and we know what the final API will be.
     
    Wolpertinger-Games likes this.
  31. Wolpertinger-Games

    Wolpertinger-Games

    Joined:
    Mar 4, 2015
    Posts:
    19
    Thanks for the info! We're aware of the risks of preview packages, but so far the new Input System was stable and we do not want to implement our own input manager for your plugin if you're adding support for it anyways. Keep up the good work and thanks!
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Sounds good. With the new version, you shouldn't have to do anything except tick the welcome window's Use New Input checkbox, and specify the inputs you want to use if you're using the Selector or conversation cancel inputs.
     
    Wolpertinger-Games likes this.
  33. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    Hi sir,
    How do i properly use portrait sprites. am able to give more than one sprite to an actor but i don't understand how to use them.
    Let's say i have a conversation where the actor will speak with defferent emotions.So foreach dialogue we have to give seperate sprite. I added all my sprites to the actor portrait sprites but i don't understand how to use them.
    could you please help me here.
     
    Last edited: Jan 31, 2020
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @goutham12 - Include [pic=#] markup tags in your Dialogue Text. For example, say sprite 2 is happy. You could set a node's Dialogue Text to:
    • Dialogue Text: "I'm happy! [pic=2]"
    For this node, the portrait image will use sprite 2.
     
  35. Danistmein

    Danistmein

    Joined:
    Nov 15, 2018
    Posts:
    82
    Hi,
    Is there a way to trigger an event when I click a response? There are a lot of event triggers in DialogueSystemEvents. But the only event related to Response is OnConversationReponseMenu(Response[]), I can't get which Response the player pressed.

    Best Regards.
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi! If the event is not tied to a scene, you can assign it to the response node's OnExecute() UnityEvent. To see this UnityEvent, inspect the response node in the Dialogue Editor. (Since the dialogue database exists outside of scenes, it can't reference scene objects or their scripts directly.) Otherwise you can use a sequencer command or Lua function. You can write your own sequencer commands or register C# methods as Lua functions. However, some of the many built-in sequencer commands such as SendMessage() or SetActive() may also do what you need.
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Updated Integration Package Patch for TopDown Engine 1.6.1 (and Adventure Creator, Corgi, uMMORPG, etc.)

    The Dialogue System Extras page has a patch that updates the TopDown Engine integration for TDE 1.6.1, as well as updated integration packages for Adventure Creator, Aurora (NWN), Corgi, Inventory Engine, UniStorm, uMMORPG, uRPG, and uSurvival.
     
  38. lcizzle

    lcizzle

    Joined:
    Jun 13, 2016
    Posts:
    18
    Hello,

    Thanks for the link to the FAQ about what files and directories I could move. I totally glossed over it. I had removed some directories and tried the Ink integration sample and received a bunch of errors in the console. Thinking I deleted something I shouldn't I re-imported everything and tried again.

    Still no luck. Any ideas?

    Using the latest Ink integration 0.9.21 and the latest Dialogue System for Unity 2.2.4.

    https://imgur.com/a/Cal5ZQr
     
  39. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Looks like you might have deleted the Scripts folder. Try importing the the Dialogue System again on top of the existing installation. Untick everything. Then tick all Scripts and Wrappers folder.
     
  40. lcizzle

    lcizzle

    Joined:
    Jun 13, 2016
    Posts:
    18
    Importing the Ink Integration and then moving the plugin to another folder fixed the issue. Thanks for the tip.
     
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Happy to help! :)
     
  42. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    Hi sir,
    Am developing a question and answer conversation.
    i need to show question and answer at a time.
    So i made the question sequence to Continue()
    Working fine but facing a small issue.
    When user select the answer before the audio is finishes response menu gets disabled
    and dialogue menu still showing the same question after the audio end up it is going to the next question.
    i need in a way that on user select his option even the audio is completed also it should immediately display the next question.

    am using AudioWait() to play audio.
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @goutham12 - I don't understand. Please break down how you want to handle each case step by step.

    For example:

    Case 1:
    1. Simultaneously show question text in subtitle panel, play question audio, and show answers in response menu.
    2. While audio is still playing, player clicks answer.
    3. Audio stops.
    4. Go to step #1 for next question.
    Case 2:
    1. Simultaneously show question text in subtitle panel, play question audio, and show answers in response menu.
    2. Audio ends before player clicks answer.
    3. Automatically cancel response menu, mark answer as "failed", and go to step #1 for next question.
     
  44. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    Sorry for my English.
    What i need is

    Case 1:
    1. Simultaneously show question text in subtitle panel, play question audio, and show answers in response menu.
    2. While audio is still playing, player clicks answer.
    3. Audio should stop.
    4. Go to step #1 for next question
    What is happening currently

    Case 1:
    1. Step 1 doing right. I mean I displaying question and answer in same time and it is playing audio also.
    2. While audio is still playing, player clicks answer.
    3. Here is the problem, audio not stops, subtitle menu is showing the same question(last question) and response menu gets closed.
    4. After audio gets over it is displaying the next question. Go to step #1 for next question.
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @goutham12 -

    Use the Audio() sequencer command. For example:
    • Sequence: Audio(question1, Dialogue Manager)
    This will start playing the audio and immediately show the response menu. It will play the audio on the Dialogue Manager GameObject. Add an Audio Source to the Dialogue Manager GameObject so you can configure its volume, mixer settings, etc. If you don't add an Audio Source, the Dialogue System will automatically add one at runtime.

    Set the Dialogue Manager's Display Settings > Camera & Cutscene Settings > Default Player Sequence to:
    • Default Player Sequence: AudioStop(Dialogue Manager)
    This will stop the audio that is playing on the Dialogue Manager when the player selects a response.
     
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    SALSA Suite 2.3.0 Integration Updated

    The Dialogue System Extras page has an updated integration package for the new SALSA Suite version 2.3.0.
     
  47. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    No still the problem is there. the issue is not about audio. When user clicks response menu before typing all characters of the question,... *the response menu is closing and subtitle menu is still presented for some time. after some delay it is going to the next question.
    Am not getting any problem if i remove audio from the dialogues
     
    Last edited: Feb 5, 2020
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    How much delay? The amount of delay required to hide the response menu? Or longer?

    Are there any errors or warnings in the Console window?

    Are player nodes configured to play a sequence? Check the Dialogue Manager's Camera & Cutscene Settings > Default Player Sequence and the player node's Sequence field. Try making these nodes blank.

    What are the settings of the Dialogue Manager's Display Settings > Subtitle Settings section?
     
  49. mymilkbiscuit

    mymilkbiscuit

    Joined:
    Feb 9, 2020
    Posts:
    1
    This is such a silly problem I'm having that I'm almost embarrassed to ask.

    How do I change the continue button's control binding? It's currently bound to spacebar.
     
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @mymilkbiscuit - Two ways:
    1. Select menu item Edit > Project Settings. In the Input section, change the binding of the 'Submit' element(s). By default, Submit is bound to space, return, and mouse button 0.
    2. Or add a UI Button Key Trigger component to the continue button, and specify a key or button name.

    The explanation is a little more complex than you might expect. It's not specific to the Dialogue System, but rather a general feature of Unity UI. The Dialogue System's Standard Dialogue UI is plain old Unity UI. When you've enabled continue button mode and you're using joystick or keyboard navigation, the dialogue UI automatically selects (focuses) the continue button during subtitles. Unity UI's EventSystem listens for the Submit input. If pressed, it clicks the currently-selected UI button. This is why the spacebar continues (since the Submit input is bound to space by default).

    The Dialogue System provides an additional component named UI Button Key Trigger that lets you bind additional inputs. If the player presses this additional input while the continue button is active, it will also click the button.