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

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Great stuff. Thanks a bunch.

    Edit:

    Apologies, but I've taken a look at this and I don't understand what you mean by "response button." I don't understand WHERE exactly I should be adding the component to. Should I be adding it to the Dialog Manager in my scene? Should I be adding it to the "response button template" that's within the response panel? Should it be on the Player? I just don't understand where exactly I should be adding this component. And looking at the component, I don't understand how it could know to pick choice 1 unless there's a special GameObject for choice 1 or something. Can you help me out?[/user]
     
    Last edited: Sep 26, 2015
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @EternalAmbiguity - Import this package, and then drag the NumberedResponseUI script into your dialogue UI's Script field: NumberedResponses_2015-09-26.unitypackage

    This package is also on the Extras page. The script is a subclass of UnityUIDialogueUI that adds a key trigger to each response button. It works with instances of the response button template that are created at runtime for each response button.

    For those who are defining response buttons explicitly using the Buttons list (instead of using Response Button Template), you can add key triggers at design time, as you would with a dialogue UI like this:

    In this case, the A, B, X, Y buttons are configured at design time and assigned to the Buttons list instead of creating a single generic response button template.

    For those who don't want to download the package, the code is:
    Code (csharp):
    1. using UnityEngine;
    2.  
    3. namespace PixelCrushers.DialogueSystem {
    4.  
    5.     public class NumberedResponseDialogueUI : UnityUIDialogueUI {
    6.  
    7.         public override void ShowResponses(Subtitle subtitle, Response[] responses, float timeout) {
    8.             base.ShowResponses(subtitle, responses, timeout);
    9.             for (int i = 0; i < dialogue.responseMenu.instantiatedButtons.Count; i++) {
    10.                 var buttonObject = dialogue.responseMenu.instantiatedButtons[i];
    11.                 var keyTrigger = buttonObject.AddComponent<UIButtonKeyTrigger>();
    12.                 keyTrigger.key = (KeyCode) ((int) KeyCode.Alpha1 + i);
    13.                 var text = buttonObject.GetComponentInChildren<UnityEngine.UI.Text>();
    14.                 text.text = (i + 1) + ": " + text.text;
    15.             }
    16.         }
    17.  
    18.     }
    19. }
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Rogo Digital LipSync Support Added



    The Dialogue System for Unity now has support for Rogo Digital's LipSync. You can download the support package from the Dialogue System Extras page. It'll also be included in the next full release.

    Documentation is here: LipSync Support Documentation
     
  4. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Many thanks again.
     
  5. LOLinc

    LOLinc

    Joined:
    Nov 18, 2013
    Posts:
    28
    Hi there!


    I am trying to do something fairly simple, but I cannot get it to work as intended.

    The game I am working on is a Dear Esther-like game: FPS controller, no NPC's, no quests, the only dialogue (monologue really) is that of the narrator. When the player walks around in the environment it triggers some narrator script lines, I want these lines to be supported by subtitles. In the future I would like to be able to queue these script lines too.

    To do this I have set up a trigger box with the "Bark Trigger", "Unity UI Bark", and "Unity UI bark Subtitle Dialogue UI" script attached to it. In my conversation sequence I have "AudioWait(lNameOfVoiceOver)" so that it plays the corresponding voice over along with the subtitle. I have a canvas with a Text element that is linked to the scripts on the triggerbox.
    This works fine, except the subtitle will not disappear after being displayed. I have ticket off "Wait Until Sequence Ends" and set "Duration" to 0 seconds, but no matter what I do the last played subtitle keeps hanging on screen instead of disappearing/fade out.

    I have looked at the bark example scene "Three NPCs Bark", but it seems to use the old GUI system and didn't provide much help.

    Basically, my question is; how do I make the last shown subtitle disappear again?

    Related: The console keeps nagging me about "Reponse buttons need to be assigned" even though I have disabled them, any ideas?
    Thanks for the help


    Cheers!
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @LOLinc. - I think there are a few things going on here. First off, since an example is sometimes worth a thousand words, here's an example scene:

    TestNarrator_2015-09-27.unitypackage

    This scene has some gray trigger boxes. When you step into them, they play barks through a Narrator GameObject that has a bark UI and an AudioSource with pan level set to 0. I used the default Dialogue Manager prefab.

    Now for the thousand words. :)

    There are two ways to trigger dialogue: barks and conversations. Barks are one-off lines that play through bark UIs. Conversations are typically back-and-forth multi-line exchanges, although they can also be single lines. Conversations play through dialogue UIs.

    The example scene above uses Bark Trigger components to trigger barks and play them through a bark UI. Briefly, here's how it's set up:
    • Dialogue Manager: Uses the standard prefab. Assigned a test dialogue database.
    • Narrator GameObject: Has a screen-space bark UI to show subtitles.
    • Bark Triggers: Play barks through the Narrator GameObject.

    You could alternatively use a Conversation Trigger component to trigger a single-line conversation that plays through the dialogue UI. The "Unity UI Bark Subtitle Dialogue UI" further confuses the matter. It's like a regular dialogue UI, except that it redirects subtitles to the speaker's bark UI instead of using the dialogue UI's text element. The Dialogue System always expects a dialogue UI to have one or more response buttons, even if you're never going to use them. If you reassign a button to the Buttons list or the Button Template field, it'll silence that nagging message.

    Since you said you're using Bark Triggers, I recommend setting up a Narrator GameObject like in the example scene. Then assign the Narrator as the Barker in the Bark Trigger. You don't need to do anything with the dialogue UI in this case. If the bark still doesn't disappear at the end, check the animator controller that's assigned to the bark UI. It has a Hide animation clip. This clip should animate the bark UI's Canvas Group > Alpha property to 0.

    I put a Narrator GameObject in the example scene to provide consistent, screen-space subtitles. If you want the subtitles to appear over each trigger in world-space instead, you could add a separate bark UI to each trigger.

    If, instead, you want to use the dialogue UI, use a Conversation Trigger instead of a Bark Trigger. In this case, set the NPC Subtitle Line to appear the way you want the subtitle to look. If you're going to continue using Unity UI Bark Subtitle Dialogue UI, check the bark UI's animator controller as described above.

    If this doesn't help, please feel free to send an example project to tony (at) pixelcrushers.com. I'll be happy to take a look.
     
    hopeful likes this.
  7. LOLinc

    LOLinc

    Joined:
    Nov 18, 2013
    Posts:
    28
    Indeed, an example is worth a thousand words!
    Thank you very much, it helped a lot and I think you should make your example part of the bundled examples :)
    I ended up using your method and made the narrator a child of the Dialogue Manager, so he is automatically loaded in every scene too.
    For some reason my "Bark Trigger" does not save the assigned "Barker" (the Narrator obj) when made into a prefab. Likewise, when my scene is loaded from another scene (using dialogue systems playmaker action), the Barker in non-prefab Bark Triggers is not assigned to the Narrator obj anymore. I am not sure if this is due to Dialogue System or something else though.

    Once again, thank you @TonyLi for your quick reply and solid answer.

    Cheers!
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @LOLinc. - I've included it on the Dialogue System Extras page.

    It sounds like the Narrator / prefab issue is a general Unity reference issue. It'll probably be easier to make the Narrator a separate prefab (not a child of Dialogue Manager) and add an instance to each scene. This way your scene instances of Bark Triggers can reference the scene instance of Narrator.
     
  9. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    I read above that you were considering integration with UniStorm. I own UniStorm, but I would prefer you do an easier integration for Instant Good Day, which I also own and like for its simplicity and ease of use. For that matter, I would like to see integration for Liquidum Pro for weather effects. As a non-programmer, these two assets are far easier to use in my project, as they require less (or no) programming and shader coding/understanding on my part. I would imagine, that if they are easier for me to implement in my game, they should also be easier for you to add third party Dialogue System support. UniStorm is a nice product, but I just don't have the time or resources to bring it to heal. As a final thought, the easier you make it to implement an asset, the more likely we small Indie developers will use it. Just a reality.

    F.Y.I I also own ORK Framework and NJG Mini Map, and will be using them together with Dialogue System if it isn't overly difficult. And I use cInput for my keyboard and mouse, which I have already integrated with ORK Framework.
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @wood333 - Integration with NJG MiniMap and ORK Framework are pretty simple. ORK is perhaps a little more involved because it's such a comprehensive framework, but the Dialogue System ties into it fairly seamlessly.

    UniStorm support will be in the next release. I'll add Instant Good Day to the roadmap for a future release and also consider Liquidum Pro. I haven't really looked at Liquidum Pro yet.
     
  11. markzpot

    markzpot

    Joined:
    Nov 3, 2013
    Posts:
    2
    Hey, thanks for an awesome asset!
    Is there a simple way to not clear the dialogue between each conversation node, so that I could keep a complete log over what has been said during a conversation?

    [Edit] To clarify; What I am trying to do is to append all lines of conversation to a longer UI Text element to have a backtraceable log of what has been said.
     
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @markzpot - Thanks! Yes, add a small script to the Dialogue Manager that has an OnConversationLine method. There's a ConversationLogger.cs script in Scripts/Supplemental/Utility that logs entire conversations to the Console. You can use this as a template to log the same thing to a UI Text element.
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Updated Unity UI Support Package Available

    The Pixel Crushers private customer download site has an updated support package for Unity UI. The updates will also be in version 1.5.6, scheduled for release next week. They address a race condition in show/hide animations when rapidly opening and closing dialogue UIs and quest log windows, and they include some improvements to the typewriter effect. If you'd like access to the site, please PM me your Asset Store invoice number.
     
  14. N.K-K.

    N.K-K.

    Joined:
    May 19, 2015
    Posts:
    3
    I love this asset (certainly one of the best I've bought), but I'm having a strange issue that drives me nuts.

    The dialogue works just fine in the first scene, but it kind of falls apart if I change scenes. It's weird: the dialogue is initiated properly, the typewriter effect works just fine, the continue button is perfectly functional, but when it comes to player's responses, the buttons are non-interactive. It's like one half of the UI works and the other doesn't. The UI is a child of Dialogue Manager that is set to not be destroyed on scene changes.
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @N.K-K. - Thanks! It sounds like you just need to add an EventSystem to the second scene (GameObject > UI > EventSystem). The Dialogue Manager GameObject does you a favor when it starts by checking for an EventSystem and adding one to the initial scene if necessary. But it doesn't carry this EventSystem into subsequent scenes because those scenes may already have an EventSystem. In general you don't want two EventSystems in a scene.

    If you know that your subsequent scenes will not have an EventSystem, you can manually add an EventSystem as a child of the Dialogue Manager. This way it'll carry over into other scenes.
     
  16. N.K-K.

    N.K-K.

    Joined:
    May 19, 2015
    Posts:
    3
    I did exactly that and it worked, thanks.
     
    hopeful likes this.
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Happy to help!
     
  18. hippysniper

    hippysniper

    Joined:
    May 9, 2014
    Posts:
    5
    Hey having a pretty big issue, the system is working fine and one of our team has implemented all the dialog and we are ready to build the project however we keep getting this error??? Assets/Dialoguer/DialogueEditor/Scripts/Objects/DialogueObjects/DialogueEditorPhaseObject.cs(222,32): error CS0103: The name `UnityEditor' does not exist in the current context

    tried everything, we are pretty close to our deadline and just need to build, this is all that is holding us up????
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi - I think you're posting in the wrong thread. This is for Pixel Crushers' Dialogue System for Unity, not Dialoguer.

    That said, try wrapping that script in these lines:
    top:
    Code (csharp):
    1. #if UNITY_EDITOR
    bottom:
    Code (csharp):
    1. #endif
     
    hopeful likes this.
  20. hippysniper

    hippysniper

    Joined:
    May 9, 2014
    Posts:
    5
    will give it a go, weird this is the link for the forum included in the project, will give it a go, thanks

    All good Life saver =). I might clarify what happened, for some reason in the infinite wisdom of our team member responsible for configuring the dialog system, he has imported every dialog system under the sun despite the fact we want to use this great system =). long story short I didn't even notice until you mentioned it and begun the purge.

    Very happy with the dialog system thanks for the help guys!! =)
     
    Last edited: Oct 6, 2015
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Happy to help! I'm glad you're using the Dialogue System for Unity. I'm much better equipped to provide support for it. ;) So if you have any questions, don't hesitate to post here or email me at tony (at) pixelcrushers.com.
     
  22. markzpot

    markzpot

    Joined:
    Nov 3, 2013
    Posts:
    2
    Thanks for the help, it works great! It seems like responses are not reporting to that function though. Is there a way to get responses in a similar fashion or should I create OnClick functions on the response buttons manually?
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @markzpot - This happens because the response isn't considered "spoken" at the point that it's selected from the menu. Here's one way you can get the player to invisibly "speak" the line so it will be reported by OnConversationLine:
    1. On the Dialogue Manager GameObject, tick Display Settings > Subtitle Settings > Show PC Subtitles During Line.
    2. Set Display Settings > Camera Settings > Default Player Sequence to: None()
    If you don't want to do that, you can override your dialogue UI script's OnClick() method:
    Code (csharp):
    1. public class MyDialogueUI : UnityUIDialogueUI {
    2.     public override void OnClick(object data) {
    3.         base.OnClick(data);
    4.         Debug.Log("Player chose: " + (data as Response).formattedText.text);
    5.     }
    6. }
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Dialogue System for Unity 1.5.6-beta1 Available

    Version 1.5.6-beta1 is available on the Pixel Crushers customer download site. (PM me your Asset Store invoice number if you'd like access.) This version is the same as the upcoming 1.5.6 release except with Makinom and UniStorm support as the final touches are put on those integration packages.

    This update also adds support for GameFlow and Rogo LipSync.


    Version 1.5.6-beta1
    Core
    • Changed: Dialogue Manager prefab's new Default Sequence value only delays instead of running camera closeups.
    • Dialogue Editor:
      • Improved: Alt+LMB now drags canvas same as middle mouse button.
      • Fixed: Canvas dragging didn't work immediately after dragging a node offscreen.
    • Triggers:
      • Improved: Dialogue System Trigger can now specify alert duration.
      • Improved: If Selector is set to mouse select and pointer is over a UI element, it won't select usables underneath.
    • Unity UI:
      • Improved: Always adds an EventSystem to the scene if needed, even after changing scenes.
      • Improved: Quest Log Windows and Quest Tracker HUDs now allow alternate styles for success and failure states.
      • Improved: Unity UI typewriter effect audio improvements; no longer pauses on rich text codes.
      • Fixed: Resolved race condition in Show & Hide animations when rapidly showing and hiding windows.
      • Fixed: Runic & Generic prefabs allowed name field to be resized too small.
    • Legacy Unity GUI: Letterbox prefab layout now handles multi-line subtitles.
    • Improved: CSV Export now imports and exports portraits properly; can now import CSV into existing databases.
    • Improved: Voiceover Export now includes localization fields.
    • Improved: Localization can now use the default language if a localized field is blank. Added Localization.UseDefaultIfUndefined property.
    Third Party Support
    • articy:draft:
      • Improved: Can now handle custom quest field titles that normally have space characters (e.g., "Success Description").
      • Improved: Can now define quest states using a dropdown (or continue to use string as before).
    • GameFlow support: Added.
    • Rogo Lipsync support: Added.
    • plyGame: Updated for Unity 5.x compatibility.


    Coming in 1.5.7 (after the upcoming 1.5.6 release): Groupings for quests (e.g., main quests vs. side quests, or quests grouped by village).
     
  25. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    What's this?
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Currently the quest log window and quest tracker HUD show all quests alphabetically in one big group. You can kind of organize them by adding a category to the beginning of the quest title, such as:
    • "Mars: Find Kuato"
    • "Mars: Rescue Matt Damon"
    • "Pluto: Planet, Dog, or Dwarf"
    • "Pluto: Get a Winter Coat"
    • "Saturn: etc."

    In 1.5.7, you'll be able to set a Group field such as "Mars" to each quest. Then all quests with this Group field will be grouped under a single, collapsible "Mars" heading:
    • Mars
      • Find Kuato
      • Rescue Matt Damon
    Technically the dialogue database supports this right now with custom fields, but you need to make custom subclasses of the quest log window and quest tracker classes to implement the grouping yourself. In 1.5.7, the functionality will be built in.

    However, development on 1.5.7 won't begin until Quest Machine is out the door. That's my next major development push.
     
  27. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    Oh no ... it's waiting on Quest Machine ...! ;)

    (I'm looking forward to anything related to quests.)
     
    Last edited: Oct 7, 2015
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Dialogue System for Unity 1.5.6 Released!

    Version 1.5.6 is now available on the Pixel Crushers customer download site. PM me your Asset Store invoice number if you need access. It should be on the Asset Store in a few days!

    This update features several improvements to the core engine, Unity UI support, articy:draft and CSV importers, and new support for GameFlow, Makinom, Rogo LipSync, and UniStorm.


    Version 1.5.6
    Core

    • Changed: Dialogue Manager prefab's new Default Sequence value only delays instead of running camera closeups.
    • Dialogue Editor
      • Improved: Alt+LMB now drags canvas same as middle mouse button.
      • Fixed: Canvas dragging didn't work immediately after dragging a node offscreen.
    • Triggers:
      • Improved: Dialogue System Trigger can now specify alert duration.
      • Improved: If Selector is set to mouse select and pointer is over a UI element, it won't select usables underneath.
    • Unity UI:
      • Improved: Always adds an EventSystem to the scene if needed, even after changing scenes.
      • Improved: Quest Log Windows and Quest Tracker HUDs now allow alternate styles for success and failure states.
      • Improved: Unity UI typewriter effect audio improvements; no longer pauses on rich text codes.
      • Fixed: Resolved race condition in Show & Hide animations when rapidly showing and hiding windows.
      • Fixed: Runic & Generic prefabs allowed name field to be resized too small.
    • Legacy Unity GUI: Letterbox prefab layout now handles multi-line subtitles.
    • Improved: CSV Export now imports and exports portraits properly; can now import CSV into existing databases.
    • Improved: Voiceover Export now includes localization fields.
    • Improved: Localization can now use the default language if a localized field is blank. Added Localization.UseDefaultIfUndefined property.
    • Improved: [ConversationPopup] and [QuestPopup] attributes now accept optional bool to show reference database field.
    Third Party Support
    • Adventure Creator: Lua action now properly updates alert messages and quest tracker HUDs in children of Dialogue Manager.
    • articy:draft:
      • Improved: Can now handle custom quest field titles that normally have space characters (e.g., "Success Description").
      • Improved: Can now define quest states using a dropdown (or continue to use string as before).
    • GameFlow support: Added.
    • Makinom support: Added.
    • ORK Framework support: Added Show Alert and Play Sequence events.
    • Rogo Lipsync support: Added.
    • plyGame: Updated for Unity 5.x compatibility.
    • UniStorm support: Added.
     
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Love/Hate 50% Discount for Dialogue System for Unity Customers

    Starting tomorrow, if you've already bought the Dialogue System for Unity, you should be able to buy Love/Hate at a 50% discount. (If it doesn't work tomorrow, give it a couple days to take effect.)
     
  30. escooler

    escooler

    Joined:
    Sep 15, 2015
    Posts:
    5
    Thought I would post up a question I have been grappling with, been searching around a bit and could not find an answer, till getting to grips with Dialogue system. But been pretty blown away with how I am getting it to talk to playmaker.

    Anyway, to the question - I have a simple UI, that shows the NCP subsitle line then pops on the responce buttons below. The only problem i ma having is, the responce buttons are showing up a little slow for my tastes - theres like a second or half a second before they appear. Is there a control for this somewhere in the system? Its fine on longer passages, as players need to read, but on yes or nos, it might get a little frustrating. Its also slowing me down in my testing processes.

    Also while we are here, another less urgent question. I basically adapted the UI from one of the prefabs, and in this case the main text dialogue box fades up, but the response jsut appear, its a little jaring, I was wondering how to apply a simler effect to the responce menus. I see that some kind of animation controller seems to control a pannel, but I could not make head nor tale of it.

    All the best, and super thanks (sorry for been a bit of a lemon).
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @escooler - Set the Dialogue Manager's Display Settings > Camera Settings > Default Sequence to: None()

    By default, the subtitles delay for the duration of its sequence. If the dialogue entry node's Sequence field is blank, it uses the Dialogue Manager's Default Sequence. The initial value of the Default Sequence waits for an amount of time based on the length of the subtitle. By setting the Default Sequence to None(), it doesn't wait at all.

    If you simply want to speed up the delay, tweak the Dialogue Manager's Display Settings > Subtitle Settings > Subtitle Chars Per Second and Min Subtitle Seconds. You may also need to speed up the typewriter effect, which is on the corresponding UI Text element.

    Add another Animator component to the Response Panel. Assign an Animator Controller asset (Mecanim state machine) that animates it when it starts. (When the Dialogue System shows a response menu, it enables the Response Panel GameObject, which re-enables the Animator component. When an Animator component is re-enabled, it resets itself.)
     
  32. escooler

    escooler

    Joined:
    Sep 15, 2015
    Posts:
    5
    Hey, thanks alot for taking the time to write a responce. Fiddling with the timings worked a treat. I dont know enough about the internal animation system in unity yet, to fully implement your 2nd point, you you have set me on the right path, thats less urgent for where i am int he project. So will do some further poking around, until I get somthing working.

    Thanks again.

    Adam
     
  33. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    I had high hopes for this Dialogue asset. VERY confusing. What exactly do I need to do across all components to get this to properly work with UFPS? If I follow a UFPS-specific tutorial, (I found ONE) I can replicate the tutorial quest system. Perfect. THERE ARE NOT ENOUGH UFPS TUTORIALS!

    When I try to follow a generic tutorial, the frickin' menus don't freeze play completely, my first mouse click fires a shot (1/2 way), and the mouse gets disabled! Can't select the damn buttons!!

    And why are the tools spread out across multiple menu-bar items? Why are some in Window, some in Components, and some you have to hunt for in the hierarchy? C'mon, why can't the product prompt me for UFPS once, and offer modules, scripts, etc that work in the environment that I am using?

    Seriously, this asset is a couple years old. Should be further along...
    Mark
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Mad_Mark - I'm sorry for the frustration. I'm looking into this right now, and I'll post a more detailed reply in a few minutes.
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    @Mad_Mark - The steps in the documentation are correct, but we agreed that they're tedious to add, which is why version 1.5.6.1's updated UFPS Support package has an "Add All Player Scripts" menu item that auto-configures the player. I also had to update the example scene to accommodate changes in the UFPS version that was released after 1.5.5.1 was published.

    Version 1.5.6.1 isn't available on the Unity Asset Store yet. (It takes Unity several days to get it onto the store.)

    You can download the 1.5.6.1 version of the UFPS Support package here: UFPS_Support_1_5_6_1.unitypackage

    It's also on the Dialogue System Extras page.

    After importing it, just add a UFPS player prefab to your scene, and then select menu item: Component > Dialogue System > Third Party > UFPS > Add All Player Scripts.

    I perhaps jumped the gun since it's not the Asset Store yet, but I posted the updated UFPS Support documentation in the online manual: UFPS Support Documentation.

    Regarding the menu items, if it helps you find things, they're organized the Unity preferred way -- menu items that create GameObjects are in the GameObject menu; menu items that add components are in the Component menu, and menu items that open special editor windows are in the Window menu.

    I'll also PM you your access info to the Pixel Crushers customer download site in case you'd like to download 1.5.6.1 before it's available on the Asset Store.

    I hear your frustration. If there's anything I can do to help, please let me know. You can post here, PM, or email me directly at tony (at) pixelcrushers.com any time.
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @escooler - Sorry, I don't know how this slipped my mind, but you can already animate the subtitle and response menu panels. You don't have to go through the steps I outlined in my previous reply. It's much easier:

    1. Add a Canvas Group to the response panel.
    2. Add an Animator component to the response panel. Assign Prefabs/Unity UI Prefabs/Animation/Canvas Group Animator Controller to it.
    3. On the main dialogue UI component, expand Response Menu > Animation Transitions. Set the triggers to "Show" and "Hide.
    This will make the response panel fade in and out. You can do the same for any of the subtitle panels, too. If you want it to do something different, like slide in from a screen edge, you can assign a different animator controller with different animation clips. Unity covers creating animator controllers and animation clips in their animation tutorials.
     
  37. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    Versioning and documentation will always get me. Sorry for the miserable tone. Couple of days spent banging away at this, and made no real progress. Time for a clean new level, and another stab at it in the morning.

    Mark
     
  38. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Hey there, I was just getting a chance to try out the numbered system, but it's not working.

    I've assigned that script to the "Generic Unity UI Dialog UI" GameObject, and copied over all the settings from the "Unity UI Dialog UI" Component, as well as disabled that component, but no numbers are appearing.

    I suspect I'm supposed to assign those keys somewhere, but I'll be honest I have no idea where I would do that. I see the "Response Button Template" GameObject in the scene, but that doesn't have a clear area where I can define a key for each numbered response. Can you help me out?
     
  39. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    It's much easier than that. Just one step:



    The script automatically adds a number to each button's text and binds the appropriate input key:



    In the screenshot above, it added "1:", "2:", and "3:" to the button texts and bound them to the 1, 2, and 3 keys.

    This only applies to instantiated buttons:



    Some UI designs don't use instantiated buttons, such as the Wheel below:



    Instead, all six buttons are defined at design time and added to the Buttons list. To assign keys to them, you add a UI Button Key Trigger component to each UI button, and then assign a key and/or input button. Using this component, you can also assign gamepad input buttons. For example, to recreate the UI below, you'd define four UI buttons A, B, X, and Y at design time and use UI Button Key Trigger component to assign them to the gamepad input buttons A, B, X, and Y:

     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    No worries! Hopefully the version 1.5.6.1 package will do the trick and allow you to set up your player with a single menu selection. If you run into any issues, don't hesitate to contact me. I'm almost always online (minus sleep until I figure out how to rest half my brain at a time like a dolphin ;)).
     
    hopeful likes this.
  41. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Aha. I'll try that when I can. Thanks for the help.

    Edit: Just tried it and it works perfectly. Many thanks.
     
    Last edited: Oct 12, 2015
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Happy to help! You can change the last line of code in the script if you want to format the text differently, such as "1. Choice" instead of "1: Choice".
     
  43. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Alright, gotcha. I'll probably do that.
     
  44. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    I'm finding that the simple Quests that I am trying to test with are somewhat repetitive. (By design) Is there anyway to duplicate the 1st 3 that I have made, so that all I have to do is adjust the internal variables rather than type the whole thing over and over?
    Quest1 - Collect < I > items.
    Quest2 - Make < K > kills.
    Quest3 - Bring < X > to < Y >.

    Mark
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi Mark - Yes, expand the All Fields section in the original quest and click Copy. Then expand All Fields in the new quest and click Paste.



    It sounds like you've already handled variables, but in case anyone is wondering, you can use [var=varName] tags in your Description and Entry # text fields. There's also an equivalent [lua(code)] tag for more complex expressions. The Quest Example's "Thin the Ranks" quest uses a counter like this:

    [var=Kills] of 5 killed​

    or equivalently:​

    [lua(Variable["Kills"])] of 5 killed​
     
  46. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Another minor thing. How would I prevent the system from grabbing keystrokes to WS and Up/Down? I want it to just be the number keys.
     
  47. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    Awesome. Didn't even notice those 2 great big buttons. I've got to say, this is one kick-butt asset.
    A few more questions:
    1) How do I get an NPC to give out more than one Quest? I pulled in Private Hart, and set up my 3 Quests. I worked out the bugs on the first one, and managed to get him a pistol (not real original, but it works) and return it to him. Now every time I return to get the next quest, he just thanks me, from the 1st Quest. How do I get him to ask for the next task? (and eliminate the "Conversation triggered an AI, but another conversation is active." warnings?)
    2) When I start a conversation, I now have mouse control and the responses work. Coming out of convo, or menu, I can move forward and back, but no mouse control until I either shoot or aim. What did I break now?
    3) When I enter conversations, I go into trippy 1st AND 3rd player view. I see my weapon/arms, and I see my 3rd person character float into camera view as if I hit the "V" key in UFPS. How do I stop that?

    Thanks Tony,
    Mark
     
  48. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    ERK! So I setup a capsule as a Quest trigger on enter to launch the second quest, Kill 5. Finally worked out the kinks, like UFPS not liking the Damage method, etc. (Still pops an error, but works) Killing cubes increments the Kill variable, but the Quest Tracker doesn't display it screen (just 0 of 5) and even after killing 5 dangerous looking cubes, it doesn't end the quest. If I have no NPC to return to, should this refer to "Item" instead of "Quest" in all the lua code?

    For now I set up a second trigger and set its conditions to match those in the conversation. Workaround...

    https://onedrive.live.com/redir?resid=A9EE87E68033BEB9!9904&authkey=!AJe-u7o4edkeojo&v=3&ithint=photo,PNG
     
    Last edited: Oct 13, 2015
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @EternalAmbiguity - Unity UI handles this independently of the Dialogue System. Try this:
    1. On the dialogue UI , UNtick Auto Focus.
    2. On the response buttons (or the template button if you're using that method), set Navigation to None.
    Hi @Mad_Mark - Thanks!
    There are two ways:
    1. If you want your NPC to have one big conversation, use the Conditions field to branch to topics/quests based on the current quest states. You're already branching on the state of the first quest, so it would be more of the same. You can also link dialogue entry nodes to different conversations; your trigger could start a "hub" conversation" that branches to different conversations based on quest states.

    2. Or add multiple triggers to your NPC, each starting a different conversation, one per quest. Use the Condition section of each trigger to specify which . Define the conditions so that only one trigger's Condition will be true at a time. For example:
      • Trigger 1: [Condition: Quest 1 is not successful] Start Quest 1 Conversation
      • Trigger 2: [Condition: Quest 1 is successful AND Quest 2 is not successful] Start Quest 2 Conversation
      • etc.
    I prefer #1 because it keeps all the logic in the dialogue database. But either way is fine.

    For the "Conversation triggered on AI, but another conversation is active" warning, try setting the trigger's Condition > Accepted Tags to "Player". This warning is harmless; it usually occurs when using the OnTriggerEnter trigger type. If your player GameObject has multiple colliders, then when the player enters the trigger, each collider will send "OnTriggerEnter" to the NPC. You can use the Condition section to only allow the intended collider to fire the trigger.

    I'll take a look at this. I suspect UFPS broke something, not you. It's a constant game of catch-up with third party support, and UFPS has been going through a lot of changes as they've been rewriting it to support multiplayer.

    On the Dialogue Manager GameObject, try setting Display Settings > Camera Settings > Default Sequence to:

    Delay({{end}})

    Every dialogue entry node has a field named Sequence that can play cutscene sequences such as lipsync or camerawork. If the Sequence field is left blank, the node will use the Dialogue Manager's Default Sequence. In the very latest version, this was changed to Delay({{end}}) as shown above, which simply delays for a duration based on the length of the text. In earlier versions, the Default Sequence did camera closeups of the participants. I suspect that's what's happening in your case. (BTW, if you want to immediately progress to the response menu without any delay, set the Default Sequence to None().)

    The Damage thing is another change to UFPS; they changed the API. I just discovered this when working on Emerald AI integration. I'll have to update the UFPS support scripts to handle this more gracefully.

    Strange that the numbers are different on the quest tracker HUD and in the quest log window. Would you please import the updated quest tracker HUD script from the Dialogue System Extras page? (It's the second button down.) The quest tracker HUD was revamped in the latest version to support more customization options, and there was a bug in formatting variables.

    The Dialogue System doesn't automatically detect when a quest's requirements have been met, since this depends on the design of your game and the quest. Here are the most common ways quests are updated or marked as done:
    1. Most quests are "completed" during conversations, so the conversation checks the requirements.

    2. Or add another script (or PlayMaker FSM, etc.) to the cube. In this script/FSM, check the quest conditions and update the quest if appropriate. An easy way to check the quest is to add a Quest Trigger to the GameObject. Set the trigger type to OnUse. In your script/FSM, call the Quest Trigger's OnUse() method, for example by sending the message "OnUse" to it. As long as the GameObject doesn't have a Usable component, then only way it will receive an "OnUse" message is from your script/FSM.

    3. Or use a Condition Observer. This is a polling technique; it checks conditions on a regular frequency (e.g., once per second) and takes actions -- such as updating a quest -- when the conditions are true. Since it polls constantly, it's not the most efficient approach. But it's sometimes the best approach for certain situations. You can optimize it by activating the Condition Observer only when starting the quest and then deactivating it when the quest is done. This way it's only polling when needed.
     
  50. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Looks like just the auto-focus part did it. Thanks!

    Edit: I was just taking a look at the GoTo Sequencer command. Do you think you could describe precisely what to do with that? I imported the package, which added a script to my Dialog Manager folder, and added a scene to the Test folder. I then went to the appropriate dialog entry and put, as a response sequence, "GotoEntry(17)@5." Then, when running the scene, the initial entry shows for five seconds, but I don't have any dialog choices during that time. It just skips to the next, 17 in this case. Any idea what I'm doing wrong?
     
    Last edited: Oct 13, 2015