Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Dialogue System for Unity - easy conversations, quests, and more!

Discussion in 'Assets and Asset Store' started by TonyLi, Oct 12, 2013.

  1. Philostastically

    Philostastically

    Joined:
    Oct 12, 2012
    Posts:
    4
    I'm trying to use the OnConversationEnd message to call an animation after the dialogue has closed, but it doesn't seem to be calling OnConversationEnd once the dialogue has closed, as in your documentation. Rather it fires when the last line of dialogue is shown. Which, if you've got typewriter enabled could be a fair while before the dialogue closes. Is this is a bug? Is the documentation out of date? Is it likely I'm doing something wrong?
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Philostastically - The conversation is done when the last dialogue entry's sequence is done. It may be that the sequence is finishing before the typewriter effect. What if you set the last dialogue entry's Sequence field to:
    • Sequence: Delay({{end}})
    Since you sound like a programmer type, it might help to describe what's going on under the hood.

    To run a conversation, the Dialogue System uses a Model-View-Controller (MVC) architecture.
    • ConversationModel handles the data: variables, conditions, which link to follow, etc.
    • ConversationView handles the player's experience.
    • ConversationController coordinates between the model and view.
    To play a line of dialogue, ConversationView hands off its work to:
    • Dialogue UI: Shows the dialogue text (including typewriter).
    • Sequencer: Plays the dialogue entry's cutscene sequence (e.g., voiceover, lipsync, etc.).
    Then ConversationView waits until the Sequencer reports that it's done playing the sequence. It does not wait for anything from the dialogue UI. (The exception is if you're using a continue button. In this case it also waits for the player to click the continue button.) If the dialogue entry's Sequence field is blank, it will use the Dialogue Manager's Camera Settings > Default Sequence.

    Many of the sequencer commands finish immediately. For example, say a dialogue entry has this sequence:
    • Sequence: Audio(hello)
    The dialogue entry will kick off the audio and then immediately progress to the next stage in the conversation. To make the sequence wait until the audio clip finishes, use this instead:
    • Sequence: AudioWait(hello)
    Or, to wait for a duration based on the length of the text:
    • Sequence: Audio(hello); Delay({{end}})

    If that doesn't help, please feel free to post more details here or send a reproduction project to tony (at) pixelcrushers.com. I'll be happy to take a look.
     
  3. quesadillas

    quesadillas

    Joined:
    May 1, 2015
    Posts:
    23
    Ah, I forgot to reply to this earlier, but it's working now! I disabled what I was doing and tried your example and that worked, so I knew I had to be doing something wrong with my version. Since mine has an extra conversation interrupting in between, I wasn't doing the continue action at the right time. I was accidentally applying the continue command to the empty node at the beginning of my "interruption" conversation instead of the actual interrupted line. Now the way it functions is like this:
    [normal conversation] --timeout occurs----->[ "hey, what's going on?" ]------->[back to normal conversation, skipped current line]

    It works great! The only slight issue I have is that the text pops up for a quick second before it realizes that it has to continue to the options and not show that line's text anymore, but it's very slight and I don't currently need to address that issue.
    Thank you!!
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @quesadillas - I'm glad you got the issue sorted out! If you ever want to address the text pop issue, just let me know. I'm sure we can figure out a solution.
     
  5. Philostastically

    Philostastically

    Joined:
    Oct 12, 2012
    Posts:
    4
    Thanks @TonyLi this is a useful well-written post. I fixed my problem, the issue was with I was doing, not any of your stuff, but I'll definitely refer back to this post in the future.
     
  6. Corvwyn

    Corvwyn

    Joined:
    Nov 15, 2013
    Posts:
    114
    @TonyLi
    Hi.

    How's progress on the ink integration? I'm considering using ink, but I haven't quite decided. What is the most used tool for writing dialogue for use in the Dialogue System? Chat Mapper looks pretty good.
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Corvwyn - Ink integration will be coming, but for the next couple weeks I'm focused on getting Quest Machine out the door.

    Chat Mapper and articy:draft tie for most-used tool.

    Personally, I prefer Chat Mapper for writing dialogue because it supports localization and has better import/export features for things like voiceover scripts. (Make sure to get the cheaper indie license unless you need features in the other licenses.)

    If you're looking for a tool to manage the content of an entire project, not just dialogue, articy:draft may be a better fit.

    Other devs have also had good success with the Neverwinter Nights importer (including one game that clocked in at 500,000+ words) and even Google Sheets via the CSV importer.

    That said, for smaller games most devs just use the built-in Dialogue Editor window for the convenience of having everything contained inside the Unity ecosystem.
     
  8. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    Tell me more please!

    We are using Chat Mapper and tonight I will begin the Lua code and conditions. Since we are starting from scratch do you need a tester?
     
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Mazak - Quest Machine's WIP thread is here. I'll check the beta tester list. If there are any open slots, I'll add you to it.
     
  10. Corvwyn

    Corvwyn

    Joined:
    Nov 15, 2013
    Posts:
    114
    Looking forward to it.

    I'm making a narrative-heavy rpg, with a lot of dialogue and voiceovers, so I guess it would be a good idea to use something else than the built-in editor. I think I'll check out Chat Mapper and see how that works, and test ink when your Dialogue system supports it.
     
  11. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    Chat Mapper is great - get the indie version and carefully watch the videos for the clues you need.

    Speaking of that Tony, the Track and Abandon should be added to the template for quests for use in chat mapper, I noticed that last night.
     
    Last edited: Dec 7, 2016
    Corvwyn and TonyLi like this.
  12. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    Working with Chat Mapper can be a bit confusing, how to export, then import. The need for unity is a must... However we had a different goal in mind.

    The goal is the writer can be any one any where, they simply need access to the games streaming asset folder. No need for unity. We hope to use this also for language translations, give the user the chat mapper file, and let them work.

    My writer simply exports the XML file from chat mapper into the game's installed location StreamingAssetsPath/ChatMapper/Tutorial.xml file.

    Chat Mapper is great, once the location is saved once it is remembered for the future, so one button, then run the game as normal.

    I also put in the ability to download the tutorial.xml from the website to update all the users at startup.

    These functions are hidden in the documetation (sorry Tony, its not clear exactly what to do, it took a day to get this to work correctly)


    Code (CSharp):
    1.  
    2. public void Awake()
    3.         {
    4.             var filePath = Application.streamingAssetsPath + "/ChatMapper/Tutorial.xml";
    5.             var firstTry = ReadXmlDatabase(filePath);
    6.  
    7.             // well rats lets re-download the latest version.
    8.             if (firstTry) return;
    9.  
    10.             ErrorLogWriter.WriteError("First Try Unsuccessful");
    11.             string _patchLocation = "http://{WEBSITE}/download/tutorial.xml";
    12.  
    13.             try
    14.             {
    15.                 if (File.Exists(filePath))
    16.                     File.Delete(filePath);
    17.             }
    18.             catch (Exception kaboom)
    19.             {
    20.                 ErrorLogWriter.WriteError(kaboom.ToString());
    21.             }
    22.  
    23.             try
    24.             {
    25.                 using (var webClient = new WebClient())
    26.                 {
    27.                     webClient.DownloadFile(new Uri(_patchLocation), filePath);
    28.                     ReadXmlDatabase(filePath);
    29.                 }
    30.             }
    31.             catch (WebException kaboom)
    32.             {
    33.                 ErrorLogWriter.WriteError(kaboom.ToString());
    34.             }
    35.         }
    36.  
    37.         private bool ReadXmlDatabase(string filePath)
    38.         {
    39.             if (!File.Exists(filePath))
    40.             {
    41.                 ErrorLogWriter.WriteError(filePath + " not found");
    42.                 return false;
    43.             }
    44.  
    45.             ErrorLogWriter.WriteError("Tutorial.xml found - reading");
    46.             try
    47.             {
    48.                 var cmproj = PixelCrushers.DialogueSystem.ChatMapper.ChatMapperTools.Load(filePath);
    49.                 if (cmproj == null)
    50.                 {
    51.                     ErrorLogWriter.WriteError("Cannot load tutorial xml file");
    52.                     return false;
    53.                 }
    54.                 CreateDialogueDatabase(cmproj);
    55.                 return true;
    56.             }
    57.             catch (Exception kaboom)
    58.             {
    59.                 ErrorLogWriter.WriteError(kaboom.ToString());
    60.             }
    61.             return false;
    62.         }
    63.  
    64.         private void CreateDialogueDatabase(PixelCrushers.DialogueSystem.ChatMapper.ChatMapperProject chatMapperProject)
    65.         {
    66.             try
    67.             {
    68.                 if (DialogueManager.MasterDatabase != null)
    69.                     DialogueManager.RemoveDatabase(DialogueManager.MasterDatabase);
    70.                 DialogueManager.AddDatabase(chatMapperProject.ToDialogueDatabase());
    71.                 ErrorLogWriter.WriteError("Database read");
    72.             }
    73.             catch(Exception kaboom)
    74.             {
    75.                 ErrorLogWriter.WriteError("Cannot reload the database\n -> " + kaboom.ToString());
    76.             }
    77.         }
    78.  
     
    Last edited: Dec 7, 2016
    TonyLi likes this.
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Mazak - Thanks for the reminder! I'll make sure those are in there. BTW, the fields should be named:
    • Abandonable: specifies whether the quest log window should show an Abandon button for the quest.
    • Trackable: specifies whether the quest log window should show a Track toggle button for the quest.
    • Track: specifies whether the quest tracker HUD should show the quest.
    In the next release of the Dialogue System, instructions for importing Chat Mapper and articy:draft XML at runtime will be in the documentation. (At design time, devs can just use the Chat Mapper Converter or articy Converter window.) I think instructions are buried in a post on the Pixel Crushers forum, but I finally got them into the actual documentation.

    Hi @Corvwyn - The Last Door actually used the built-in editor, and that series has a lot of dialogue. But while I happily use the built-in editor for small to medium projects, I do prefer Chat Mapper for large projects. Chat Mapper and articy:draft have some nifty features like simulator mode that help authors test-run their content without having to touch Unity.
     
    Corvwyn and Mazak like this.
  14. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    Perfect, thanks!

    {I noted I spelled your name wrong sorry about that}
     
  15. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Hello- really enjoying using Dialogue System :) I have a question about managing conversation progress-

    Right now I'm setting variables in conversations to track whether a branch of dialogue has already been displayed- this works well- I did my tests with a single character and now I'm working with multiple characters- so I realized I can't use the same "alreadyTalkedTo" variable for all characters-

    So what would the best practice be? Should I create a variable for each character that tracks its conversation? For example- character "Buddy" and a bool variable "buddyAlreadyTalkedTo"- character "Jim" var "jimAlreadyTalkedTo" ?

    Or should I skip variables and use the quest system instead?

    Just looking for some guidance and best practices- Thank you.
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @mdotstrange - It's really up to your personal preference and workflow.
    • Variables are convenient because they're all in one place and easy to select from the Lua wizard dropdowns. If you preface all your Jim-related variables with "jim", you can group them together by sorting on name.

    • For fields like "AlreadyTalkedTo" that can apply to all actors, another option is to create a custom actor field. Then the condition would be something like:
      Actor["Jim"].AlreadyTalkedTo == true
      If you re-use conversations for multiple actors, you can even get fancy like this:
      Actor[Variable["Conversant"]].AlreadyTalkedTo == true
    There's also SimStatus, but that's overkill in most cases.
     
    Last edited: Dec 7, 2016
    imaginationrabbit likes this.
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    #UnityChristmas - Sign up if you haven't already

    Just a reminder that #UnityChristmas, which is sponsored by over 40 Asset Store publishers and organized by devdog, is still running through December 25. There are over $21,000 of prizes to win, including a Unite 2017 ticket and a 1-year Unity Pro license. Sign up here:

    http://christmas.devdog.io
     
  18. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Hi @TonyLi,

    I'm reading through the docs on how to build a World-space UI in DS and was wondering:

    May I instantiate a UI at runtime?

    I have lots of NPCs and interactable objects, and the examples provided seem to suggest to just store a copy of the dialogue UI within the dialoguer object.

    Still, I'd like to have just a few prefabs for the whole game, so that I don't have to tweak them one by one.

    Also, I already have a EventSystem in my scene, inside the on screen UI (a Persistent Singleton)
    May I reuse it, maybe moving it to another Singleton, and still expect it to work with all the UIs in the game, including all the canvases I may be instantiating dynamically (on scene start or on demand) in World Space?
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @NeatWolf - Yes, you can do that. (The examples store a copy of the dialogue UI within the Dialogue Manager because it's convenient, but it's not mandatory.) You can also re-use your EventSystem; that's fine, too.

    The Dialogue System provides a lot of options for working with dialogue UIs. It can get complicated, but I'd rather that devs have all the power and flexibility they need, rather than locking them into fewer, simplified options.

    If you add an instance of a world space UI to an NPC, use an Override Dialogue UI component to tell the Dialogue System to use that UI for the NPC. (To use multiple UIs simultaneously, such as a different UI for each participant, use Override Unity UI Dialogue UI Controls components as described here.)

    If you have a single world space UI that you'd like to move around to different NPCs, you can use the OnConversationStart script method. For example, you could add a script like this to the NPC:
    Code (csharp):
    1. public class RepositionDialogueUI : MonoBehaviour {
    2.  
    3.     void OnConversationStart(Transform actor) {
    4.         var canvas = (DialogueManager.DialogueUI as UnityUIDialogueUI).GetComponentInParent<Canvas>();
    5.         canvas.transform.SetParent(this.transform);
    6.     }
    7. }
    If you have questions on any of this, just let me know. Since every game has different UI needs (otherwise they would all look the same), UIs are the most complicated part of any product like the Dialogue System.


    EDIT: I forgot to mention the simplest case. To tell the Dialogue System to use a dialogue UI as the default, call DialogueManager.UseDialogueUI():
    Code (csharp):
    1. DialogueManager.UseDialogueUI(Instantiate("MyUI") as GameObject);
     
    Last edited: Dec 7, 2016
    NeatWolf likes this.
  20. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Thank you for the detailed reply- I have the variable method working now and will explore the custom actor field as well. Thank you.
     
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Happy to help! One thing I forgot to mention is that you can add the actor field on the Templates tab to have it automatically added to any new actors you create. On the Templates tab you can also tick a checkbox next to the field if you'd like it to appear in the main editing section for the actor and not just in the All Fields foldout.
     
  22. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Thanks @TonyLi, your support is priceless, among the best on the store so far, if not the best!

    I'm still not sure about the need of having one canvas per speaker, or a single one for everything. I also have to handle cases like "iconic speech bubbles", like a bubble that appears over a possible interactable point with an incon inside.
    I'm not sure if it would be better to have multiple canvases, one for each interactable object, or use the default UI, trying to translate world coordinates to ui coordinates and having all dialogues UI in a single UI.

    I don't know which is the easiest most supported approach.

    I also have to keep camera scaling into consideration since I may be going to zoom in and out from the scenes and all the UIs should be scaling accordingly to match the size of the screen (constant screen size). I believe there's already a Canvas scaler to do that.

    The game designer is asking me maybe an unusual approach, something like having the reminder NPC subtitle positioned right on top of the NPC, and on top of the player responses, but I'm still investigating :D
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @NeatWolf - Thanks! It might help to mock up a bunch of images for your designer that cover all of your game's use cases. This could help your designer narrow down your specs before you actually get down to implementing them in Unity and the Dialogue System.

    One advantage of a separate world space canvas for each speaker is that you can visually fine-tune its position according to the speaker's shape and size. If you keep the canvas a prefab, it will inherit changes that you make to the original prefab. That's what the Corgi example scene on the Dialogue System Extras page does.

    Then again, if none of the existing UI implementations fit your needs, it's pretty easy to write your own implementation of IDialogueUI, as described on this page. The Templates folder has a starter script with lots of comments. As long as you assign any implementation of IDialogueUI, the Dialogue System will work happily with it.
     
    NeatWolf likes this.
  24. airwick

    airwick

    Joined:
    Jul 15, 2013
    Posts:
    8
    Dialogue System Version 1.6.6.5
    Unity Version 5.4.1p1


    I'm having an issue when I add a Localization field to an entry. When I add a new field of type localization any time I try to change the name of the localization field It creates a new localization entry and I'm having a hard time deleting them.

    Edit: My main goal was to just use one entry for a localization key so I can use a separate localization plugin to overwrite the panel text. I figured I could just use a field with the localization type and get the key later with subtitle.dialogueEntry.LocalizedDialogueText.
     
    Last edited: Dec 8, 2016
  25. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Thanks again!

    I'm currently building a simple UI in world space for an interactable object, in a way similar to the one I will be using for dialogues

    Long story short: I'd need the dialogues to keep the same size on the screen whatever zoom, FOV or otrhosize I'm using.

    I wrote a simple script that scales the parent of the canvas by the orthosize of the main camera.
    I also had a look at the world space example of DE, and can't see any particular setup to handle interaction with world space interfaces (raycasting, etc).

    So I created a simple root object in the root of the scene, containing a simple canvas (with Canvas:world space, canvas scale and raycaster components) inside, and a simple image nested inside the canvas.

    Everything works fine when I zoom in/out, the image keeps a constant scale on screen even if it's in world space.

    Yet, I see that the DE examples with the UI react to the pointer position and clicks, while my basic sample does not react at all.

    Am I missing something?

    EDIT: nevermind, I realized a "Fader" object in the ScreenSpace UI was transparent, yet it received raycasts, so all interactions were caught by that invisible object
     
    Last edited: Dec 9, 2016
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @airwick - Sorry, that's a bug caused by the Dialogue Editor trying to be a little too helpful with recognizing localization fields and keeping them in memory. It'll be fixed in the next release. Here's the workaround to remove the field:
    1. Change the field type to Text.
    2. Change to a different tab, such as the Variables tab.
    3. Change back to the Conversations tab and delete the field.

    For this, you probably don't need a localization field. You can use a regular text field. Let's say you name the field "localizationKey". You can tie in your other localization plugin by adding a script with an OnConversationLine method to the Dialogue Manager:
    Code (csharp):
    1. void OnConversationLine(Subtitle subtitle)
    2. {
    3.     var localizationKey = Field.LookupValue(subtitle.dialogueEntry.fields, "localizationKey");
    4.     var localizedText = /* get your text from the plugin using localizationKey */
    5.     subtitle.formattedText.text = localizedText;
    6. }
    If you use different markup tags in each localized version of the text, in the last line of code above you can run it through FormattedText.Parse() instead:
    Code (csharp):
    1. subtitle.formattedText = FormattedText.Parse(localizedText, DialogueManager.MasterDatabase.emphasisSettings);
     
  27. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @NeatWolf - Is a camera assigned to your canvas? World Space and Screen Space - Camera canvases require a camera for interaction.

    Side note: It's helpful to keep the EventSystem selected in the Inspector view while debugging Unity UI issues. At runtime, the EventSystem's inspector shows what's currently hovered, selected, clicked, etc. This might also tell you if another UI element (even an invisible panel) is blocking mouse input.

    EDIT: Glad you found the issue. I forgot about Corgi's Fader. In the example scene, I think I disabled its raycast blocking.
     
    Last edited: Dec 9, 2016
    NeatWolf likes this.
  28. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Yup, exactly, that's how I was able to tell what was blocking the raycast. I may still want to be blocking everything until the alpha value reaches 0f or 0.5f, a simple script would do the job.

    The designer asked me, when the responses appear in a dialogue, and the player selects one of those, everything but the chosen answer should fade, leaving just the selected answer to be visible, instead of repeating it in an successive bubble box. After the fade, I should keep visible the remaining response for a certain time, and only then continuing the normal dialogue flow.

    Now, for the first part, I believe I should momentarily reparent the chosen answer to the canvas (crossing my fingers it stays anchored to the same point without changing anything), and fading the remaining with a canvas group. And then forcing a delay (maybe also fading gracefully the chosen answer) before continuing.

    I believe I could use the sequencer to do that. Fact is: of course I can't copypaste a sequence every time a response is needed: can I set a sequence (a custom one, probably) only when a response is required? I should probably restore the dialogue UI hierarchy after the fading: where and how should I do this?
     
  29. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    (PS: the linked font in the readme inside th Mobile UI for Unity UI prefabs doesn't exist anymore:
    /*
    The Mobile UI prefabs are built to use the FontStruction �RM Playtime solid�
    font (http://fontstruct.fontshop.com/fontstructions/show/235248) by Ray Meadows
    and available under Creative Commons Attribution No Derivatives.

    To prevent the need for the Unity Asset Store to show a license confirmation
    window when downloading the Dialogue System for Unity, the font is NOT included
    in the Dialogue System package. You can download it from the link above, or
    you can assign a different font such as Arial to the Text elements.
    */
    )

    EDIT:
    I did some research:
    it's here http://www.dafont.com/rm-playtime.font "For personal use only"
    And here's another link to the RM Playtime solid but this time with a "CC BY-ND 3.0" license : https://smartfonts.com/rm-playtime-solid-fs1-0.font
    Here you can find more about the author: http://luc.devroye.org/fonts-51729.html
    Here's a list of the RM Playtime font family: https://smartfonts.com/rm-playtime.font-family

    Since the same font is available with different licensing options, I think that if someone really needs it, could contact the author himself and ask to buy a commercial license without credit attribution.

    Also, the CC BY-ND 3.0 version seems like it can be redistributed, but please check the link above :)
    Its license says (but please check yourself the link as this may be my personal interpretation :p ):

    CC BY-ND 3.0 license License type: Commercial Free

    You are free to:

    Share — copy and redistribute the material in any medium or format for any purpose, even commercially. The licensor cannot revoke these freedoms as long as you follow the license terms.

    Under the following terms:

    Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

    NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.

    No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

    Notices: You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation. No warranties are given.

    The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material. https://creativecommons.org/licenses/by-nd/3.0/legalcode"

    And here's a list of commercial free (still, check each individual license) similar to that font:
    https://smartfonts.com/library?similarTo=RM Playtime solid FS1.0&license=Commercial Free
     
    Last edited: Dec 9, 2016
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Possible Delayed Support This Weekend

    I'll be participating in Ludum Dare 37 this weekend, so support response times might be a little slower than average. I'll still get to all support questions every day, though.


    @NeatWolf - Thanks for posting your research on the Playtime font. It's a shame the license changed, but there are plenty of other fonts that look good with the mobile UI graphics that are free for commercial use.


    For your dialogue UI, you might need to write a subclass of UnityUIDialogueUI that overrides the HideResponses method. By default, this method deactivates the response panel (if assigned) and the response menu buttons. If I can make the time this weekend, I'll send you an example.
     
    NeatWolf likes this.
  31. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Yay! Cool, come back winner! ;)

    I actually got in touch with the font creator and he said that he had to change the name of the font: there's only one font now, and it's purchasable, for commercial use.

    Cool! An example would be great. I'm still experimenting with the UIs and the package. I'll be definitely putting DE in my CV once that I've mastered it! :D
     
    TonyLi likes this.
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @NeatWolf - Here's an example:

    Corgi3_Example2_2016-12-09.unitypackage

    I made a subclass of UnityUIDialogueUI called FadeResponseDialogueUI. It keeps the response menu visible and fades all but the selected response. The response button template also has a script called RecordClickedButtonInDialogueUI that works in conjunction with FadeResponseDialogueUI.

    The fade runs a coroutine on a CanvasGroup. I would have preferred to use an Animator on the button, but Unity UI has a bug where Buttons don't play nicely with Animators on the same GameObject. You can adjust duration on the coroutine by inspecting the FadeResponseDialogueUI.

    This isn't necessary with the solution above, but I wanted to answer your question anyway. Yes. You can write a script that has OnConversationLine and/or OnConversationResponseMenu methods and change the sequences in the subtitle and/or response parameters.

    Since buttons are instantiated for each response menu, there's no need to restore the hierarchy in the solution above. But if you were to add new GameObjects at runtime to the subtitle panels, you could clean them up in OnConversationLine or OnConversationResponse methods, or by subclassing UnityUIDialogueUI.[/quote][/QUOTE]
     
    NeatWolf likes this.
  33. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    [/QUOTE][/QUOTE]
    Hi Tony,

    you're a saint, thank you!

    Still, there seem to be a few problems with the example scene.
    The mouse input doesn't seem to work well (and it does in the previous corgi example it does, on the same project)
    as the hovering only works in the first response, but doesn't work at all when there's only one response. I could only test it by using directional keys.

    The first corgi example works well, but if I speak to the nearest NPC whe starting I get a:

    Code (CSharp):
    1. Parameter '53686f77' does not exist.
    2. UnityEngine.Animator:ResetTrigger(String)
    3. PixelCrushers.DialogueSystem.UIShowHideController:ClearTrigger(String) (at Assets/Dialogue System/Scripts/Supplemental/UI/Tools/UIShowHideController.cs:104)
    4. PixelCrushers.DialogueSystem.UnityUIAlertControls:HidePanel() (at Assets/Dialogue System/Scripts/Supplemental/UI/Dialogue UI/UnityUIAlertControls.cs:88)
    5. PixelCrushers.DialogueSystem.UnityUIAlertControls:SetActive(Boolean) (at Assets/Dialogue System/Scripts/Supplemental/UI/Dialogue UI/UnityUIAlertControls.cs:70)
    6. PixelCrushers.DialogueSystem.AbstractUIControls:Hide()
    7. PixelCrushers.DialogueSystem.AbstractDialogueUI:Start()
    8.  
    So I had to comment that line to make everything work. In the first example it wasn't necessary.

    By walking to the second NPC, I can only move left in the dialogue, the controls seems to be masked in some way.

    The third NPC seems to work, but I can't hover on other multiple options bubbles/square anymore. It still works on the first example.

    I'm a bit confused: the Canvas nested inside the DialogueManager is totally different from the one which is actually getting shown. Am I missing something? Is that interface somehow overriden by each NPC?
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hmm, I didn't make any changes to input handling. Does input work in the previous Corgi example within the same project? Maybe the project's input settings changed recently.

    It looks like the animator controller's reference to the animation clip asset didn't import properly. Sometimes this happens when you're importing from different versions of Unity than the source package was exported from and if the serialization modes are different between the projects. The main Dialogue System projects use Force Text serialization to prevent this issue, but the original Corgi example (since it wasn't originally an "official" project) may have defaulted to Mixed serialization. Please try deleting and reimporting these folders:

    Dialogue System/Prefabs/Unity UI Prefabs/Animation
    Dialogue System Examples/Corgi Example & Corgi Example 2

    I should have mentioned that I didn't make any changes to the second or third NPCs. I only set up the first one to demonstrate fading.

    Yes. If you inspect each NPC, drill down to ConversationZone > Dialogue UI. This child GameObject has an Override Unity UI Dialogue Controls. This tells the Dialogue Manager's dialogue UI to use a different set of UI controls for this NPC.
     
    NeatWolf likes this.
  35. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Nope, it is the same. The first Corgi Examples scene you created some time ago still work, the new one don't.

    I also upgraded Corgi Engine with the latest hotfix (still retaining the same project settings) because I thought you updated it as well, but nothing has changed.


    I'll try, but as I said, Corgi Example 1 still works just as fine in the same project, and doesn't fire any errors or warnings, so this is probably something scene/code specific.

    I don't know what to say, I'll be probably going to make a video to demonstrate the weird behaviour. Maybe the scene/script setup is different, or something is masking the input. I'll check it out.

    Cool, so this means I could create a prototype for dialogues and just reskin them? I thought the override function was more hierarchy related, but good to know.

    I'm sorry about the questions and the requests, I read the docs several times and I'm really trying to get the hang on DE but there's really a lot of content to get used to ^_^"
     
  36. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    I just discovered that everything works just as fine if I maximize the Game window.

    When the Game window is scaled down and docked, something goes wrong, the dialogue buttons don't receive the input properly, or something is masking other components.

    So I believe it's something related to scaling or masking.

    Corgi Example 1 doesn't have this issues tho. I keep investigating.
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Ah, thank you. That's a good clue. I'll look into it. There may be a scaling issue that's causing mouse input to go off course.
     
  38. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    I have a weird one.
    The sub tasks are not working right.

    See the debug screen.

    Dialog System Version 1.6.6.5 Unity 5.5.0f3 Chat Mapper 1.9.1.0

    Attached is
    1. The png of the debugger
    2. The export from chat mapper.

    I created a new project opened the source, then in my main project deleted the dll folder and dropped in the scripts folder.

    Using the source, the value is 3 not zero (in the debugger) but I have to relink all my prefabs <argh>

    Any ideas?
     

    Attached Files:

  39. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    I think I see it.. Entry Count should be Entry_Count - testing
     
  40. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    Should all these custom fields use an '_' ??

    upload_2016-12-15_23-0-36.png
     
  41. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    That did not help at all.. could it be in the importer?.. checking that next.

    upload_2016-12-15_23-10-34.png
     
  42. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    In QuestLog

    public static int GetQuestEntryCount(string questName) {
    return DialogueLua.GetQuestField(questName, "Entry_Count").AsInt;
    }

    I think the "Entry_Count" should be "Entry Count"
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Mazak - Underscores shouldn't matter in this case, since all spaces in table fields are converted to underscores anyway. But I see that in your database Entry_Count's value is 0. I'll check the Chat Mapper converter with the versions of Unity and Chat Mapper that you listed and get back to you ASAP.


    Sorry about the source/DLL references. That's a documented caveat on the Importing Source Code page. I'm working on a tool to automatically update references, but it's not in the latest version of the Dialogue System yet.
     
  44. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    I tried so many things last night, I might have sent the wrong file...
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    It might be a Unity 5.5.0 thing. If so, any necessary fix will be in version 1.6.7, which I plan to publish this weekend.
     
  46. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    I redid the test - the debugger still matches the above screen shots:

    Remember I am updating the data via the code I placed above - reading the xml file on the fly

    If I manually use the converter off the menu this is what I get:
    upload_2016-12-16_8-22-34.png

    So it looks right in the UI - the same as if I were to create it manually

    So if I turn off my code to import the xml and hard wire it to the converted file, I still get zero
     

    Attached Files:

  47. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    If you can find the issue and email me the package (I can supply my invoice # if you like) that would be fantastic, the tutorial is the final piece to shipping by the end of the month

    I will be watching the forums all day so if you have any suggestions let me know
     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Do you perhaps have a database already loaded into memory that has the same quest? If so, adding another database (such as a runtime-converted Chat Mapper project) will not overwrite the quest. If this is the case, and the quest in the original database has Entry Count = 0, then it will stay as Entry Count = 0.

    If that's not the case, would it be possible for you to send a reproduction project to tony (at) pixelcrushers.com?

    I'll also try to reproduce it on my own here using the runtime converter.

    Another thing that might be helpful is to use a Lua Console. If you add it to your scene, press ~+L to open the Lua console window. Then enter a Lua statement such as:

    return Quest["QuickStart"].Entry_Count

    to print the entry count, or this"

    return Quest["QuickStart"]

    to show all the fields.
     
  49. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    No, the database is not wired up in the DialogManager.

    I included both the xml and the asset files.(they are renamed to .txt)

    Open a new project use the two file supplied above

    Let me know if that works. if it does I will examine a way to get you the project.

    I will try a lua console later today (I'm at my 'real' job right now)
     
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    If you wouldn't mind sending a repro project when you get back, that would be great. I haven't been able to reproduce it here. Here's my test case:

    TestCmpRuntime_2016-12-16.unitypackage

    It produces this output in the quest tracker HUD:



    This is in a new, empty Unity 5.5.0f3 project into which I imported the Dialogue System 1.6.6.5.

    The script does this:
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using PixelCrushers.DialogueSystem;
    4.  
    5. public class TestRuntime : MonoBehaviour {
    6.  
    7.     public TextAsset xmlFile;
    8.  
    9.     IEnumerator Start () {
    10.         yield return null;
    11.         var chatMapperProject = PixelCrushers.DialogueSystem.ChatMapper.ChatMapperTools.Load(xmlFile);
    12.         var db = ChatMapperToDialogueDatabase.ConvertToDialogueDatabase(chatMapperProject);
    13.         DialogueManager.AddDatabase(db);
    14.         DialogueManager.SendUpdateTracker();
    15.     }
    16. }
    I also tested:
    Code (csharp):
    1. var db = chatMapperProject.ToDialogueDatabase();
    2. DialogueManager.RemoveDatabase(DialogueManager.MasterDatabase);
    3. DialogueManager.AddDatabase(db);
    with the same results. I didn't write any code to download the XML from the web or a local file since it looks like the problem is well beyond that point.
     
    Mazak likes this.