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

    HeyItsLollie

    Joined:
    May 16, 2015
    Posts:
    68
    Ah wow, thank you! That's an awesome little script. (And you are far too right about that "20 seconds/20 minutes" feeling, hahah)

    One last quick question while I'm here: Can Lua commands be used to control the position/width & height of dialogue/alert panels? I've whipped up a quick test with PlayMaker that can do just that, but it'd be great to be able to control the UI entirely through Dialogue System.
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @3noneTwo - Sure. Here are some suggestions for controlling panels, in no particular order.

    Sequencer commands: You can write a custom sequencer command. Just copy the template script and fill it in with whatever code you need. You'd then use this in a dialogue entry node's Sequence field.

    Lua functions: Or register C# code as a Lua function. Then you can use it in a dialogue entry node's Script field.

    PlayMaker: Or, since you already have PlayMaker working, define an event in your PlayMaker FSM and then trigger that event using the FSMEvent() sequencer command.

    UI auto-sizing: If it's just a matter of sizing the panels to fit their content, I suggest using a Unity UI Content Size Fitter.

    If you'd like more details on any of these approaches, just let me know.
     
    HeyItsLollie likes this.
  3. Zephus

    Zephus

    Joined:
    May 25, 2015
    Posts:
    356
    I bought your plugin quite a while ago and just now started using it and it's absolutely awesome. I can't imagine how much time it must have saved developers everywhere. So, good work and thanks for making Dialogue System!

    Please don't kill me for this, but I have a very basic question that should be answered pretty quickly.
    I've gone through the tutorials and I get how to set up a dialogue system, but I'm not sure what's the best way to make a standard 'text box dialogue' system like older RPGs or Visual Novels have for example.

    What I want is basically this: most of the dialogue is non-interactive except for 'press to continue' to advance to the next text box. But once in a while I want the player to make a choice. But most of the time there are no branches.

    What's the best way to do this? I tried unticking 'Always Force Menu', but then the Player Character's dialogue gets completely skipped over.

    edit: Oh, and another small thing. As the asset gives the option to localize the game, is there any way to let it also handle the rest of the text for that? Like item names, skill names, menu buttons and stuff like that?
     
    Last edited: Nov 3, 2016
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @MESRecords - Thanks! Please try this:
    1. Keep Always Force Response Menu unticked. This skips the response menu if there are no branches. (If you later want to force a response menu for a specific response that has no branches, add "[f]" to the text to force the menu.)

    2. Tick Subtitle Settings > Show PC Subtitles During Line. This shows the PC's text.

    3. If you haven't already set up your dialogue UI, you could assign one of the "JRPG" prefab UIs to the Dialogue Manager, such as Prefabs > Unity UI Prefabs > JRPG or JRPG2. JRPG works more like a traditional 2D JRPG, whereas JRPG2 is more like a visual novel UI.

    If that doesn't do exactly what you want, let me know. There are other settings to play with, too.

    Sure! You'll use Localized Text Tables for this. Briefly, here are steps for menu buttons:
    1. Create a localized text table (Assets > Create > Dialogue System > Localized Text Table). Assign it to the Dialogue Manager.

    2. Inspect the localized text table and click the "+" button next to Languages to add languages. Add languages (e.g., "es" for Spanish, although the names are really your choice).

    3. Click the "+" button next to Fields to add fields, which are the localized text entries (e.g., "Exit Game"). Add translations for each language (e.g., "Salir del Juego").

    4. Add a Localize UI Text component to your Unity UI Text or Dropdown element. Make sure the starting text matches the name of the field in the localized text table (e.g., "Exit Game").
    You can follow similar steps for other text. In your own code, use the LocalizedTextTable[] overload, such as:
    Code (csharp):
    1. myText = myLocalizedTextTable["Exit Game"];
    Or, if you're using a visual scripting tool like PlayMaker, use the corresponding action.
     
  5. Zephus

    Zephus

    Joined:
    May 25, 2015
    Posts:
    356
    Thank you, that's exactly what I wanted.

    I've got a new questions now though: How do I set the key to continue to the next text? When I set 'Cancel' it skips over the next text box and shows the one after that. I'm not really sure what that's supposed to accomplish but it's weird that it doesn't just go to the next box.
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @MESRecords - Play with the Dialogue Manager's Subtitle Settings > Continue Button mode. Here's an example scene:

    JRPG_Example_2016-11-03.unitypackage

    It uses these settings:



    The Continue Button dropdown has several options. "Optional Before Response Menu" means that it always shows the continue button with subtitles, but if the next step is a response menu it will progress to the response menu without requiring the player to click the continue button.

    The Continue Button UI element itself has a Unity UI Continue Button Fast Forward component. This modifies the behavior of the continue button. If the subtitle has a typewriter effect that's still typing, the continue button will fast forward the typewriter to the end of the line. Otherwise, if the typewriter effect is already at the end, the continue button will actually continue.

    The Input Settings > Cancel button, on the other hand, cancels the current dialogue entry entirely and skips to the next one. The Cancel Conversation button ends the conversation entirely. When you're using a continue button, Cancel and Cancel Conversation are really in there more as escape hatches, not as a part of the regular flow of conversation.
     
  7. Zephus

    Zephus

    Joined:
    May 25, 2015
    Posts:
    356
    Thank you again. So if I understand it correctly if I want to achieve the usual 'Press X to Continue' without the Fast Forward component I'd put 'Fire1' or whatever my button name is into the 'Cancel/Button Name' field, right? At least that seems to be working now.

    Now I want to do what most JRPGs do though, which is basically this:
    - If typewriter isnt' done yet: cancel typewriter and show the whole dialogue entry
    - Else go to next dialogue entry
    - Make it impossible for specific dialogue entries to cancel the typewriter

    As I see it I would have to write custom code for this, right? I'm not sure where it would have to go though.
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi - No need for custom code. Try these steps:
    1. Set the Dialogue Manager's Input Settings > Cancel > Key to KeyCode.None and Button to a blank string unless you want to add an "escape hatch" for conversations. Instead, for this functionality you'll use a continue button.

    2. As in the example scene I attached, add a Unity UI Typewriter Effect to the subtitle UI Text element if it doesn't already have one.

    3. Add a Unity UI Continue Button Fast Forward component to your continue button if it doesn't already have one. Assign the subtitle UI Text's typewriter effect. Point the continue button's OnClick() event to the component's OnFastForward method. (Make sure your Dialogue Manager's Subtitle Settings > Continue Button is set to a mode that uses the continue button.)

      At this point, when you use the mouse to click the continue button and the typewriter is still typing, it will show the whole dialogue entry. If the typewriter is already done typing, it will go to the next entry.

    4. Inspect the dialogue UI's Unity UI Dialogue UI component. At the bottom of the component, tick Auto Focus. This is for keyboard/joystick support. It ensures that the continue button gets focus while the subtitle is being displayed. If the player presses the Submit input (as defined in Unity's Input Manager, Edit > Project Settings > Input), it will click the button.

    5. Alternatively (or if you want the continue button to respond to additional input other than what's assigned to Submit), you can add a UI Button Key Trigger component to the continue button and specify key and/or button to listen for.

    6. To make it impossible for specific entries to cancel the typewriter, use the SetContinueMode() sequencer command in the entry's Sequence field. If you're not familiar with sequences yet, you might want to give this section a quick skim. Set the Sequence field to something like:

      SetContinueMode(false);
      required SetContinueMode(true)@{{end}}


      The first line immediately disables the continue button. The second line re-enables the continue button only after a duration determined by the length of the subtitle text. The "required" keyword ensures that it re-enables the continue button even if the player somehow short-circuits the entry.
    Side note: Some devs don't want a visible continue button. Instead, they want the player to be able to click anywhere on the screen to continue. To do this, they make the continue button invisible (e.g., image's alpha set to 0) and cover the whole screen.
     
  9. Zephus

    Zephus

    Joined:
    May 25, 2015
    Posts:
    356
    Awesome, you made it work just like I wanted it to. Thank you so much for the detailed answers!
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Happy to help!
     
  11. quesadillas

    quesadillas

    Joined:
    May 1, 2015
    Posts:
    23
    Hey again, Tony!
    I've been looking for a way to restart the timer for a given set of dialogue options. For example, the player is given three options, but they don't pick anything in time. This sets off a warning. After the warning, I want to restart the timer to give the player another chance. At the moment, I am restarting the conversation at the most recent line ID, but this replays the last line of dialogue before the options show up. Is there a way to start a conversation at the part with the dialogue options, or would I have to make a separate empty node to separate the options from that piece of dialogue?
    Thanks!
     
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @quesadillas - I think an empty node is the best approach, especially if you tick its Group checkbox. Group nodes are passthroughs. They're designed to group things together to reduce the number of links you need to set up. I attached an example scene to this post. Its conversation looks like this:


    • The <Responses> group node increments a variable "NumTimes".
    • The <START> node has an AboveNormal priority link to "Come on, choose a door!" with a condition that "NumTimes" is greater than 0.
    • The Dialogue Manager is configured to end the conversation on timeout.
    • A Dialogue System Events component resets the conversation automatically on timeout. Right now it restarts the conversation from the beginning, but you could point it to a Conversation Trigger that starts at the group node (or write a script to do the same thing).
     

    Attached Files:

  13. quesadillas

    quesadillas

    Joined:
    May 1, 2015
    Posts:
    23
    Neat, the group nodes sound like just what I want! The only issue is, we have a LOT of dialogue with a lot of options, and this would mean going back in and adding an extra node for every branching dialogue choice, not to mention this node only comes into play if the timer runs out before the player clicks an option. Maybe if there was a way to dynamically add a node through scripting? Currently I am triggering the variable updates and new conversation and all that from the OnConversationTimeout() event, so I was thinking that I could create a new dialogue node when the timer runs out and start the conversation from there, which would go straight to the options. Is this possible? I haven't been able to find it in the documentation.
     
  14. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    Just a question about the game saver. I have 4 components set up on the dialog manager. each one from slot 0 to slot 3 and 4 UI buttons that allows a player to pick one and save to it,

    Is there a way to have it set up like the Fallout save menu.
    So every time the player hits new save it adds it to the list?
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @quesadillas - How about this approach: Write a small script with two methods:
    • OnConversationLine: Record the current dialogue entry ID.
    • OnConversationTimeout: Restart the conversation at the recorded dialogue entry ID.
    • When showing the restarted dialogue entry, set its sequence to skip immediately so it jumps straight to the response menu.
    I attached an example scene (Reset Timer 2) that also contains this script:

    ResetTimer.cs:
    Code (csharp):
    1. using UnityEngine;
    2. using PixelCrushers.DialogueSystem;
    3.  
    4. public class ResetTimer : MonoBehaviour
    5. {
    6.  
    7.     private int lastDialogueEntryID = -1;
    8.     private bool isRestarting = false;
    9.  
    10.     void OnConversationLine(Subtitle subtitle)
    11.     {
    12.         lastDialogueEntryID = subtitle.dialogueEntry.id;
    13.         if (isRestarting)
    14.         {
    15.             // Skip last-displayed entry by bypassing its sequence:
    16.             subtitle.sequence = "SendMessage(OnContinue,,Dialogue Manager,broadcast);" + subtitle.sequence;
    17.             isRestarting = false;
    18.         }
    19.     }
    20.  
    21.     void OnConversationTimeout()
    22.     {
    23.         DialogueManager.ShowAlert("Hey, wake up, fool!");
    24.         isRestarting = true;
    25.         DialogueManager.StartConversation(DialogueManager.LastConversationStarted, null, null, lastDialogueEntryID);
    26.     }
    27. }

    Hi @JACKO4590 - Yes, but it requires a little scripting. It's just a UI thing. Nothing in the design of the save system or the Game Saver component prevents unlimited slots. When I was designing the example UI (and the more extensive Menu Framework on the Dialogue System Extras page), I just made the design decision to use slots because it seemed better applicable to more games. In the future, I'll probably add the option for unlimited slots to the Menu Framework, since the underlying functionality is already there. It also includes the option to save to encrypted disk files instead of PlayerPrefs.
     

    Attached Files:

  16. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Hi, I'd like to use Dialogue System just via code and not hook into the UI stuff. I've played around a little and have some stuff working, but I just wanted a reality check to make sure I'm going down the right path.

    Initiating conversations is straightforward enough:
    DialogueManager.Instance.StartConversation(“ConversationName”);

    Putting a DialogSystemEvents component on and hooking into OnConversationLine and OnConversationResponseMenu is working so far. If I take the Response array passed into OnConversationResponseMenu, I can do this with the chosen response (I'd handle displaying and choosing responses in my own code):

    Code (csharp):
    1.  
    2. ConversationState state = DialogueManager.Instance.ConversationController.ConversationModel.GetState(chosenEntry);
    3. DialogueManager.Instance.ConversationController.GotoState(state);
    4.  
    So far that's been working.

    Is there a better and/or easier way to pick a response via code? It took some digging through the source code to get that far.
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @Steve-Tack - What about using the IDialogueUI interface? There's a template (with lots of comments) in Scripts/Templates/TemplateDialogueUI.cs. This is the quickest, easiest, and most graceful way to do your own UI stuff in the Dialogue System.

    When you start a conversation using DialogueManager.StartConversation, it sets up these Model-View-Controller (MVC) elements:
    • ConversationModel: Handles the logic and data of a conversation (e.g., ConversationState).
    • ConversationView: Handles the visible parts of a conversation (subtitle/response UI and sequences).
    • ConversationController: Mediates between ConversationModel and ConversationView.
    The ConversationView assumes that the Dialogue System has access to some implementation of IDialogueUI. The IDialogueUI interface has only a handful of methods to implement.

    (Typically the OnConversationLine and OnConversationResponseMenu methods (or the equivalent events in Dialogue System Events) are used supplementally, not as the main handlers for the UI, since the ConversationView is already trying to send requests to some IDialogueUI implementation.)


    If you really don't want to use this, you can manually start a conversation by creating your own instance of ConversationModel. But then you're responsible for manually handling a lot of stuff. If you need more info about this, just let me know. However, I think IDialogueUI is the best way to go.
     
    Last edited: Nov 7, 2016
  18. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    @TonyLi thank you for such a thorough response!

    Yes, the IDialogUI interface does look perfect, and yeah, there's not much to implement there. TemplateDialogueUI.cs is nicely commented - should make it straightforward.

    I'm glad I asked. I was going a bit of a messy direction there. :)
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Arabic Support for Unity UI by Stranger Games

    Stranger Games has just released an Arabic Support for Unity UI package! It handles dynamic text layout without distorting Arabic text, and includes other advanced features such as dynamically loading Arabic fonts only when needed.

    And it includes nice Dialogue System integration, supporting things like right-to-left typewriter effects in Unity UI.
     
  20. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    @TonyLi first, copying the TemplateDialogueUI and implementing that stuff is working great. The only very tiny issue is that when I have "Show PC Subtitles" checked, I'll get an initial ShowSubtitle() call for the player with an empty string for the subtitle even when the conversation starts with an NPC. I have a workaround of simply not displaying subtitle text that's blank, but I thought you might want to know.

    I had a quick question. Is there a way to grab the conversation description in code? Either by name or the current conversation?
     
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @Steve-Tack - That's the START node, the orange entry point for the conversation. Your workaround is a good way to handle it.

    Use DialogueManager.MasterDatabase.GetConversation.LookupValue("Description"), or LookupLocalizedValue if you're localizing the description into several languages. For example to grab the description of the last conversation started (i.e., the current conversation):
    Code (csharp):
    1. var conversation = DialogueManager.MasterDatabase.GetConversation(DialogueManager.LastConversationStarted);
    2. var description = conversation.LookupValue("Description");
    If you're linking between conversations, you'll want to use DialogueManager.CurrentConversationState.subtitle.dialogueEntry.conversationID instead of DialogueManager.LastConversationStarted:
    Code (csharp):
    1. var conversation = DialogueManager.MasterDatabase.GetConversation(DialogueManager.CurrentConversationState.subtitle.dialogueEntry.conversationID);
    2. var description = conversation.LookupValue("Description");
     
  22. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Ah, I see.


    That's working great, thanks!
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Glad to help!
     
  24. quesadillas

    quesadillas

    Joined:
    May 1, 2015
    Posts:
    23
    Thanks, that's exactly the kind of solution I was looking for! :D
    I'm having a bit of trouble implementing it though. It's odd, I'll put in that subtitle.sequence = "SendMessage(OnContinue,,Dialogue Manager,broadcast);" + subtitle.sequence; and... nothing changes. I made sure that I unchecked the "Override display settings" (we're overriding the Sequence settings with an entrytag thing) and I printed out the subtitle to make sure I made the change to the right line, but it still plays the line anyway. If I pause the game and check the database at that point, the Sequence area doesn't have my changes, but if I print out the Sequence area dynamically it does show what I've added to it, so presumably I am making the correct change to the sequence.

    Any ideas on why it would be ignoring this message?
    Thanks!
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @quesadillas - Is your Dialogue Manager GameObject named "Dialogue Manager"? If not, replace "Dialogue Manager" in that SendMessage() command with the name of your Dialogue Manager GameObject.

    I'll be the first to admit that this is a bit hacky. For the next release, I've add a proper Continue() sequencer command to simulate a continue button click. So instead:
    Code (csharp):
    1. subtitle.sequence = "SendMessage(OnContinue,,Dialogue Manager,broadcast);" + subtitle.sequence;
    it'll just be:
    Code (csharp):
    1. subtitle.sequence = "Continue();" + subtitle.sequence;
    If you want to start using that command in your sequences now, add this script to your project:

    SequencerCommandContinue.cs
    Code (csharp):
    1. using UnityEngine;
    2.  
    3. namespace PixelCrushers.DialogueSystem.SequencerCommands {
    4.  
    5.     public class SequencerCommandContinue : SequencerCommand {
    6.  
    7.         public void Start() {
    8.             if (DialogueDebug.LogInfo) Debug.Log("Dialogue Manager: Sequencer: Continue()");
    9.             DialogueManager.Instance.BroadcastMessage("OnContinue", SendMessageOptions.DontRequireReceiver);
    10.             Stop();
    11.         }
    12.     }
    13. }
    When you update to the forthcoming version 1.6.7, you'll need to delete this script, since the same command will be built into the Dialogue System.

    If that doesn't help and you don't want to use the Continue() command (or if the Continue() command doesn't work for some reason), temporarily set your Dialogue Manager's Debug Level to Info. Look in the Console window for a line like:

    Dialogue System: Sequencer: SendMessage(OnContinue, , Dialogue Manager (UnityEngine.Transform), broadcast)
    If instead you see

    Dialogue System: Sequencer: SendMessage() command: subject is null.

    then double check the name of your Dialogue Manager.

    Also, does the ResetTimerExample scene that I attached to my previous reply work for you?
     
  26. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    There are any news about Quest Maker?
     
  27. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    I just started the WIP thread. :)
     
    BackwoodsGaming likes this.
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Dialogue System for Unity in Roleplaying Games Asset Kit

    The Dialogue System for Unity is part of the Asset Store's Roleplaying Games Asset Kit! You can get this bundle, which also includes ORK Framework, Gaia, and A* Pathfinding Project, for 20% off with a Unity Plus subscription and up to 40% off with a new Unity Pro subscription.

    The Dialogue System has extensive integration support for ORK Framework and works fine with A* and Gaia. If you have any questions about using the Dialogue System with ORK, just let me know. ORK is a fantastic framework, and using the Dialogue System with it makes creating RPGs a lot of fun!
     
    BackwoodsGaming likes this.
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Updated Support Packages Available

    Several updated third party support packages are available on the Dialogue System Extras page for:
    • Adventure Creator
    • ORK Framework
    • S-Inventory + Realistic FPS Prefab
    • TextMesh Pro
    If you're using any of these integrations, I recommend importing the updated support packages to get all the latest improvements.

    The Dialogue System Extras page also has updated example integration scenes for Corgi Engine 2.0 and the newly-release Corgi Engine 3.0.
     
  30. wickedpopular

    wickedpopular

    Joined:
    Oct 29, 2016
    Posts:
    33
    Hi! I was looking at your asset, and I was wondering if it was possible to make a keyword-based dialogue system using it, sort of like Morrowind had. Here's a pic of what I mean:



    The idea is that each piece of dialogue has keywords in it, which add to the topics you can ask that NPC or other NPCs about, sort of like a wiki, and you can click on the keywords like hyperlinks to access them.
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @wickedpopular - Short answer: yes. It'll take a little work, but the Dialogue System gives you a substantial head start.

    Interface-wise, you can do anything you want because the Dialogue System doesn't lock you into any specific UI implementation.

    I was about to write that it might not be a perfect fit because the Dialogue System is designed for branching conversation trees. However, you'll almost certainly need some kind of branching conversation structure anyway, with the keywords serving as jump points to other content in the conversation. And the Dialogue System also gives you a way to write all your content, keep track of variables such as which keywords have been clicked, handle language localization, etc.

    To implement the keywords, I recommend using TextMesh Pro. (The Dialogue System has TextMesh Pro integration.) TextMesh Pro supports link codes. You could write a script that adds keywords to the selection list whenever the player clicks on a link. There's also a video on TextMesh Pro's link codes. The selections in the list could then jump to other points in the conversation.

    Since this is not the typical use case for the Dialogue System, please feel free to try the evaluation version before committing to purchase. It has all the features of the paid version, just with a watermark, so you can make sure everything's working perfectly first.
     
  32. wickedpopular

    wickedpopular

    Joined:
    Oct 29, 2016
    Posts:
    33
    Thanks for the quick response!

    If I'm understanding you, the biggest hurdle seems to be the inline "links." Since for me the actual "links" aren't the most important thing, would it be possible to just forego that aspect and utilize the Dialogue System alone?

    I imagine it might be possible to, rather than using branching trees in the traditional way, I could have a standard greeting as an entry point to the dialogue tree, then move to a dialogue node that has links to every possible dialogue topic. After that dialogue is displayed (and maybe flags are triggered to display new topics), you could just go back to that node that links to every other possible topic. But I'm just guessing.

    I'll try out your evaluation version and see if it's possible. I didn't want to buy an asset I couldn't use, but your evaluation version seems like a good way to test things. Thanks!
     
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Sure, that's actually a fairly typical use case for the Dialogue System. If you have a lot of topics, you can use group nodes to organize them by subject, which may make them easier to manage. (To make a group node, make a regular node and tick its Is Group checkbox.)

    Flags in the Dialogue System are typically variables. (You can define variables on the Variables tab of the Dialogue Editor.) You can specify a condition for each node, including group nodes. If the condition is false, the Dialogue System won't display that node.

    If you're still interested in using TextMesh Pro and links in your text, let me know. I'll put together a simple example.
     
  34. wickedpopular

    wickedpopular

    Joined:
    Oct 29, 2016
    Posts:
    33
    Thank you, but I think I personally can get around it with just this asset and some rich text formatting. If you are interested in doing it though, I'm sure some other users in the future might benefit from it (I know I can't tell you how many times I've been miffed at finding a forum post about my exact problem that ends up going nowhere!)

    Once again, thank you for your excellent customer service!
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Happy to help! I was curious about it, so I put together a proof of concept in Unity UI (without clickable links) and with TextMesh Pro (with clickable links).

    You can download a package containing the Unity UI and TextMesh Pro scenes here:

    [Updated version: Keywords Example]

    and play a WebGL version (without clickable links) here: [play]

     
    Last edited: Apr 2, 2022
    treshold likes this.
  36. Slein

    Slein

    Joined:
    May 26, 2013
    Posts:
    9
    It works great so far, I do have a question though. Is it possible to change the UI from one scene to another? If so, how?
    At the moment I have a scene that ends and then loads another scene that I would like to have a different type of dialogue box in. But it retains the UI of the first scene it loaded. D:
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @Slein - In your new scene, use DialogueManager.UseDialogueUI(). Here's a script that sets a new dialogue UI when the scene starts. Add it to a GameObject in your new scene, and assign the Dialogue UI field.

    SetDialogueUIOnStart.cs
    Code (csharp):
    1. using UnityEngine;
    2. using PixelCrushers.DialogueSystem;
    3.  
    4. public class SetDialogueUIOnStart : MonoBehaviour {
    5.  
    6.     public GameObject dialogueUI;
    7.  
    8.     void Start() {
    9.         DialogueManager.UseDialogueUI(dialogueUI);
    10.     }
    11. }
    If you want to use a different dialogue UI for a specific conversant (e.g., NPC), add an Override Dialogue UI component to the NPC instead.
     
  38. HeyItsLollie

    HeyItsLollie

    Joined:
    May 16, 2015
    Posts:
    68
    Hi Tony, I seem to have encountered an odd bug with "SetContinueMode(false)". When "SetContinueMode(false)" is on the final node of a conversation, all following conversations (including repeated conversations) ignore any attempt to set continue mode back to "true", skipping everything in the process.
     
  39. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @3noneTwo - I'll fix it and make a patch available later today. If you don't already have access to the Pixel Crushers customer download site, please PM me your Unity Asset Store invoice number so I can set it up for you.
     
    HeyItsLollie likes this.
  40. dude17943

    dude17943

    Joined:
    Jun 18, 2016
    Posts:
    5
    I just wanted to let you guys know that I found this thread looking for this exact thing. You guys are a freaking lifesaver. Is there a way to make it append the new text to the same textbox instead of replacing it like in wickedpopular's pic though?
     
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @dude17943 - You can combine it with the example setup in the Conversation Log Dialogue UI which is available on the Dialogue System Extras page. It's the fourth download link in the UIs section.
     
  42. HeyItsLollie

    HeyItsLollie

    Joined:
    May 16, 2015
    Posts:
    68
    Just PMed, thank you for looking into it so soon!
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Thanks! I just sent you access info. If anyone else needs access, please PM me your invoice number.

    This patch (1.6.6.5_p20161124) contains:

    Core:
    • Changed: SetContinueMode(true) now always sets mode to Always; SetContinueMode(original) sets to previous value.
    • Added: Continue() sequencer command.
    • Added: UpdateTracker() sequencer command.
    • Unity UI:
      • Dialogue UI: Fixed: If response has [position #], it’s not also added as a template instance; gracefully handles null entries in Buttons list.
      • Improvements to Unity UI animator handling.
    Third Party Support:
    • Adventure Creator: Added checkbox to Adventure Creator Bridge that resolves race condition when dialogue entry with an AC() sequencer command is immediately followed by entry that sets AC-synced variable in its Script field.
    • articy:draft: Runtime converter wasn’t observing ConvertSlotsAs setting.
    • NGUI: Quest log window now maintains visual state when open while quests are updated.
    • ORK: Updates inventory-management Lua functions for ORK 2.8.0 so you can check, add, and remove weapons and armor in addition to regular items.
    • RT-Voice: Updated to use RT-Voice callbacks, handle new API changes.
    • S-Inventory + RFPS: Fixed bug that let player equip even if dropped last of weapon.
    • TextMesh Pro: TextMeshProDialogueUI updated to remove deprecated API message.
    • Third Person Controller: Added TPCAbility() sequencer command, improved player quiescing when starting conversations.
     
    BackwoodsGaming likes this.
  44. iqsoup

    iqsoup

    Joined:
    Jul 19, 2013
    Posts:
    3
    Hi Tony,

    First off I am really loving the Dialogue System for Unity asset!

    I am wondering if there's an easy way to reference a quest (in LUA) by its quest ID rather than its quest name.

    I have a lot of quests and sometimes it is hard to remember a precise quest name. Or I have errors that turn out to just be me capitalizing something that shouldn't be. Or a quest has a long name that might be prone to typos. A simple number might be easier in situations like this.

    One thought I had was just to rename all the quests to match the ID, and then use the display name for displaying the quest in game. But before I do that I just wanted to check and see if there is a built in way to do what I'm trying.

    Thanks for an awesome asset!
    Andy
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @Soupmaster - Thanks! I'm glad you're enjoying using the Dialogue System!
    That's pretty much the way to do it. Treat the Name field as the quest's unique identifier, and use the Display Name for UIs. You can make the Name unique; it doesn't have to match the ID number. For example, your quest could be:
    • ID: 42
    • Name: "killOrcs"
    • Display Name: "Defeat the Orcs of Darkvale"
    The quest log window and quest tracker will show the quest as "Defeat the Orcs of Darkvale" (or any language-localized versions of this field if you'd defined them).

    In code or the Conditions/Script fields of dialogue entries, you can use "killOrcs", such as:

    Code (csharp):
    1. QuestLog.StartQuest("killOrcs");
     
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706


    Pixel Crushers is a sponsor of the Christmas Giveaway Calendar!

    This event is sponsored by over 40 of the highest rated Unity Asset Store developers and a whole sleeve of industry partners – including Unity themselves! (Many thanks for Devdog for organizing this event.)

    You can sign up right here.


    So what’s this all about?

    For the past weeks, we’ve been collecting sponsored gifts related to Unity (asset vouchers, product keys, conference tickets etc.), and throughout each day of December leading up to Christmas Day on the 25th , we will be sending out these sponsored gifts as early gamedev Christmas presents via e-mail to hundreds of lucky winners.

    The total prize pool is over $15.000, with over 350 presents in the prize pool. Merry Christmas from Pixel Crushers, Devdog, and every single one of the sponsors.


     
    Last edited: Nov 28, 2016
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    After Life - Story of a Father

    Check out Green Sawdust's After Life - Story of a Father, made with the Dialogue System and now available on Steam:



    On sale through December 2!
     
  48. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    ?? $15.00??
    Do you mean Fifteen Thousand or Fifteen?
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Over 40 developers have contributed asset store vouchers and other certificates totaling over fifteen thousand dollars in gifts that will be given away through the month of December.
     
    Mazak likes this.
  50. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    That is better :)