Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    12,670
    Hi @EmeralLotus - It's included. The steps to set it up are here: Adventure Creator Integration.
     
  2. superwendel

    superwendel

    Joined:
    Jun 18, 2013
    Posts:
    105
    Worked perfectly! Thank you so much Tony.
     
    TonyLi likes this.
  3. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Awesome.
    Can QuestMaker be integrated with Adventure Creator also?
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi - Are you talking about Quest Machine? If so, then yes, it's on the roadmap.
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Glad to help!
     
    superwendel likes this.
  6. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Yes, I own both of your excellent assets and for this next project would like to use it with Adventure Creator.
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    It should be in the next release of Quest Machine (1.1.2).
     
  8. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Quick question that's probably very easy to answer. Is there a way to delay between commands when the trigger is simply an interactable object? I'm trying to simply enable one particle effect, wait a duration of time, and then set the second to active. I'm utilizing the following sequence command:

    Code (CSharp):
    1. SetActive(Aura);
    2. Delay(10);
    3. SetActive(Fairy);
    But there is no delay between the two, I'm assuming because this command is probably meant for when within a conversation, not for use as a general trigger maybe?
     
  9. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Wow, totally Awesome.
    Actually I also bought your other package (Love & Hate)
    Cheers
     
    hopeful likes this.
  10. Radiant_Cadenza

    Radiant_Cadenza

    Joined:
    May 11, 2015
    Posts:
    5
    Hello, I'm trying to incorporate the Textline example into a project (This one: https://pixelcrushers.com/dialogue_system/demos/textline/ ) and I'm having three issues with the demo scene and documentation I'm having trouble sorting out:

    1. The icons for the NPC and Player render as white squares during runtime, but the example sprite shows in editor. The web demo also shows them as white squares instead of sprites for me. Any insight as to why and how to fix that?

    2. The "message received" sound effect plays when the preloading icon first appears rather than when the message pops up after the 'typing' delay resolves. How can I change it so that it plays when the actual message shows?

    3. I would like to change scenes when the dialogue finishes. I can't quite figure out how to trigger a scene change from a conversation. I'm having difficulty finding this in the documentation.
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @DespairBear - Try this:

    SetActive(Aura);
    SetActive(Fairy)@10

    You may be interested in the page on How To Write Sequences, which explains the "@" part as well as other ways to time sequences. There's also a set of Cutscene Sequence Video Tutorials.

    Hi @EmeralLotus - Thanks! Love/Hate also has Adventure Creator integration. So all three Pixel Crushers products integrate with each other (Dialogue System, Love/Hate, and Quest Machine), and when Quest Machine 1.1.2 comes out all three will have Adventure Creator integration, too.

    Hi @Radiant_Cadenza - Change your actor portrait images to Editor GUI and Legacy GUI:
    upload_2018-12-3_8-49-41.png

    Here's one way:
    1. Change the Dialogue Manager's Default Sequence to Audio(ReceiveText)@{{end}}:
      upload_2018-12-3_8-55-49.png

    2. Set the Dialogue UI's NPC Pre Delay Settings > Based On Text Length to ticked, and Additional Seconds to 0.
      upload_2018-12-3_8-57-17.png

    3. Adjust the 'typing' delay by changing the Dialogue Manager's Subtitle Settings > Subtitle Chars Per Second. Think of this as how many characters the NPC can type per second. Ten might be a good value, depending on how you want to pace your game.
    The easiest way is to use the LoadLevel() sequencer command in the last dialogue entry node.
    • Dialogue Text: "Bye now. I'm going to the bus stop."
    • Sequence: {{default}}; LoadLevel("Bus Stop")
    In the example above, I included the special keyword {{default}} which is a shortcut for the Dialogue Manager's Default Sequence. You may or may not want this in your conversation, but I thought I'd mention it.
     
    lo-94 likes this.
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Dialogue System 2.0.9 Released

    Version 2.0.9 is now available on the Asset Store! It fixes a critical bug introduced in version 2.0.8.
    If you're using 2.0.8, please update to version 2.0.9!


    Release Notes
    Core:
    • Fixed: Bug introduced in 2.0.8 involving fields with spaces in them. Caused issues with display names and quest entries.
    • Fixed: Fade-from-black animation in SceneFaderCanvas's animator controller.
    • Fixed: ConditionObserver now respects Once checkbox.
    • Fixed: LiveCamera sequencer command now gracefully handles if camera is destroyed before command is done.
    • Fixed: UI animation monitor no longer reports error if animator is destroyed while waiting.
    Third Party Support:
    • LipSync Pro: Fixed error message if character doesn't have LipSync component.
    • uMMORPG: Updated for uMMORPG 1.148.
    • uSurvival: Added Warp() sequencer command.
     
    DMRhodes likes this.
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Unity Christmas Giveaway 2018 - Free Pixel Crushers Assets December 4

    Sign up for the 2018 Unity Christmas giveaway: http://christmas.devdog.io

    December 4 is Pixel Crushers day, with over 15 Pixel Crushers assets being given away, including the Dialogue System. Good luck!
     
    DMRhodes and SickaGames1 like this.
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Cyber Mega Sale - Dialogue System 50% Off

    The Unity Asset Store Cyber Mega Sale ends December 7. Remember to get the Dialogue System for Unity at half price before the sale ends. The Dialogue System includes integrations for a long list of third party assets that are also on sale, such as Behavior Designer, Emerald AI, LipSync Pro, PlayMaker, uMMORPG, and many more.
     
    SickaGames1 likes this.
  15. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Is there a way to communicate with the DialogueSystem via Unity's Event system? I'm looking for a way to send a message or something similar to the Dialogue Manager object which would allow me to set a variable or something of the sort. Does this already exist or something I should write myself?
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @DespairBear - Yes, there are many ways to do this.

    To set a variable using a C# script, use DialogueLua.SetVariable():
    Code (csharp):
    1. PixelCrushers.DialogueSystem.SetVariable("Pi", 3.14);
    You can add a Dialogue System Trigger and select Add Action > Lua Code. Then click "+", select the variable from the dropdown, and specify the value. Or just type it manually if you prefer, like:
    Code (lua):
    1. Variable["Pi"] = 3.14
    If you set the Dialogue System Trigger to OnUse, you can send an OnUse message to it to run the Lua code.

    Or you can use any of the visual scripting actions included in Third Party Support to set variables using PlayMaker, Bolt, etc.

    If you want to react to Dialogue System activity using Unity's UnityEvent system, add a Dialogue System Events component to the Dialogue Manager. This has several UnityEvents such as OnConversationStart, OnQuestStateChange, etc.

    If that doesn't cover what you want to do, please describe it and I'll explain how to do it in the Dialogue System.
     
  17. Proksenos

    Proksenos

    Joined:
    Dec 9, 2017
    Posts:
    7
    Hello, thinking of buying this but I have a simple beginner's question.

    In one of your videos, where you showcased the different UI layout templates included, there was the WRPG UI, in which you mentioned that it accumulates the text, so one can review the whole conversation. I was wondering if there is a simple enough way to make it accumulate all the conversations between all the different actors. Like, the dialogue UI being permanent on the screen, and containing all conversations that took place in that scene.
     
    Last edited: Dec 5, 2018
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Proksenos - Yes. It's not built in, but it's certainly possible and quite easy to do. It might end up being quite a lot of text, though. The shortest solution would be to add a small script that has two methods: OnConversationStart and OnConversationLine. In OnConversationStart, set a bool to add all the accumulated text from previous conversations to the next line. In OnConversationLine, add the previous conversation text if the bool is set, and in any case add the line's text to it. So less than 10 lines of code.
     
    Proksenos likes this.
  19. Proksenos

    Proksenos

    Joined:
    Dec 9, 2017
    Posts:
    7
    Thank you!
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Glad to help! If you'd like to try it out before buying, please feel free to download the evaluation version. But remember to take advantage of the Cyber Sale by Friday!
     
  21. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,269
    It ends on or before Friday?
     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    They say December 7 at midnight PST. I don't know if that means Thursday night or Friday night. I'll try to find it.
     
    SickaGames1 likes this.
  23. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Hey, sorry to be that guy but could I get another tip please? I'm trying to get the 'Persistent Active Data' script working with multiple 'Subtitle Panel' game-objects (One for each actor). My problem is that I have 5 Subtitle Panels. Panel #1 is enabled from the start and the rest are all disabled. Panels 2-5 enable individually when their corresponding actor is currently talking. When the player saves the game and exits it mid-conversation, I need it to know which panel is currently open so that when the player reloads it will enable the correct panel rather than the standard panel #1.

    I guess my question is if there is a way to set up the 'Persistant Active Data' script to identify which actor is currently talking on the dialogue node where the player left off? Something like a Lua condtion of the direction 'Current_Talking_Actor=Bob

    My only idea so far has been to create a dialogue system boolean variable for each panel and go through the entire database and set the script field to change the booleans every time the actor changes, but this seems like a herculean task and there must be an easier way I'm missing.

    Thank you for your time as always. Regards
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Friday, December 7, at 23:59:59 PST.

    Here's an example with a script that saves which panels are open. It includes a new script "DialogueUISaver" that I just put together quickly, so I took a shortcut and made the assumption that the default NPC panel is panel #0 and the default player panel is panel #1.
     

    Attached Files:

    DMRhodes likes this.
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Preliminary Super Text Mesh Support

    The Dialogue System Extras page has a preliminary support package for Super Text Mesh (STM) that adds STM support to the Standard Dialogue UI system.

    As a reminder, the Dialogue System already includes support for regular Unity UI, TextMesh Pro, NGUI, and others.
     
  26. Proksenos

    Proksenos

    Joined:
    Dec 9, 2017
    Posts:
    7
    Just bought it! Thanks for being helpful and for making the program.
     
  27. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Thanks! If you have any questions about using the Dialogue System, please post here or the Pixel Crushers forum or use the support form or email tony (at) pixelcrushers.com, whichever you prefer.
     
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
  29. RayWolf

    RayWolf

    Joined:
    Mar 24, 2012
    Posts:
    87
    Hi!
    I dont know what Im missing here, cant find it in the documentation either. My problem is I dont get the successfull or failure descriptions wen I do SetQuestState("speak with the NPC", "success") in an conversation node which is clicked by the player. I mean, the Quest does shown as completed in the questlog but with no indication of success or failure.
    Best thing would be in addition to this to changethe quest description from e.g. "speak with the NPC" to "I have spoken to the NPC" when quest ist completed successfull but I dont know how to do it..or is it broken? (I did fill the field success description) Maybe as a summary I think its a bug: The "Quest Entry Description" is not shown in questtracker or quest log and not updated during dialogue. I used the prefab and can see it in editor at the right place directly under the quest description-title thingy. Can someone help please?
     
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @RayWolf - There was a bug introduced in version 2.0.8. It's fixed in version 2.0.9. Would you please check your version (Tools > Pixel Crushers > Dialogue System > Welcome Window or _README.txt file) and update if you're on 2.0.8?
     
  31. RayWolf

    RayWolf

    Joined:
    Mar 24, 2012
    Posts:
    87
    yes I am on 2.0.8 according to the _README in the Dialogue System Folder. I will got to assetstore and Update.

    edit: Thank You! This solved my Problem, I should have come here days ago. Also the update to 2.0.9 fixed the missing fade-out thingy I was trying to implement yesterday. Thank you for the great support and in generally for keeping this wonderful asset up-to-date :)
     
    Last edited: Dec 7, 2018
    TonyLi likes this.
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Glad to help! :)
     
    SickaGames1 likes this.
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Just watched Jon Ingold's excellent talk, "Sparkling Dialogue: A Masterclass" recorded last month at AdventureX:



    It's inspiring stuff if you're writing dialogue. (The Dialogue System for Unity has Ink integration, btw.)
     
    wetcircuit likes this.
  35. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Been mucking around a bit trying to find a solution to this as it may be a bug. If you try passing a newline to an alert with a duration, it seems the newline is printed as a string literal. If you simply show the alert with the default duration, it prints with the newline as expected
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @DespairBear - How are you initiating the alert? C# call to DialogueManager.ShowAlert()? Dialogue System Trigger with Show Alert action?

    I just tested with this script, and it seems to be OK:

    Code (csharp):
    1. using UnityEngine;
    2. using PixelCrushers.DialogueSystem;
    3.  
    4. public class TestAlert : MonoBehaviour
    5. {
    6.     void Update()
    7.     {
    8.         if (Input.GetKeyDown(KeyCode.F1))
    9.         {
    10.             DialogueManager.ShowAlert("Line1\nLine2", 3); // Newline alert with duration.
    11.         }
    12.         else if (Input.GetKeyDown(KeyCode.F2))
    13.         {
    14.             DialogueManager.ShowAlert("Line1\nLine2"); // Newline alert with default duration.
    15.         }
    16.     }
    17. }

    Also, what GUI system are you using? Unity UI Text? TextMesh Pro?
     
  37. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    I was just using the default UI Dialogue System ships with and I was calling it from the Sequencer. I found the issue. In the ShowAlert method on line 1149 of the DialogueSystemController.cs it doesn't parse for the newline like the other ShowAlert method on line 1164. All I had to do was take the newline replacer from line 1166 and paste it into the if statement within the ShowAlert method that takes the duration as the second parameter

    Thanks for the prompt response. The quality of this asset and the quality of support is phenomenal.
     
    Proksenos likes this.
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Thanks for catching that. Consider it fixed in the upcoming version 2.1.0.
     
    Proksenos and hopeful like this.
  39. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Thank you. what would I have to change to get this working with the "JRPG Unity UI Dialogue UI"? In my case the standard NPCs and Player both share panel 1. There is no panel 0. The rest of the panels up to 5 are used individually by different actors.

    Also is there any functional difference between saving using the 'Save System' script attached to the dialogue manager and saving using the 'Game Saver' script set to it's own game-object? Or do they essentially do the same thing?

    Thank you for your time. Regards
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Candy-Bomber - The script is written to work with the Standard Dialogue UI system, so the JRPG Template Standard Dialogue UI prefab. If you're using the Standard Dialogue UI, the script should work fine. Standard Dialogue UI lets you define as many panels as you want. The saver script will simply work with whatever panels you've defined.

    If you're using the JRPG Unity UI Dialogue UI, which uses a Unity UI Dialogue UI script, it's a bit more complicated. This is because the older Unity UI Dialogue UI system was designed to work with one NPC panel and one Player panel. Extra panels had to use an Override Unity UI Dialogue Controls component, which makes for a little more work to track down what panels are actually in use to include that information in a saved game. If you're using Unity UI Dialogue UI and can't switch to Standard Dialogue UI, let me know. I can take a look at what changes the script would require.

    If your scene has a Save System, the Game Saver simply acts as a front-end and hands off all saving work to the Save System. Note that the Save System survives scene changes. So if you have a Save System in, for example, your starting scene, you don't necessarily need one in subsequent scenes. The Save System will carry through your scene changes.
     
    DMRhodes likes this.
  41. cheesee09

    cheesee09

    Joined:
    Mar 30, 2018
    Posts:
    35
    Hi @TonyLi how can I create a changing dialogue? For example I already finished a quest then the dialogue should change too. Or when go to a new scene then back again at the scene but the conversation also changes like in final fantasy games?
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @cheesee09 - Use Conditions. (More info: Conversation Conditions Tutorial and Conditional Logic)

    For example, see Private Hart's conversation in the Dialogue System's DemoScene1. When you talk to Private Hart, he will change what he says based on a quest state:

    upload_2018-12-14_8-17-6.png

    You can set Conditions based on quest states, Dialogue System variable values, or anything you want by using the included third party integration packages (e.g., a PlayMaker value) or defining your own Lua functions.

    If you don't want to put all of an NPC's dialogue into a single conversation, you can write several conversations and link them to each other. To link one conversation to another, inspect a dialogue entry node. Set the "Links To:" dropdown to (Another Conversation) and specify the destination.

    You can also use markup tags to include variable values and other dynamic text inside your dialogue text. For example:
    • Therapist: "You seem [var=PlayerMood] today. Why do you feel that way?"
     
  43. cheesee09

    cheesee09

    Joined:
    Mar 30, 2018
    Posts:
    35
    Thanks for the immediate response
     
  44. cheesee09

    cheesee09

    Joined:
    Mar 30, 2018
    Posts:
    35
    I have another question though. Does the built in quest system integrated with in vector TPC?
     
  45. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Hi, I have one final save system related question please. Last one I promise.

    How would you suggest triggering a save via sequence command? I want to set up something sort of like the checkpoint based save system but mid-dialogue rather than 'in-game' with trigger colliders, so the ideal solution would be for a specific dialogue node to SaveToSlot(int) on it's own without interrupting game-play.

    Thank you for your time. Regards

    Edit - Okay, nevermind! I jury-rigged the following solution. I created 2 game-objects a "Save Tripwire" which is made after the example listed in the checkpoint save system documentation and a "Save Tripper" which is a game-object made with a box collider and animator with the animation moving the Tripper game-object into the Tripwire game-object, triggering the box collider collision and corresponding save.

    I just wanted to note that the checkpoint save system didn't work as it was written in the doucmentation, but it did after I added a Rigidbody to the game-objects.
     
    Last edited: Dec 15, 2018
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @cheesee09 - Yes. The integration documentation is here. The integration lets you pause the player's control of the character and camera during conversations so you can talk to quest givers. Quest givers can use special Lua functions to give quest reward items and increase health max health. And it's integrated with the save system so you can save your character's quest progress, location, stats, and inventory.

    Hi @Candy-Bomber - Sounds like you have a solution in place. Another way to do it would be to add a Game Saver component to the Dialogue Manager (or whatever GameObject you prefer). Then use the SendMessage() sequencer command to tell it to save the game. For example, the command below tells the Game Saver on the Dialogue Manager to save the game to slot 1:

    Code (sequencer):
    1. SendMessage(SaveGame, 1, Dialogue Manager)
    Since you're saving in the middle of a conversation, you may want to add a Conversation State Saver to the Dialogue Manager. This will save the current position in the conversation. When the player reloads the saved game, it will resume the conversation at that point.

    Since it uses regular Unity physics collisions, it requires a rigidbody (as you noted) and the objects must be on layers that are configured to register collisions. I'll make that clear in the next update's documentation.
     
  47. Saso222

    Saso222

    Joined:
    Feb 17, 2015
    Posts:
    6
    Hello,

    Sorry if the question is already answered or in the doc, I couldn't find it.

    How would you approach a sentence said by the player character without having to select it from the response menu? It would be the only "choice" for the player.

    Thankls
     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Saso222 - When the player only has one choice, if you want the player to automatically say it, inspect the Dialogue Manager and untick Display Settings > Input Settings > Always Force Response Menu. This will apply whenever the player only has one choice.

    If you only want it to apply in a specific case, leave the checkbox ticked, and instead add the markup tag "[auto]" to the player's text for that choice.
     
  49. Saso222

    Saso222

    Joined:
    Feb 17, 2015
    Posts:
    6
    Hi, @TonyLi. That's exactly what I was searching for. Thank you very much.
     
  50. TonyLi

    TonyLi

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