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

    ghegi

    Joined:
    Jun 3, 2018
    Posts:
    28
    Hello, I just bought this asset and then I'm reallyyy having a very hard time to set it up. I just want to learn how to. So I have this character and then an item. Whenever he picks the item, a dialogue will come up that says what the character is thinking about the item. Also I want it to trigger the conversation whenever the item is picked up and that is set through a touch button set up by a Cross Platform Input Manager to make it available for Android.

    Please, I really want this. Thank you!
     
  2. CHOPJZL

    CHOPJZL

    Joined:
    Dec 5, 2016
    Posts:
    55
    Em...hover text is a little different from what I need. A floating text works like underline effect, except it is a specific text, and further more a simultaneous typewriter effect with the main dialogue is welcomed
    Now I can get the text content with link tags, but I didn't figure out how to put it to the right position(middle up of the link text) with no interaction
     
    Last edited: May 4, 2019
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @ghegi - Thanks for buying the Dialogue System! If you haven't done the quick start tutorial, I recommend doing that first. It takes about 5 minutes.

    Then for the item, set up a Dialogue System Trigger set to OnUse, just like the quick start. When you want to show the conversation, call the OnUse() method. For example if there's a UI button, configure its OnClick() event to call DialogueSystemTrigger.OnUse. If you can provide more information about how the character picks up and views items, I can provide more specific details.

    If you use TextMesh Pro, the link info has a linkIdFirstCharacterIndex property. You can use this to determine where to position the floating text.
     
  4. ghegi

    ghegi

    Joined:
    Jun 3, 2018
    Posts:
    28

    I called it on a script whenever the item is picked up.

    Code (CSharp):
    1. void Start ()
    2.     {
    3.         trigger = GetComponent<DialogueSystemTrigger>();
    4.         game = GameManager.instance;
    5.     }  
    6.  
    7. /////////
    8.  
    9. if(Input.GetKeyDown(KeyCode.F) || CrossPlatformInputManager.GetButtonDown("A"))
    10.             {
    11.  
    12.                 trigger.OnUse();
    13.  
    14.                 if(clip == ClipName.Discovery)
    15.                 {
    16.                     clipName = "Discovery";
    17.                 }
    18.  
    19.                 if(clip == ClipName.NormalPickup)
    20.                 {
    21.                     clipName = "NormalPickup";
    22.                 }
    23.  
    24.                 if(clip == ClipName.SpecialPickup)
    25.                 {
    26.                     clipName = "SpecialPickup";
    27.                 }
    28.  
    29.                 game.sfx.PlaySound(clipName);
    30.                 GameManager.instance.hasWoodenSword = true;
    31.                 this.gameObject.SetActive(false);
    32.             }
    but it still wouldnt come up? Why is that. I've also set the database to my daatabase and also the conversation
     
  5. ghegi

    ghegi

    Joined:
    Jun 3, 2018
    Posts:
    28

    NEVERMIND IM STUPID. I Forgot to add the prefab of the dialogue manager. Lol. Thanks tony!
     
  6. ghegi

    ghegi

    Joined:
    Jun 3, 2018
    Posts:
    28
    Another question, I have a function I want to call from a gameobject on the scene but I can't drag it here. It only allows objects from the assets. How do I make it work?

    upload_2019-5-5_10-1-21.png
     
  7. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi its me again regarding the numfield text input for the dialogue system when I build the game with all the scenes and play the game and go to the shop the numfield input field disappears but when I build the game with only the main town scene where the shop is located it appears. How to fix it?
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @ghegi - That's correct. Since dialogue databases don't exist in a scene, the OnExecute() event can't point to GameObjects in a particular scene. (more info)

    Instead, you have a few options. If your function takes zero parameters or one string parameter, you can use the SendMessage() sequencer command in the Sequence field. For example, say the GameObject is named "Force Field" function is named Activate(). Then you can set the Sequence field to:

    - Sequence: SendMessage(Activate,,Force Field)

    If the function takes one string parameter, you can provide that as the second argument. For example, say Force Field has another method named SetSecurityLevel(string level). Then you can set Sequence to:

    - Sequence: SendMessage(SetSecurityLevel, orange, Force Field)

    The Dialogue Manager has a Default Sequence (in Camera & Cutscene Settings) that delays the subtitle for a duration to give the player time to read it. If you want to include the Dialogue Manager's Default Sequence, add {{default}} like this:

    - Sequence: SendMessage(Activate,,Force Field); {{default}

    (more info on sequences, tutorials)

    Your other options are to write a custom sequencer command that you can use in the Sequence field, or register your function with Lua and use it in the Script field.


    Hi @dinaloraven234 - Remember that the Dialogue Manager survives scene changes and prevents any new Dialogue Managers from existing. So the first Dialogue Manager that comes into existence will be the one that sticks around. Make sure this Dialogue Manager has your numfield input field. A common way to do this is to make it a prefab. Then use an instance of that same prefab in any scene where you want to add a Dialogue Manager instance.
     
  9. CHOPJZL

    CHOPJZL

    Joined:
    Dec 5, 2016
    Posts:
    55
    Hi @TonyLi
    I asked the same question in the TMP forum and was guided to this post. Using custom style to achieve my goal. Although still need some adjustment, I think this is right path. (Never thought space tag could be a negative number……)
    And today I by chance found the formal name of the floating text. It is called Ruby character.
     
    Last edited: May 5, 2019
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Thanks! That's good to know.
     
  11. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi I have an opening video in a new scene and what I want is after I click the start button it will be redirected to the new scene with the opening video and after that to the main town scene. How can I do it?
     
  12. TonyLi

    TonyLi

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

    1. Make the video scene the first gameplay scene. When you click Start, it will load the video scene.
    2. Add a Dialogue System Trigger to the video scene. Set it to OnStart. Select Add Action > Play Sequence. Set the Sequence to:
      LoadLevel(nextScene)@time
      where time is duration of the video.
     
  13. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi thanks for the response regarding the @TimE is the format same as the video like if its 1.24sec then I'll just add LoadLevel (MainTownScene) @1.24?
     
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    @dinaloraven234 - Yes, that's correct. It's in seconds. If your video is longer than one minute (such as 1 minute, 30 seconds), specify it in seconds (90 seconds).
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Two Ways To Save - May Madness and Platformer Bundle

    The Dialogue System for Unity is part of the Asset Store's Platformer Bundle, paired with Corgi Platformer Engine, Bolt, and other great assets all at 55% off. It's a great way to get a quick start on a platformer game with conversations, barks, and quests.

    And the Dialogue System and Quest Machine are both in the May Madness Sale at 50% off. This is one of the Asset Store's two big sales of the year, so make sure you pick up your copy before the sale ends on May 15.
     
  16. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi when I added the new scene where the intro video is located and at first the cutscene plays on the main town scene but when I go to a new scene like the dungeon scene and the tavern scene and goes back to the main town scene, again the cutscene plays. The cutscene has a dialogue system trigger just like what you told me but it this problem occurs only when I added the new scene with the intro video
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @dinaloraven234 - If the cutscene is in the main town scene, then you need to make sure it won't run unless the Dialogue System Trigger's Condition is true. For example, you can use a variable:

    upload_2019-5-8_20-37-26.png
     
  18. jaytwist28

    jaytwist28

    Joined:
    Jul 18, 2017
    Posts:
    50
    Does the integration with opsives Third person controller still work? I got a lot of errors, was curious if the integration was no longer functioning.
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi! The Third Person Controller Support package in the Dialogue System's Third Party Support folder is for Opsive's Third Person Controller version 1.x.

    If you're using Third Person Controller version 2.x (current is 2.1.4), follow the setup steps here:
    If you're using the older, deprecated Third Person Controller version 1.x, you can follow the steps here:
     
  20. jaytwist28

    jaytwist28

    Joined:
    Jul 18, 2017
    Posts:
    50
    So I just need the integration on Opsives side? Not the one that is in the Third Party folder?
     
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    That's correct. I wrote and maintain the integration, even though it's hosted on Opsive's site, so if you have any questions about using it just let me know.
     
  22. jaytwist28

    jaytwist28

    Joined:
    Jul 18, 2017
    Posts:
    50
    It's working fine, thank you. I had imported the old package in addition to the one for UTPC 2 lol. I appreciate the quick help
     
  23. TonyLi

    TonyLi

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

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    AvoCuddle Available to Wishlist on Steam

    If you like platformers with responsive controls and lots of variety in level design, add AvoCuddle to your Steam wishlist. It uses the Dialogue System for Unity to tell a surprisingly touching love story considering that the protagonist is an anthropomorphic avocado. :)



    p.s. - The Dialogue System for Unity is still available for 50% off in the May Madness Sale!
     
  25. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    @TonyLi I decided to try this with Action RPG Starter Kit since I've had that kit for a really long time and wanted to see how they worked together. I noticed one issue. In the demo scene if you die at any time and select retry, you can no longer interact with the Dialogue NPC. Do you know of a way to fix this?
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @magique - In the folder Pixel Crushers / Dialogue System / Third Party Support / Action-RPG Starter Kit Support / Example, inspect the prefab "HeroineC DS". On the Status C component, assign the prefab "HeroineDeathC DS" to the Death Body field.

    (The "HeroineC DS" prefab was pointing to the old HeroineDeathC prefab, which in turn loads the old HeroineC prefab that doesn't have the Dialogue System components.)
     
    magique likes this.
  27. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    49
    Hello, I have a question regarding the Scene Portal component. I followed the tutorial 'Save System', created some scenes (added to Build Settings) with Dialogue Managers that had all the components the tutorial instructs to add (all scenes have the Dialogue Manager with the added components), when I Play the portals work just fine, but when I build and run the exe the portals don't work (it closes the program and I end up back on desktop, no error messages). There no errors in Console relevant to this problem (have errors about Substance but doesn't stop Play from working). Anyone have any insight as to why the Scene Portals would work in Unity Play mode but not once I build the project and run it?
     
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @rlhalh - Something is causing the build to crash when changing scenes. Can you locate the build's output log file? Near the bottom of the log file, does it indicate the issue? Feel free to send a copy of the log file to tony (at) pixelcrushers.com. I'll be happy to take a look.
     
  29. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    49
    Thanks Tony, Output log sent (corrected). I had a look at it but couldn't find anything (I'm relatively new with Unity, wish I could help more).
     
    Last edited: May 10, 2019
  30. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi regarding the cutscene issue I've done like what you instructed me but it seems it only works when the first gameplay scene is the main town scene. If the first gameplay scene is the video scene then cutscene will play again when I go back to the main town scene.
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @dinaloraven234 - Can you provide screenshots of the Dialogue Manager GameObjects in the video scene, the main town scene, and the tavern scene? Please expand the Other Settings section for each.

    Are you using the Dialogue System Saver component?

    You can also send a copy of your project to tony (at) pixelcrushers.com. I'll be happy to take a look directly.
     
  32. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi these are the screenshots of the dialogue manager for the intro scene , main town scene and tavern scene.

    And yes I have a dialogue system saver component on all the dialogue managers in every scene.
     

    Attached Files:

  33. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    49
    UPDATE:

    My Scene Portal component is now working properly. After many suggestions from Tony, the solution that worked was to upgrade my Unity version from 2018.2.2 to 2018.2.21. It seems that 2018.2.2 had a bug (that was corrected in later versions) which generated the following error: Read from location 0000000000000008 caused an access violation. This is what was preventing the Scene Portal component from changing scenes. Many thanks to Tony for helping me with this!
     
    TonyLi likes this.
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @dinaloraven234 - I can't see everything on the Dialogue Managers (some of the components are cut off), but it looks like they may have different components. The important thing to remember is that the Dialogue Manager from IntroScene will override all of the other Dialogue Managers. Think of it almost like the other Dialogue Managers don't exist.

    Please try this:
    1. Back up your project.
    2. Make sure IntroScene's Dialogue Manager has all the components that it's supposed to.
    3. Save IntroScene's Dialogue Manager as a new prefab. (Drag it from the Hierarchy into the Project view).
    4. Open MainTown. Delete its Dialogue Manager. Add an instance of your new Dialogue Manager prefab.
    5. Open Tavern. Delete its Dialogue Manager. Add an instance of your new Dialogue Manager prefab.
    Then try playing from IntroScene.
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    SteamVR Example Scene Available

    The Dialogue System Extras page has a new example scene that demonstrates how to run conversations in VR using SteamVR.
     
    Akshara likes this.
  36. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    @TonyLi I've done what you told me I made a prefab of the dialogue manager from the start scene and replace dialogue managers in every scene with the prefab that I made but still when I go back to the main town scene it still plays the cutscene
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @dinaloraven234 - Are you sure the Condition on the cutscene trigger is configured correctly? Typically the cutscene trigger will set a dialogue database variable such as "PlayedCutscene" to true. The Condition should check that "PlayedCutscene" is not already true.

    Can you send a copy of your project to tony (at) pixelcrushers.com? Or would it help if I put together an example set of scenes for you?
     
  38. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    My project file is over 9gb. Just put together an example scene and I'll know what to do. Anyways thanks for the help
     
  39. mikemuk01

    mikemuk01

    Joined:
    Dec 1, 2016
    Posts:
    53
    I am using the Runic Standard Dialogue UI and it works fine except for 2 things. Firstly the font size is very small. Is there a way of changing the font, and the size? Secondly, the dialogue consists of NPC - Player - click to remove and move on - Second line for NPC - Second line for player. When I click to remove the first 2 lines only the Player line is removed. The first NPC line stays on the screen with the second NPC line beneath it. How can I make sure both of the first 2 lines are removed before the next dialogue section comes on screen?
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @mikemuk01 - Add an instance of the Runic Standard Dialogue UI prefab to the Dialogue Manager's Canvas. This will make it easier for you to customize. Then inspect Dialogue Panel > Main Panel > Scroll Rect > Scroll Content > Subtitle Text. Increase the UI Text component's Font Size. Then do the same for Response Button Container > Response Button Template > Response Text.

    Then you can either assign this customized instance directly to the Dialogue Manager's Dialogue UI field, or save it as a new prefab and assign the prefab to the Dialogue UI field.

    Inspect Subtitle Panel Info, and untick Accumulate Text.
     
  41. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi can you make a set of example scene regarding my problem posted above. I really need it now. Thanks
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @dinaloraven234 - I'm getting to all requests as quickly as I can. Once I get to yours, it shouldn't take me long. I remember that I already sent you a set of scenes with a cutscene. I'll just need to add an IntroScene to the beginning of it.
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @dinaloraven234 - Here's the updated example. I noticed one thing that is probably causing the issue. In the previous example I sent you, the Save System on the Dialogue Manager GameObject was configured to wait 4 frames before applying the saved data:

    upload_2019-5-13_22-1-52.png

    This allows GameObjects in the new scene to initialize before applying saved data changes to them. I tested, and you can get by with waiting just 1 frame, so change Frames To Wait Before Apply Data to 1.

    In the "3 Gameplay A" scene in the previous example, the Intro Cutscene GameObject's Dialogue System Trigger was set to OnStart. This caused it to start immediately. But it really needs to wait at least 1 frame to allow the Save System to apply the saved data (in this case, the value of the "PlayedIntro" variable). The solution is to change the Dialogue System Trigger to OnUse, and configure a Timed Event component to call DialogueSystemTrigger.OnUse after 1+ frames:

    upload_2019-5-13_22-5-8.png

    (In the screenshot above, I left the number of frames to wait at 5 because the Save System was set to wait 4 frames before applying saved data.)

    This way the Save System has a chance to restore the value of the "PlayedIntro" variable before the Dialogue System Trigger checks it.

    An updated example is attached.
     

    Attached Files:

  44. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    Hi @TonyLi

    I bought Dialogue System for Unity, is there support for "google spreadsheet and Unity integration" for it?

    Thanks!
     
  45. mikemuk01

    mikemuk01

    Joined:
    Dec 1, 2016
    Posts:
    53
    Thank you Tony for such a quick and detailed response. It’s working perfectly now.
     
    TonyLi likes this.
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @indieDoroid - Thanks for buying the Dialogue System! While many devs do use Google Sheets (for example, the Crossing Souls team managed their Dialogue System content and translations in Sheets), the Dialogue System doesn't have an integration for that specific asset.
     
  47. mikemuk01

    mikemuk01

    Joined:
    Dec 1, 2016
    Posts:
    53
    Hi Tony. I’ve set up some dialogue which works fine. Then I’ve gone on to follow the quest tutorial, but when the first NPC dialogue line and Player response lines appear, the cursor is locked in the middle of the screen and so I can’t click on the Player response to move the conversation on. How can I resolve this please?
     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    The Dialogue System doesn't lock the cursor. Another asset or script is probably doing that. What other assets/frameworks are you using? Are you using any of the Dialogue System's integrations from the Third Party Support folder?

    You may be able to get it to unlock by ticking the Dialogue System Trigger's Actions > Start Conversation > Show Cursor During Conversation checkbox.

    If that doesn't work, try to identify the script(s), and then use a Dialogue System Events component on the player to disable it during conversations. The second half of the Interaction Tutorial shows the steps.
     
  49. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    @TonyLi I'm working on getting both Invector and ARPGK working together with Dialogue System. I'm using the example NPC from the ARPGK integration scene, but having a couple of issues. I'm not sure if these are even related to Invector or ARPGK. I want navigation to be on when the conversations are active so I clicked Navigation Enabled in the GUIRoot script. I also have Focus First Control On Enable and Jump to Mouse Position checked. Those second two were on by default. I also changed the Click Button to Submit, which equates to the return key.

    The first issue is that when a conversation starts, the conversation items never get focused at all and when I press the arrow keys, nothing happens. If I have the cursor unlocked as well then I can eventually get the cursor to focus a conversation item, but even then the arrow keys don't work. I have an Event System in the scene so navigation should be working.

    Also, when I exit the scene, the following error gets posted to the console:

    NullReferenceException: Object reference not set to an instance of an object
    PixelCrushers.DialogueSystem.UnityGUI.GUIControl.Update () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Legacy/GUI Controls/GUIControl.cs:219)
     
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @magique - If possible, please switch to the Standard Dialogue UI system. GUIRoot is for the legacy OnGUI system that's only still there for compatibility with older projects. It doesn't use Unity UI or an Event System. Try assigning the Basic Standard Dialogue UI prefab to the Dialogue Manager's Dialogue UI field, and tick Input Device Manager > Always Auto Focus. You can customize the UI's appearance later.

    That said, the legacy OnGUI system is still supported. If you want to continue with it, let me know so we can get to the bottom of the issue.