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

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    That will work, too. The "actor:" syntax was added in 2.2.30 to help disambiguate certain cases.
     
    EpicMcDude likes this.
  2. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    Hello Tony

    There is possible to export a text table to .csv?

    Thanks
    Claudio
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @claudius_I - Yes:

    upload_2022-9-9_9-0-55.png
     
    the_unity_saga and claudius_I like this.
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Disco Elysium Voted #1 Again in PC Gamer Top 100 of 2022

    Congratulations to Studio ZA/UM! PC Gamer has listed Disco Elysium, made with the Dialogue System for Unity, in the #1 spot of their Top 100 PC Games for a third year in a row!

     
  5. mario_code4ever

    mario_code4ever

    Joined:
    Jan 9, 2020
    Posts:
    36
    How i can save quest status(quests overall). Like for example i took quest from a guy to go talk with another guy. I want that to be saved when i press Play again it shows i am on that quest still. I know you got save for position and dead enemy i watched the video. Just i dont need this in the game right now i just wanna save the quests.
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi - Set up the save system, and add a Dialogue System Saver component to the Dialogue Manager. If you want to automatically save when you quit the game and automatically load the saved game when you play again, add an Auto Save Load component.
     
  7. Genghis42

    Genghis42

    Joined:
    Feb 14, 2018
    Posts:
    18
    Hi there. I'm writing dialog that has many actors (currently six, counting narrator and player), and I'd like to assign a different color to the subtitles of each actor.

    So far I've been able to add a "Dialogue Actor" component to the same Game Object that has the Dialogue System Trigger, and use that to change color for the conversation's conversant. But this color is then applied to ALL the NPCs, regardless of who I choose in the "Dialogue Actor"->"Actor" dropdown menu. I was hoping I could just add multiple "Dialogue Actor" components and specify a different actor and subtitle color for each, but only the first component is used.

    My initial guess was that I needed to use distinct Game Objects for each Dialogue Actor, but the component doesn't do anything unless it shares a GO with the trigger. Is there another component I should use to inform the database about my color choices?
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi! Each Dialogue Actor should be on a separate GameObject because it does more than just let you specify a subtitle color. (For example, it associates the GameObject with the actor so sequencer commands know which GameObjects to operate on.) A typical setup is to put a Dialogue Actor and a Dialogue System Trigger on an NPC GameObject. But if you want to have the Dialogue Actor and Dialogue System Trigger on separate GameObjects, that's fine, too. More info: Character GameObject Assignments.
     
    Genghis42 likes this.
  9. Genghis42

    Genghis42

    Joined:
    Feb 14, 2018
    Posts:
    18
    Thanks! Putting a trigger with the "start conversation" action and no triggering conditions (which was a bit counter-intuitive) on each distinct game object + Dialogue Actor did the trick.

    EDIT: Sorry, I confused myself and used the wrong terminology. But now I'm unable to reproduce the problem I thought I had before my first post. (Hate it when that happens! >.< )

    So anyway, ignore my muddled thoughts. D'oh.
     
    Last edited: Sep 17, 2022
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    I'm glad it's working. I'm not quite sure what you mean by no triggering conditions. If you assign GameObjects to the Dialogue System Trigger's Actions > Start Conversation > Conversation Actor & Conversation Conversant, the conversation will use those GameObjects for the active conversation's actor & conversant. If you leave either field blank, it will use the GameObject with the Dialogue Actor that's set to the conversation's actor/conversant.

    If you're talking about the Dialogue System Trigger's Conditions section, those Conditions are requirements to be allowed to start the conversation. For example, you could set Conditions > Quest Conditions to require that a quest must be in a specified state or the conversation won't start. If you haven't specified any Conditions, then the conversation will start when the Dialogue System Trigger is triggered (e.g., by OnTriggerEnter, or OnUse using a Selector, etc.).
     
  11. Genghis42

    Genghis42

    Joined:
    Feb 14, 2018
    Posts:
    18
    Hello again. Is it possible to resize nodes in the Dialogue editor window, i.e., make individual node rects bigger in x or y? I know I can zoom in to increase font size, but I'd like to resize long response options to be visible at a glance, without hover-over (which can be hard to read when I'm zoomed in).
     
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi - The Dialogue Editor window is intentionally designed to look and work similarly to the Animator window that Unity devs are already familiar with. That said, it does have many more display features than the Animator window, such as the ability to show nodes at 2x, 3x, and 4x width to make more content visible:

    upload_2022-9-17_19-15-57.png

    If you change node widths, you will probably want to select Auto Arrange to rearrange the nodes so they don't overlap that their new, wider sizes.
     
    Genghis42 likes this.
  13. Dumpling007

    Dumpling007

    Joined:
    Dec 13, 2018
    Posts:
    32
    Hi, Tony! I want to know how show the conversation with images?
    For instance:
     

    Attached Files:

  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi! If you want to show images in-line with the text, I recommend using TextMesh Pro (see TextMesh Pro Support) and <sprite> tags.

    If you want to show images in a separate panel, the easiest way is to add those images to inactive GameObjects in the dialogue UI. Then use the SetActive() sequencer command to activate whichever Image GameObject you want to show.

    upload_2022-9-21_10-54-33.png

    Some alternatives include:
    • Write a custom sequencer command (tutorial) to show images. This may be more robust, but it's a little more work to set up.
    • Make a subclass of StandardUISubtitlePanel and override SetContent() to also show an image.
    • Make your own C# implementation of IDialogueUI instead of using the StandardDialogueUI script.
    • (As alternatives to using SetActive().)
    If you have questions about any of these, please let me know.
     
  15. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    Hello Tony

    I have a very weird error only in one of the npcs conversation.
    is when I press the button to start the conversation.

    Thanks
    Claudio

    *************************************
    fixed.
    Have to update "dialogue to trigger table"
    *************************************
     

    Attached Files:

    Last edited: Sep 21, 2022
    TonyLi likes this.
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    That's correct. The problem was that the dialogue entry didn't have a matching Guid in the localization table:

    upload_2022-9-21_15-31-5.png

    Unity's Localization Package should really handle this gracefully, but it throws an exception instead. Anyway, I'm glad you got it straightened out.
     
    claudius_I likes this.
  17. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    Thanks Tony.
    Now i understand better how workers the localization :)


    I don't know if this is a bug, but i think this need a space. (Image)
     

    Attached Files:

  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    It's a quirk in the way some versions of Unity draw reorderable lists and return their height in pixels. I'll look into it.
     
    claudius_I likes this.
  19. Dumpling007

    Dumpling007

    Joined:
    Dec 13, 2018
    Posts:
    32
    Thanks so much, Tony!
     
    TonyLi likes this.
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Glad to help!
     
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Suzerain 50% Off This Weekend, The Spirit and the Mouse Releasing Monday

    Torpor Games' hit political sim / visual novel Suzerain, made with the Dialogue System for Unity, is 50% off on Steam and Nintendo Switch this weekend.




    On Monday, Alblune's highly-anticipated game The Spirit and the Mouse, also made with the Dialogue System, releases on Steam!



    These are just two of many different types of games you can make with the Dialogue System for Unity.

    The Dialogue System is also available in Humble Bundle's Unity Tools Bundle for 2 more weeks along with great assets such as TopDown Engine and UniStorm, both of which the Dialogue System integrates with. (Make a great top-down action RPG with TopDown Engine and the Dialogue System!) You can get all of these tools in the bundle for 98% off the regular price.
     
  22. Genghis42

    Genghis42

    Joined:
    Feb 14, 2018
    Posts:
    18
    Hello again, Tony!

    Is it possible to make custom inspectors for a DialogueEntry in the Dialogue Editor? I'm making extensive use of rich text, and have used Odin Inspector to create a "RichTextArea" drawer. If I could put this quasi-WYSIWYG drawer into the Dialogue Editor, it would make my workflow much easier.

    In fact, I'm going further than that by using custom markup and OnConversation{Line,ResponseMenu} pre-processors to convert (e.g.) the following DialogueText to rich text (and then display it as above), where the RT tags associated with each custom tag can be changed down the line:

    -------------------------------------
    <prompt>
    <speech>I got you, bro!</speech> <action>Heal $partnerName$</action>
    </prompt>
    <consq>
    $partnerName$ will be healed by $healPoints$ points.
    </consq>
    <hist>$playerName$ healed $partnerName$ by $healPoints$.</hist>
    -------------------------------------

    I'm aware I'm ignoring your own variable system, but I intend to have many more moving parts than even this, so I'd prefer to roll my own text pre-processors. And a custom drawer would be even more helpful here.
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi - Yes:
    • To customize the way nodes are drawn, assign a handler to DialogueEditorWindow.customDrawDialogueEntryNode(DialogueDatabase, DialogueEntry, Rect).
    • To draw additional information in the dialogue entry inspector, assign a handler to DialogueEditorWindow.customDrawDialogueEntryInspector(DialogueDatabase, DialogueEntry).
    More info: Customizing the Dialogue Editor
     
    Genghis42 likes this.
  24. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    174
    I assume it was already asked a million times but I can't find it so I'll add a million and one (sorry about that lol): is there any chance we could expect an official integration to the Blink's RPG Builder?
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Yes, you can expect it this week. The integration is going through testing, and we're finishing up the documentation.
     
    SammmZ likes this.
  26. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    174
    Oh, awesome! Thanks a lot, I didn't expect it so soon :)
     
  27. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    The Spirit and the Mouse Out Now on Steam & Switch

    Congratulations to Alblune on the release of The Spirit and the Mouse, made with the Dialogue System for Unity and published by Armor Games! You can get it right now on Steam and Nintendo Switch.

     
  28. Fragment1

    Fragment1

    Joined:
    Aug 30, 2013
    Posts:
    67
    Is there a way to run something akin to unity events that have multiple defined inputs?

    To keep it generic I have a function, "PerformAct" which takes:
    GameObject actor, GameObject conversant, MyConfig actorConfig, MyConfig conversantConfig

    Any one of those variables can and will change and I really don't want to have to set up potentially hundreds of unique functions just to get every possible combination covered.

    I'd rather go directly from the dialog system to feed it the config required at the end of each conversation tree.

    Is this possible?
     
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @Fyrburn - Register your PerformAct() method with Lua (instructions) and use it in the Script field of dialogue entries. You'll need to use standard types such as string, bool, etc. But the Dialogue System offers lots of properties that you can access, such as DialogueManager.currentActor, currentConversant, and currentConversationState.

    Remember to create a CustomLuaFunctionInfo asset so you can select your method from the "..." dropdown menu instead of having to type it manually.

    Alternatively, you can write a custom sequencer command.
     
    Last edited: Sep 28, 2022
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    RPG Builder Integration Released

    The beta version of the Dialogue System's integration with BLINK's RPG Builder is now available on the Dialogue System Extras page. (direct download)

    Documentation: RPG Builder Integration

    If you have any feature requests, bug reports, or questions, please let me know. I plan to add more demo content, but we wanted to release this version without any more delay so RPG Builder users will have full access to all integration functionality even if it's not all demonstrated in the demo content yet.
     
    SammmZ likes this.
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    ICYMI - Released: The Spirit and the Mouse

    Alblune's The Spirit and the Mouse, made with the Dialogue System for Unity, is available on Steam and Nintendo Switch. It's rated Very Positive on Steam, and Wholesome Games says:
     
  32. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    174
    Yay, thanks a lot for the rpgb integration! <3
     
    TonyLi likes this.
  33. jmgek

    jmgek

    Joined:
    Dec 9, 2012
    Posts:
    177
    TMP support is not in the plugins folder, how can I support TMP?
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Please see: TextMesh Pro Support:
    1. Tick the Welcome Window's TMP_PRESENT checkbox.

    2. Inspect the field you want to change to TextMesh Pro:


    3. UNassign the UI Text field. This will reveal a TextMeshProUGUI field that you can assign:
     
    jmgek likes this.
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    BIOMORPH at MEGAMIGS

    Attending MEGAMIGS 2022? Stop by booth 235 and play the demo of BIOMORPH, made with the Dialogue System for Unity. You can also wishlist it on Steam.



    Lucid Dreams is also the studio behind Legends of Ethernal, also made with the Dialogue System for Unity.
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Updated Integrations: Corgi, Lively Chat Bubbles, Localization Package, RPG Builder, Visual Script, Yarn

    The Dialogue System Extras page has updated integration packages for several assets:
    • Corgi Platformer Engine: Updated for v8.1.
    • Lively Chat Bubbles: Adds support for portrait images.
    • Localization Package: Updated with additional integration handling.
    • RPG Builder: Latest integration.
    • Visual Scripting: Adds Get Lua Result As Type methods.
    • Yarn 1.x: Import fixes; added support for <<seq sequence>> commands.
    These updated integration packages will also be the upcoming version 2.2.33.
     
  37. wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    Joined:
    Dec 22, 2021
    Posts:
    56
    Hi, Im using CorgiEngine and InventoryEngine and DialogueSystemMenuFrameWork.When i pressed Esc button to close Corgi's InventoryDisplay, the game is Unpause But DialogueSystem Pause menu showing up.

    How to prevent them from appearing at the same time?I want the esc key to handle only one function.
     
  38. wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    Joined:
    Dec 22, 2021
    Posts:
    56
    Should i add some code on Corgi‘s InventoryInputManger.cs?Sorry im not programmer.I need help.
     
  39. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi! You can set a different button to open the Menu Framework's pause menu if you want. Inspect the MenuSystem GameObject's Pause component and set the Pause Button field.
     
  40. _sh4na_

    _sh4na_

    Joined:
    Jun 4, 2014
    Posts:
    10
    Hi! We're using the dialogue system with player input - the player has to type some input, if it's correct it'll continue the conversation, otherwise it will loop back and show them the input box again. When the player types input and hits enter, the text is echo'd back to them.

    I've hooked up the save system to replay all of the dialogue when the player starts the game, but I'm not sure how to replay the user input correctly - I save the input in a variable, but since variables are a global state, not per-dialogue-node-execution state, the replay just repeats the last user input over and over, instead of replaying each input they entered.

    Is there a way to save data when a node is entered in such a way that it is tied to that specific point in the dialogue loop, and unique no matter how many times it was entered? Is there a magic variable or sequence or something that can do that? I can probably hack something up but I'd rather use a builtin system, if it exists.
     
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi! What do you mean by replaying all of the dialogue when the player starts the game? Does it play through the dialogue in realtime as if the player were clicking continue or watching sequences? Or does it simply repopulate some history log that the player can open and review? When you do the replay, are you actually showing a simulation of the player's text input as it's typed into the input field? If so, you should be able to show the variable's value.

    To answer your specific question, each node is uniquely identified by a conversation ID and dialogue entry ID. You could store something in a record with the conversation ID and dialogue entry ID. When the conversation is playing a node, the property DialogueManager.currentConversationState will contain information about the current node. You can also use an OnConversationLine method.
     
  42. _sh4na_

    _sh4na_

    Joined:
    Jun 4, 2014
    Posts:
    10
    This is using your SMS dialogue UI. The replay system replays the dialogue, but it only stores the IDs of the nodes that were executed (the conversation id and entry id), and when it replays the dialog, it evaluates the fields of each node. In the case where a node has data that is specific to what the player typed into a text box, I can't find a way of saving that specific player input into a variable that is tied to that specific step in the dialogue - the dialogue entry ID is going to always be the same, since it's a loop and the node gets executed multiple times. Not having a way of storing data tied to conversationID+dialogEntryID+currentConversationTreeStepCount is making this very limiting.

    I hacked around your SMSDialogueUI and split out the part where you create the Subtitle from the records data (on
    OnApplyPersistentData), so I could load the correct text into the subtitle in these cases. It works, but it feels very hacky.
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Ah, got it. That's the catch. Each conversationID+dialogEntryID+currentConversationTreeStepCount will have its own variable value. Two ideas:

    1. You could make a subclass of SMSDialogueUI that overrides AddRecord, OnRecordPersistentData, and OnApplyPersistentData. In AddRecord, store the current step count's variable value, such as in a list that exists parallel to the records list. (You might actually have to save it after the player enters their input.) In OnRecordPersistentData, append this extra list to the save string. In OnApplyPersistentData, pull out the data from the save string.

    2. Or use an additional dialogue database variable, maybe called loopCount. In the dialogue entry's Script field, increment loopCount. In the Sequence, store the player's input in a variable whose name includes loopCount. These variables are automatically saved in saved games, so you won't need to do any scripting except maybe resetting loopCount before replaying the conversation.
    • Dialogue Text: "Enter the name of a color."
    • Script: Variable["loopCount"] = Variable["loopCount"] + 1
    • Sequence: TextInput(Text Field UI, Color: color[var=loopCount], , clear)
    Assuming loopCount's Initial Value is zero, the first time the node above runs, it will store the player's input in a variable named color1. The next time the node runs, it will store the input in color2, etc.
     
  44. _sh4na_

    _sh4na_

    Joined:
    Jun 4, 2014
    Posts:
    10
    Ooooooh dynamic variable names, yes, this is what I was looking for. The other method of subclassing works, but I want to override the text in the subtitle only when loading data from storage, and unfortunately the subtitle is created as part of a lot of other code in ApplyPersistentData, so I can't override that method without rewriting the whole thing. I moved the Subtitle creation code into its own virtual method and overrode that, which works, but it's potentially finicky - dynamic variable names are a much better solution, I'll try that!
     
    TonyLi likes this.
  45. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Hey @TonyLi, something I noticed with the default UI for conversations:
    Unity_2022-10-26_20-48-02.jpg Unity_2022-10-26_20-48-10.jpg

    In the first image, with the player's dialogue, the Continue button looks fine. For the second however, with the "NPC" dialogue, the Continue button's text is too big for the button itself and truncates.

    I didn't change anything with DSfU text sizes, but could that be related to my Canvas Scaler or something? Or is it something internal to DSfU?
     
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    In that generic dialogue UI, the NPC Subtitle Panel's Continue Button has a Layout Element with a Min Width of 74, which should be wide enough for the text unless the font or font size was changed. But feel free to increase the Min Width if it's getting cut off for some reason.
     
    EternalAmbiguity likes this.
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    TextMesh Pro Bubble Text Package Available

    There have been a lot of requests for a separate download of the speech bubble prefabs shown in the free Feel + Text Animator + Dialogue System Bundle Demo Scene:

    upload_2022-10-29_8-57-41.png

    upload_2022-10-29_8-57-56.png

    They're now available on the Dialogue System Extras page, in the UIs section (direct download). The prefabs in this package don't require Text Animator or Feel, but if you want to add that extra bit of polish and juice to your game, you can get both assets for 20% off using the Feel + Text Animator + Dialogue System Bundle link. You only need to pay for licenses for the assets you don't already have, and the 20% discount will be applied to them.
     
  48. SI_007

    SI_007

    Joined:
    Aug 10, 2015
    Posts:
    84
    Hi Tony,

    I am having some difficulties with the SceneFaderCanvas in Virtual Reality (XR with Hurricane VR rig). I am using the canvas prefabs in your XR example (screen, fade, world). The world canvas works perfectly. However, when a fade(stay) is called, although the game view does fade to black, the screen on the headset itself does not fade at all.

    *However, if I trigger the SceneFaderCanvas animator manually (show/hide), the screen canvas does fade to black, both in the game view and the headset.

    Do you have any idea on what could be causing this issue?

    PS: I did notice that on start, the camera event / renderer in the canvases were reset to none. I used a script to make sure that these were set to the VR rig camera (if (ref_FaderUI.worldCamera == null){ ref_FaderUI.worldCamera = ref_hexaPelvis.GetComponentInChildren<Camera>();}. Now the canvases are always set to the VR rig camera. Yet, the fade issue still persist.

    Thanks!
     
    Last edited: Oct 31, 2022
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi! Since you can trigger the SceneFaderCanvas manually and it fades the headset, is it possible that you have two SceneFaderCanvases? Maybe one of them has the worldCamera set and the other doesn't.

    If that doesn't help, would it be possible for you to email a reproduction project to tony (at) pixelcrushers.com or provide reproduction steps?
     
  50. SI_007

    SI_007

    Joined:
    Aug 10, 2015
    Posts:
    84
    Hi Tony,

    After a few more tests, I noticed that a new Canvas(fader) gets spawned when the dialogue sequence calls the fade(stay). As you suggested, this new Canvas(fader) is used for the fade instead of the default SceneFaderCanvas.

    Perhaps the dialogue manager can't find the SceneFaderCanvas, and therefore spawn this new canvas(fader) when the sequence gets called?

    Is there a way to disable this automatic spawning or to provide a reference for the default SceneFaderCanvas to the dialogue system?

    * Note: Technically, I could always trigger the fade animation via an event. However, it would be preferable if everything was done via the sequence.
     

    Attached Files: