Search Unity

[70% OFF - FLASH DEAL] 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,706
    Dialogue System for Unity 1.6.6.2 Released!

    Version 1.6.6.2 is now available on the Pixel Crushers customer download site. (PM me your Asset Store invoice number if you'd like access.) It should be available on the Asset Store in 5-7 days.

    This is a maintenance release to address a few issues, in particular superficial editor window error messages in Unity 5.4. The next major release (which is a way off) should introduce the ability to import Twine and/or Ink.


    Version 1.6.6.2
    Core

    • Fixed: Custom editor window error messages in Unity 5.4.
    • CSV Import/Export: Now preserves variable types and node editor canvas positions.
    • Quest Example: Updated to use CurrentQuestState() and SetQuestState() functions.
    Third Party Support
    • Aurora (NWN) Converter:
      • Improved: Optional alternate search folder for NWN XML files.
      • Improved: Added button to run all profiles in folder.
      • Fixed: Loading of saved profiles was broken.
    • RPG Kit: Updated for RPG Kit 3.1.4 compatibility.
     
    Corvwyn and hopeful like this.
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Updated RPG Kit 3.1.4 Support Package Available

    The Dialogue System Extras page has an updated support package for Unitycoding's RPG Kit 3.1.4+ that:
    • Updates the HasItem(), AddItem(), and RemoveItem() Lua functions to work with RPG Kit 3.1.4.
    • Reconnects missing textures in the Dialogue System UIs to use the new GUIDs in 3.1.4.
    • Adds small visual improvements to the UIs to make them consistent with RPG Kit's UIs.
    (The package on the Extras page supercedes the one in version 1.6.6.2, since 1.6.6.2 was submitted before this update.)
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    The Dialogue System for Unity 1.6.6.2 is now available on the Asset Store! (The release notes are here.)
     
  4. breakspirit

    breakspirit

    Joined:
    Aug 11, 2013
    Posts:
    30
    Hello, I have a quick question. If I have 2 nodes in a conversation, like this...

    and both nodes are Normal priority, shouldn't the system be randomly selecting one each time I talk to that NPC?
    Right now, he always says 1 and never says 2 when I talk to him. How can I get it to randomly pick from the nodes?
    Thanks.
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @breakspirit - When more than one NPC entry is valid, the Dialogue System always chooses the first one. You can view and change the order by inspecting the origin node (e.g., <START> in your screenshot).

    If you want random selection, here are two ways:


    Random text, both ending up down the same path:
    Use the RandomElement() function:
    • Player: <START>
      • Cedric: [lua( RandomElement("1|2") )]
        • (the followup entry...)

    Random paths:
    Use the Script field to set a variable to a random value. Then use the Conditions fields to branch on that value. Since the Dialogue System evaluates one level ahead, you need an empty node between them:
    • Player: <START> { Script: x=math.random(2) }
      • Player:{ Sequence: None() } <-- Empty node to delay evaluation of Conditions.
        • Cedric: 1 { Conditions: x==1 }
          • (followup entry for 1...)
        • Cedric: 2 { Conditions: x==2 }
          • (followup entry for 2...)
     
    BackwoodsGaming and breakspirit like this.
  6. breakspirit

    breakspirit

    Joined:
    Aug 11, 2013
    Posts:
    30
    That works perfectly, thanks!
     
    TonyLi likes this.
  7. Le-nain

    Le-nain

    Joined:
    Nov 26, 2012
    Posts:
    62
    Hey @TonyLi

    I just started discovering the possibilities offered by your Dialogue System this week (I've had a lot of reading!) and I want to congratulate you, this asset definitely is a must have. Quite hard to approach/setup at first, but really worth it afterwards!

    I have a question/request concerning Custom Field types one can add to the system.
    I did create my own custom type in order to be able to (mostly) display a couple of variables in a more convenient way for my game designer, using the CustomTypeTemplate provided. I managed to get everything working from display to chained string storage, I added them to my Dialogue Entry template, but I'm a bit puzzled by one last thing now that I try to use them:
    Whenever I add a new Node/Dialogue Entry to my Conversation, my custom type is stored/displayed as plain Text!
    This is really annoying, as the point of me creating this type was to remove unnecessary steps for my GD, but if he has to either re-set manually the type of these variables for every single Node he creates or not be able to use the custom drawer, it's really not worth it...
    I dug a bit in the source code, and noticed that Custom Types have a storeAsType automatically set to Text, and thought maybe I could change that, but I don't think so as the enum is sealed, and anyways it's probabyl on purpose that you guys store it as a string to be able to parse it.

    Screenshot of my template, where one can see my custom types CharacterInfo and ImageInfo



    Screenshot of a newly created node, where one can see my custom types have to be set manually again


    Is it me being stupid and not seeing what's in front of my eyes, or is it actually an error/mistake? (And if so, a fixable one?)

    Thanks a lot for your answer!
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @Le-nain - Argh, that's a bug. Sorry about that, and thank you for reporting it. I'll try to make a patch available by Monday.
     
  9. Le-nain

    Le-nain

    Joined:
    Nov 26, 2012
    Posts:
    62
    Good to know! Thanks for the responsiveness!
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @Le-nain - The patch is available now on the Pixel Crushers customer download site. If you don't already have access, please PM me your Unity Asset Store invoice number so I can set up your access.
     
  11. Le-nain

    Le-nain

    Joined:
    Nov 26, 2012
    Posts:
    62
    Indeed, no access yet. I'll be able to send you this invoice on Tuesday (next Monday is bank holiday here ;) ).
     
    TonyLi likes this.
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    BackwoodsGaming and EvilGremlin like this.
  13. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Hi @TonyLi, probably the wrong forum but how is the quest system going?
     
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    It's still coming along. I'll start a WIP thread (and post the link here) after I get the demo scene art in place. I've also added to you the beta test list if you'd like to give it a pre-release spin when the beta is ready.
     
    BackwoodsGaming and hopeful like this.
  15. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    That would be great! Thanks!
     
  16. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    If I want to track what lines of dialogue an NPC has already spoken so future conversations show different branches of dialogue- am I supposed to use variables or quests to track that?

    I'm currently using variables and it works well- If I have one database with multiple characters- whats the best way to track where they are in their conversations? A unique local var for each one?

    Would appreciate any guidance on the matter :) Thanks.
     
    Last edited: Aug 19, 2016
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @mdotstrange - Variables (and/or quest states) are a good solution if you want to check only at specific branches. Use the Script field to set variables, and the Conditions field to check them. I'll sometimes include the actor's name in the variable name to help distinguish them, such as "Dancer_GaveAlibi", "Widow_AcceptedJob", "Bookie_GotNumbers", etc. Then you can use them like this:

    Dancer conversation:
    • Dancer: "What can I do for ya, detective?"
      • Player: "Where were you on Saturday night?"
        Conditions: Variable["Dancer_GaveAlibi"] == false
        • Dancer: "Right here on this stage until dawn." [END]
          Script: Variable["Dancer_GaveAlibi"] = true
      • Player: "You said you were here until dawn. Then who made a call from your apartment at 9PM?"
        Conditions: Variable["Dancer_GaveAlibi"] == true
        • Dancer: "My cousin's staying with me for the week. What's it to ya?"

    If you want to track the status of every dialogue entry, inspect your Dialogue Manager and tick Include SimStatus. This uses about 20 bytes per dialogue entry, so if you have tens of thousands of lines of dialogue you probably don't want to tick this unless you really need it. This adds a string value Dialog[#].SimStatus for every dialogue entry, where # is the dialogue entry's ID number. (You can find the ID number by inspecting the dialogue entry.) The possible values of SimStatus are:
    • "Untouched": Entry has never been spoken or shown in a player response menu.
    • "WasOffered": Shown in a player response menu but not selected by player.
    • "WasDisplayed": Spoken (by a player or NPC).

    You can use it like this:

    Dancer conversation:
    • [1] Dancer: "What can I do for ya, detective?"
      • [2] Player: "Where were you on Saturday night?"
        Conditions: Dialog[3].SimStatus == "Untouched"
        • [3] Dancer: "Right here on this stage until dawn." [END]
      • [4] Player: "You said you were here until dawn. Who made a call from your apartment at 9PM?"
        Conditions: Dialog[3]SimStatus == "WasDisplayed"
        • [5] Dancer: "My cousin's staying with me for the week. What's it to ya?"
     
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    If you decide to use SimStatus, on the Dialogue Manager's Input Settings there's a dropdown Em Tag for Old Responses. You can change this from None to apply an emphasis tag to player response entries that the player has already selected. Some games use this to remind players what responses they've already tried.
     
    imaginationrabbit likes this.
  19. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Thank you so much for the detailed response- I have a better understanding now- thank you.
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Happy to help! :)
     
  21. Le-nain

    Le-nain

    Joined:
    Nov 26, 2012
    Posts:
    62
    The more I read the more I like the plugin :p
    By the way, since you're around, I have a small question for "ease of use":
    At first I wanted to use one of your higher levels templates (implementing IDialogueUI) but my needs differ too much from the common ones fitting this template so I dropped it and went for the lower level and doing everything myself listening to the OnConversationXXX events.
    Since I don't use the IDialogueUI anymore, I'd like to drop the implementation completely (less clutter in my code), but I noticed that if I removed it, then DialogueSystem Manager would instantiate the default UI since no implementation was given. Is there a way to just tell it to not instantiate anything at all and trust me, or not?

    Thanks.
     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Sorry, the Dialogue System assumes something implements IDialogueUI. Although it's admittedly an extra script, you can assign an empty stub implementation. Just copy Scripts/Templates/TemplateDialogueUI.cs.
     
    alexhapki likes this.
  23. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    I just downloaded 1.6.6.2, and for some reason when I scroll with my mouse it changes the zoom, rather than going up or down. How do I get it to scroll again instead?

    Additionally, you may or may not remember but I requested a method to have NPC dialog automatically move along if there's no player input, and you came up with the GotoEntry thing. However, this doesn't seem to be working for me. See the attached image.
    DialogExample.png
    Even when I use that, it doesn't work. Please note, I DO have the "select response 1 after X seconds" thing enabled, but that's set to 10 seconds (longer than the 5 seconds shown) so I don't know that it would interfere. Additionally, do you have any idea why that dialog option is red? It isn't the last one or anything so I don't understand why it would be that color.

    Additionally, I apologize if this is a rudimentary question, but I want to have flags fire off if certain options are chosen. Like, for the "I don't want to be here" [END] option on the right there, I want a flag that says the player refused the cooperate ([REFUSED]). Would I create a boolean variable and set it to true? Then in the next conversation, predicate a dialog choice on that? Additionally, I want to do something similar if the player just leaves the conversation area. Like, say:

    [Conversation trigger sphere=15] NPC: You saw all my signs, I assume--
    *Player walks away*
    [PLAYER WALKED AWAY] = true
    [Conversation trigger sphere = 25 && [PLAYER WALKED AWAY] == true] NPC: Hey! Don't just leave while I'm talking, that's rude!

    Is that possible?
     
  24. Le-nain

    Le-nain

    Joined:
    Nov 26, 2012
    Posts:
    62
    Yeah no worries, that's what I currently have :) Thanks.
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @EternalAmbiguity - Since the scroll wheel now controls zooming (which was a highly requested feature), you can still move the canvas by dragging with the middle mouse button or, if you don't have a middle mouse button, Alt + left mouse button. You can also click the padlock at the top of the canvas to lock and unlock zooming.

    I suspect the red node indicates the issue. The red indicates that there are no links to the entry. Unless you have another GotoEntry that gets the conversation to the "I have something for you..." entry, it won't be able to get there. Compare the example conversation in Test/Test GotoEntry that's included in the GotoEntry package. You might see a difference that will help you pinpoint the issue.

    Yes, exactly, in the Script field. You can also use the ShowAlert() Lua function to show a Telltale-style "NPC will remember that" message:

    Script:
    Variable["Refused"] = true;
    ShowAlert("Fred will remember that you refused to cooperate.")

    (You can use the point-and-click Lua wizard to fill in the Script field. You don't have to type it manually.)

    In another conversation (or later in the same conversation), you can use the Conditions field to check the variable:
    • [0] START
      • [1] Wilma: "Hi! What can I do for you?"
        • etc.
      • [2] Wilma: "If you won't cooperate with Fred, we won't help you." [END]
        Conditions: Variable["Refused"] == true
        Priority: AboveNormal
    In the example above, the START entry links to two entries. The second entry ([2]) has a higher priority, so the Dialogue System will check it first. If its Conditions are true (i.e., Refused), the Dialogue System will use it. Otherwise it'll go with the other entry. If you don't want to use priorities, you can just add a condition Variable["Refused"] == false to the other entry instead.

    If you check variables in the same conversation, see the note here about not checking immediately after setting the variable. Since the Dialogue System evaluates one level ahead, you need at least one extra entry between the Script and Conditions.

    Yes. Here's one way to do it without scripting.
    1. Set up a trigger collider on the NPC.

    2. On the NPC's Conversation Trigger, tick Stop On Trigger Exit.

    3. In your dialogue database, create a new Boolean variable named "PlayerWalkedAway".

    4. Edit the NPC's conversation.
      • In the START entry's Script field, set PlayerWalkedAway to true.
      • In all final entries (any entry that ends the conversation), set PlayerWalkedAway to false.
    5. Create a new conversation (e.g., titled "Player Walked Away Bark") with the entry "Hey! Don't just leave while I'm talking, that's rude!"

    6. Add a Bark On Dialogue Event to the NPC.
      • Set the Trigger to OnConversation.
      • Expand On End and set Size to 1. Then expand the new element.
        • Set the Conversation to "Player Walked Away Bark".
        • Set the Condition > Lua Conditions to Variable["PlayerWalkedAway"] == true
    7. Add a bark UI to the NPC.

    How it works:
    • When the player starts the conversation, it sets PlayerWalkedAway to true.
    • If the player reaches the end of the conversation normally, it sets PlayerWalkedAway to false.
    • However, if the player exits the trigger area before reaching the end, the conversation will never get to an entry that sets PlayerWalkedAway to false, so the variable will be left true.
    • The Bark On Dialogue Event component checks the value of PlayerWalkedAway. If it's true, it makes the NPC bark the "Hey! Don't just leave..." line through the NPC's bark UI.

    If you get stuck on any of this, including working with GotoEntry(), please feel free to send an example project to tony (at) pixelcrushers.com and let me know what version of Unity to use. I'll be happy to take a look.
     
  26. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Good to know, thanks.


    Odd...when I try running the "Test GotoEntry" scene, I get this error:

    Dialogue System: Can't find any built-in sequencer command named GotoEntry() or a sequencer command component named SequencerCommandGotoEntry()
    UnityEngine.Debug:LogWarning(Object)
    PixelCrushers.DialogueSystem.Sequencer:ActivateCommand(String, String, String[])
    PixelCrushers.DialogueSystem.Sequencer:CheckQueuedCommands()
    PixelCrushers.DialogueSystem.Sequencer:Update()

    And I wasn't paying attention, because I get the same error on my own scene too.

    Also good to know. Thanks.
     
  27. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Sounds like your project is missing the file SequencerCommandGotoEntry.cs. Try reimporting it from the GotoEntry_SequencerCommand unitypackage that you downloaded from the Extras page.
     
  28. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    I reimported and it's working. Thanks a bunch for the help.
     
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Happy to help! In retrospect it might not have been the best idea for me to put the file in the Dialogue System's Scripts/Supplemental folder because it can get deleted if you delete the Dialogue System folder and reimport it from the Asset Store to get a "clean start" for any reason. Newer extras have been placed in the Dialogue System Extras folder to avoid this issue.
     
  30. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    That's probably exactly what happened, but no biggie--now I know what to do.

    I apologize if I asked this before (I'll have to go back and look at the big post where I asked a bunch of questions, and you answered them), but I want the player to be able to use the mouse wheel to scroll through options, and then select one with Q (in addition to the numbered responses). To do this requires two things as I see it: First, to have one of the conversation options be automatically selected, and second, to allow the mouse wheel to scroll through them (I'm certain you already mentioned how to set a new button to select a dialog option, so I'm not worried about that). Can you tell me if this is possible?
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Sure. Use Unity UI. It's easiest to set up.

    For the "Q" part, select Edit > Project Settings > Input. Change the Submit entry's Positive Button to Q, or add another Submit entry whose Positive Button is Q. (By default, there are already 2 Submit entries, mapped to "return" and "space".)

    For scroll wheel navigation, add the script ScrollWheelNavigation in this package: ScrollWheelNavigation_2016-08-20.unitypackage to your dialogue UI's Response Menu panel. The package also includes an example scene. Run up to Private Hart to test out the scroll wheel. (Future readers: If that link doesn't work, check the Extras page under "UIs" for an updated version.)

    The script is also here for reference:

    Code (csharp):
    1. using UnityEngine;
    2. using UnityEngine.EventSystems;
    3.  
    4. public class ScrollWheelNavigation : MonoBehaviour
    5. {
    6.  
    7.     public string wheelAxis = "Mouse ScrollWheel";
    8.     public float wheelThreshold = 0.1f;
    9.  
    10.     private float m_delta = 0;
    11.  
    12.     void Update ()
    13.     {
    14.         if (EventSystem.current.currentSelectedGameObject != null)
    15.         {
    16.             m_delta += Input.GetAxis(wheelAxis);
    17.             if (Mathf.Abs(m_delta) >= wheelThreshold)
    18.             {
    19.                 var currentSelectable = EventSystem.current.currentSelectedGameObject.GetComponent<UnityEngine.UI.Selectable>();
    20.                 if (currentSelectable != null)
    21.                 {
    22.                     if (m_delta > 0)
    23.                     {
    24.                         var up = currentSelectable.FindSelectableOnUp();
    25.                         if (up != null) up.Select();
    26.                     }
    27.                     else if (m_delta < 0)
    28.                     {
    29.                         var down = currentSelectable.FindSelectableOnDown();
    30.                         if (down != null) down.Select();
    31.                     }
    32.                 }
    33.                 m_delta = 0;
    34.             }
    35.         }
    36.     }
    37. }
     
  32. CrossHanded

    CrossHanded

    Joined:
    Jul 31, 2013
    Posts:
    9
    Hello, I'm new to Dialogue System though I've spent the last day trying to figure out how to get it to do what I need it to... unfortunately am not having much luck and its become too frustrating to continue without assistance (believe me I hate asking for help and I've spent a lot of time digging in the docs and on both forums to no avail.) I'm hoping I can have some questions answered so I can better understand.

    1) I'd like to have it set up so two (or more) characters talking to each other can have their own dialog text box + portrait at different screen locations, so the portraits could all be seen at the same time to see who is involved in the conversation, though the text would clear from the non-talking character's box as it would now; they would "take turns" talking but their UI's would remain visible. Example from Street Fighter Alpha 3:
    http://imgur.com/a/LjwPJ
    From reading the docs I thought this would be possible by assigning a different Dialogue UI to each character/gameobject by using the Override Dialogue UI script, but this did not work. It would only use the alternate ui positions if I assigned that character as the conversant and then the entire conversation would use those same coordinates even if I made the other character in the conversation's gameobject override to a different Dialogue UI. Can you explain the correct way to do this?

    2) I can't seem to understand the relationship between "Actor" and "Conversant" as they are used in the Conversation Trigger script. What is the difference between an Actor and Conversant and what difference do they make when defined here? How I would have expected it to work is to set up and actor with a portrait and name, set the state machine boxes up with the actor ID and text line and have it just work, but that wasn't the case. If I leave the Conversant as "None" in the Conversation Trigger script, the character's name gets stuck as "Dialogue Manager"; it took me hours to figure out why this was happening, as I expected the character name to be whatever it was set to in "Actor". "Conversant" in the tooltips says its the listener in the Conversations State Machine, but its backwards to how it actually plays out and I end up with a character that talks to themself unless I use the character who talks first in the "Conversant" slot of the Conversation Trigger script. (I did notice in the forums that previous versions of the Conversation Trigger Script had the positions of Actor and Conversant reversed, so maybe its a bug?) How this all works is very unclear and confusing in the documentation so a better explanation would be greatly appreciated.

    Thanks in advance!
     
  33. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Good stuff! I'll try this out when I get home. Many thanks.
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @CrossHanded - Thanks for using the Dialogue System! Sorry for the frustration. The Dialogue System has a lot of options to be able to handle all the different needs developers, so some areas of it have a learning curve. UIs are the hardest in this regard since every game has its own look and feel.

    Most of the default UI setups are structured with three onscreen areas:
    • NPC Subtitle: Shows the dialogue text for all NPCs.
    • PC Subtitle: Show the dialogue text for the PC (player). Only used if the Dialogue Manager's Subtitle Settings > Show PC Subtitles During Line checkbox is ticked.
    • Response Menu: Shows the player response menu.
    This is easy to set up. Just assign a dialogue UI prefab to your Dialogue Manager, and it should work fine.

    In your case, you don't want to use the same NPC Subtitle area for all of your NPCs. You want to use a separate set of UI controls for each NPC. In the end it's not much work, but there are a couple non-intuitive steps that I'll describe.

    Here's an example scene that demonstrates what I believe you're looking for: (built in Unity 5.3.4)

    ThreeParticipantsExample_2016-08-22.unitypackage

    The example involves three participants: Private Hart, Sergeant Graves, and the Player. On the Dialogue Manager, I added a Conversation Trigger that starts the conversation immediately.

    I used Unity UI, which is the easiest way to set it up. Here are the steps:
    1. Start with a Unity UI dialogue UI. If you added the Dialogue Manager prefab from the Prefabs folder, it already comes with a Generic Unity UI Dialogue UI, which is a good starting point. You can customize the appearance later.

    2. Add UI controls for each NPC. In the example scene, I expanded the Dialogue Panel. (I also set the Dialogue Panel's Canvas Group > Alpha to 1 so I could see it.) Then I just copied NPC Subtitle Panel, repositioned it, and renamed it "ADDED Graves Subtitle Panel". I put it in the spot where NPC Subtitle Reminder Panel was; since we don't need to use NPC Subtitle Reminder in this example, I just deactivated it.

    3. Inspect the Unity UI Dialogue UI component. At the bottom of the inspector, tick Find Actor Overrides.

    4. On each NPC GameObject, add an Override Unity UI Dialogue Controls component. Assign the UI controls you created for that NPC, and tick Always Visible. For Private Hart, I just used the default NPC Subtitle Panel, so I didn't bother with this. Sergeant Graves is the one to look at.

    5. Finally, I created a conversation involving all three participants. I copied the Private Hart conversation and wedged in a few lines spoken by Sergeant Graves.
      • One tricky thing here is that Always Visible should really be called "Never Hide". It guarantees that the dialogue UI never hides a set of UI controls once those controls have been shown. But those controls will only be shown in the first place if the participant has something to say. At the start of the conversation, I added a blank node for each of the NPCs. The Default Text is just a blank space character, and the Sequence is None(), which means it immediately progresses to the next node in the conversation. The effect is that it sets up both NPCs' subtitle panels and leaves them onscreen.


    I'll clarify this better in the next version of the documentation. It's a bit confusing because the Dialogue System lets you use a different participant at runtime than the participant defined the conversation in the Dialogue Editor. The reason for this is to allow you to use general-purpose conversations for more than one actual NPC.

    The classic example is the RPG shopkeeper. You can create a generic actor named "Shopkeeper" with a generic conversation such as: "Hello, I'm [var=Conversant]. Welcome to my shop!"

    Then you can assign a Conversation Trigger to each individual shopkeeper in each village, but still use the same generic conversation. Assign the village's shopkeeper to its Conversation Trigger's Conversant field. The conversation will use this GameObject instead of looking for a GameObject named "Shopkeeper". Actually, if you leave the Conversant field unassigned, the Conversation Trigger will use its own GameObject, so you can add the Conversation Trigger to your shopkeeper NPCs and just leave the field blank. This is also probably the reason why the Conversant reported as "Dialogue Manager"; your Conversation Trigger was probably on the Dialogue Manager.

    I will definitely do my best to make this as clear and simple as possible in the next version of the documentation.

    If I can clarify any of this or provide any other help, please just let me know.
     
    BackwoodsGaming and hopeful like this.
  35. CrossHanded

    CrossHanded

    Joined:
    Jul 31, 2013
    Posts:
    9
    Thank you for the prompt and courteous reply. I think I have a better understanding of how things work now (particularly with the character name coming up as "Dialogue Manager" due to being parented by it). However I still can't seem to get the conversation to use more than one set of UI's. It always just sticks to appearing in the same UI boxes, and I know the second set is in a different layout/position since I renamed all their elements and they will use that other position if the first speaker is assigned that Generic Unity UI Dialogue instance. Similar to your example, I duplicated the Canvas, renamed all the elements, adding a 2 to the end of them (just to be sure), moved the NPC Subtitle panel down, and reassigned the "2" variants to the Unity UI Dialogue Script. For both the original and dupe, I made sure Find Actor Overrides was checked. For both characters I have Override Dialogue UI scripts assigned the respective set of UI elements I want them to use, Priority on both is 0 (not sure if that matters?). Still, the conversation follows only the first set of UI elements that is used and I've never gotten it to change in mid-conversation. I've experimented with having 2 canvases and 1 canvas with the same result, however I noticed that if I placed Canvas 2 higher in the Hiearchy than the original canvas, it would always use Canvas 2's position for the conversation. Could my canvas positions in the hiearchy be the problem? Both of them are child objects of the Dialogue Manager.. but if I place them outside they won't work so I believe I have them in the right place. Here's how my scene is set up currently, maybe you can tell me if I have it wrong:
    http://imgur.com/a/tmlzn

    I can also upload my scene if we can't figure out what the problem is from that. Thank you very much again for the help.

    Edit: I tried assigning the Conversation Trigger Script to the Character Gameobjects in the hiearchy and it seems it will always use the UI boxes assigned to the one with Conversation Trigger Script. I still can't get the text/portrait to switch between the sets of UI elements during a conversation.
     
    Last edited: Aug 23, 2016
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @CrossHanded - For your purposes, don't use Override Dialogue UI. Instead, use Override Unity UI Dialogue Controls. I encourage you to try out the example scene linked in my previous reply to see how it works.

    The purpose Override Dialogue UI is to completely override the entire dialogue UI. For example, the Feature Demo uses this on the Terminal GameObject. It's a computer terminal, so it uses a complete, computer-themed UI instead of the regular conversation UI. This is why your current setup always uses one of the participants' UIs for everything. Since the participant has an Override Dialogue UI, it overrides the entire dialogue UI for everyone in the conversation. (If both participants have Override Dialogue UIs, the one with the higher Priority is used.)

    The purpose of Override Unity UI Dialogue Controls, on the other hand, is to override specific UI controls, usually for a specific NPC (as when Find Actor Overrides is checked), while retaining the original dialogue UI controls for everything else.


    Regarding your two canvases (which is a separate issue): If the Dialogue Manager's Dialogue UI field is unassigned, it uses the first dialogue UI component it finds on a child GameObject. This is why your canvases don't work if you move them outside the Dialogue Manager. If you want to move your dialogue UI outside the Dialogue Manager, you can assign it to the Dialogue Manager's Dialogue UI field.


    If the info above doesn't resolve the issue, please feel free to send a scene to tony (at) pixelcrushers.com and let me know what version of Unity to use. I'll be happy to take a look.
     
  37. CrossHanded

    CrossHanded

    Joined:
    Jul 31, 2013
    Posts:
    9
    I still couldn't get the conversation working even though I substituted Override Unity UI Dialogue, and checked the three participants example you provided. I've emailed you and attached my scene/dialogue database. Hopefully this will get sorted. Thanks again.
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi - I got your email. As soon as I get back to the office (a little later today), I'll check it out and reply back.
     
  39. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Quick question. When I tried out the mouse scroll script, it didn't work. I went to your scene where it DID work. I then deleted my scene's dialog manager and went through the wizard to make a new one, but for some reason it only generated the dialog manager in the hierarchy, without any of the child objects. I then deleted this and simply copied over the dialog manager from that text scene into my game. It worked then, but I also had some weird stuff like a box at the top of the screen (probably easy to remove) and a zoom-in on the NPC after I picked a dialog choice. I can probably go about removing this stuff and getting it "back to normal," but I really don't know why the normal set-up doesn't work correctly (or the way I perceive it should). Can you explain why it only gives the Dialog Manager GameObject and nothing below it?
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Here are a few things to check on your Dialogue Manager:
    • Are you using Unity UI Dialogue UI? The scroll wheel script is written specifically for Unity UI. If you're using legacy Unity GUI, NGUI, or some other GUI system, it won't work.
    • Did you add the ScrollWheelNavigation script to the Response Panel?
    The wizard only creates a Dialogue Manager. It doesn't create any child GameObject (e.g., UIs) unless you assigned a UI prefab on the wizard's dialogue UI page.

    There's also a Dialogue Manager prefab in the Prefabs folder. This is preconfigured with a whole set of generic UIs. (The weird box at the top is a Selector UI. You can play the Examples/Unity UI Examples/Generic UI Example Scene to see it in action.) When I'm setting up a test scene, I usually just drag this prefab into the scene instead of going through the whole wizard to create a new Dialogue Manager.

    The Dialogue Manager in the scroll wheel example scene also has a custom Default Sequence value that does closeups on the participants. This is why it did closeups.

    Please feel free to send your original scene to tony (at) pixelcrushers.com and let me know what version of Unity to use. I can take a look and see why the scroll wheel script isn't working.
     
  41. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Alright, thanks for the help. I did NOT assign a UI element, just left it blank. That may be why.

    I actually intended to make my own rudimentary UI, but I wasn't sure where to start. I planned to look at your images just to see where I should start.

    But I'll use one of your UIs and give it a shot.
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    The Generic Unity UI prefab (which is also included in the Dialogue Manager prefab in the Prefabs folder) is a good choice to start with. It contains all the dialogue UI elements, and it's pretty easy to customize.

    Side note: If your Dialogue Manager's Dialogue UI field is unassigned, the Dialogue Manager will look for a dialogue UI in its children. So it's perfectly valid to leave the Dialogue UI field unassigned as long as you also add a dialogue UI as a child. For Unity UI, the dialogue UI should be located in a Canvas. If you try to assign a Unity UI prefab to the Dialogue UI field, the Dialogue Manager will automatically put it inside a Canvas for you. Or you can add the Bundle prefab, which includes all the generic UIs already packaged under a Canvas.
     
    EternalAmbiguity likes this.
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Dialogue System for Unity 1.6.6.2 Patch 2016-08-23 Available

    Patch 1.6.6.2 2016-08-23 is now available on the Pixel Crushers customer download page. If you'd like access, please PM me your Asset Store invoice number. These changes will also be in the next full release on the Asset Store.

    Patch notes:
    • Improved: UnityUITypewriterEffect now supports auto scroll for very long text.
    • Fixed: Template fields with custom field types now use the correct field type when creating new assets.
    • Changed: For importers, Encoding Type Default now uses your system’s Encoding.Default, not Encoding.Unicode.
    • Added: Encoding Type ISO-8859-1.
    • Adventure Creator: Bark action has new Allow During Conversations checkbox; added Check Conversation Active action.
    • articy:draft Converter:
      • When converting articy:expresso expressions to Lua, content inside strings are now left untouched.
      • Condition and Instruction nodes now take proper order by the node’s Y-position.
    • Chat Mapper: Improved cross-conversation linking to prevent linked conversation’s START node from appearing as a blank response button.
    • CSV Converter: Fixed: Wasn’t importing link priorities (so they all defaulted to Normal).
     
  44. r3nrohan

    r3nrohan

    Joined:
    Sep 28, 2015
    Posts:
    33
    Hi, umm I seem to get this problem, can you help upload_2016-8-24_13-23-53.png
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @r3nrohan - Is the problem that the red banner image is stretched? Or, if this is a dialogue UI, that it's not showing any text? Can you please describe what you expect to happen, and what is happening instead that you don't want to happen?
     
  46. r3nrohan

    r3nrohan

    Joined:
    Sep 28, 2015
    Posts:
    33
    when I get near to NPC for dialouge, this shows up. It happens in NecromancerUI
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Then that's probably the Selector UI.

    Your PC GameObject probably has a Selector or ProximitySelector component. Inspect that component and assign a different GUI Skin, such as the default GUI Skin in Prefabs/Legacy Unity GUI Prefabs/Default, to the GUI Skin field.
     
  48. KWaldt

    KWaldt

    Joined:
    Nov 1, 2013
    Posts:
    127
    Hello again!
    I'm having a few questions again.

    1. Master Audio
    I tested out Dialogue System with Master Audio yesterday, and it really works beautifully together!
    The commands for the playlists are very comfortable to use. However, I can't figure out how to actually play sound effects--I clicked around in the demo scene, but couldn't get any of the four sound effects (king, arrow, blast, ...) to play. Looking at the Master Audio documentation, it seems to use a command called PlaySound, but I couldn't find it in Dialogue System.
    Could you point me in the right direction?

    2. CSV import
    I am currently writing a dialogue writing software, and want to export to Dialogue Manager.
    Are the double quotation marks around the dialogue text needed, or would single quotation marks do too?
    ("Dialogue text" vs 'Dialogue text')

    Best Regards,
    Kristina Waldt
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi Kristina - Short answer: I'll put an updated integration package on the Dialogue System Extras page later today that has an MAPlaySound() sequencer command.

    Long (kind of funny) answer: The Master Audio integration was the Dialogue System's first third-party integration package, and we made it in conjunction with Dark Tonic for a specific customer's needs. Only now do I realize that the customer, surprisingly, never asked for a PlaySound sequencer command. They used MAPlaylistClip(clipName) to play all of their sounds. After all these years I can't believe no one before you has asked for a PlaySound command, since this seems like the most fundamental one to use. Anyway, I'll add it to the updated integration package that will appear on the Extras page later today.


    They must be double quotes, since this is a requirement of some CSV-importing spreadsheet programs.

    Although you can wrap all fields in quotes, they are really only required when necessary to disambiguate the CSV format. For example, an Actor row might look like this:

    Actors
    ID,Portrait,AltPortraits,Name,Pictures,Description,IsPlayer
    1
    ,player.png,[],"Bill S. Preston, Esq.",,Founding member of Wyld Stallyns,false

    (I alternated black and blue to make it easier to distinguish fields.)

    The name "Bill S. Preston, Esq." must be in quotes because it contains a comma.

    You can use the Dialogue Editor's Export feature (on the Database tab) to export a dialogue database to CSV format to get an idea of what it should look like. Also, if you can import your CSV file into MS Excel or Google Sheets, it should import properly into the Dialogue System, too.
     
  50. KWaldt

    KWaldt

    Joined:
    Nov 1, 2013
    Posts:
    127
    Ahahah, oh, that's nice to hear. I was thinking about using playlists for that kind of thing too, wondering if I missed something. Thank you for your fast support!

    Ah, so it would be alright if everything (even the id etc.) is in double quotation marks?
    That makes it easier for me. I'll play around with the import, thanks for the pointer!

    - KW