Search Unity

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

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

  1. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    I would love a tutorial on how to use your cutscene sequencer.
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Great! That just happens to be the next one in the pipe. In the meantime, you can find lots of info here in text format: Cutscene Sequences.
     
    BackwoodsGaming and hopeful like this.
  3. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    I learn best by example :)
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Dialogue System - Cutscene Sequences Tutorials

    These are parts 1 & 2 of the sequencer tutorials.





    I'm going to be traveling next week (but will still provide support on the forums and email), so the remaining tutorials will arrive the following week or so.
     
    BackwoodsGaming likes this.
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Sep 10-17 Out of Office

    I'll be traveling September 10-17, 2018. I'll still be checking email and forums daily and will do my best to reply to support requests quickly, but responses may take a little longer than usual.
     
    lawsochi likes this.
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Dialogue System for Unity 2.0.4 Patch 2018-09-09 Available

    A small patch for version 2.0.4 is available on the Pixel Crushers customer download site. If you need this patch and need access to the site, please PM me your Asset Store invoice number.

    Patch Notes:
    • Fixed: Lua math.random(x) now correctly return values [1..x] instead of [0..x].
    • Fixed: TextMesh Pro Typewriter Effect wasn’t using alternate audio clips.
    • Input Device Manager: Added Control Graphic Raycasters checkbox.
    • Standard & Unity UI dialogue UIs & quest log windows: Added Add EventSystem If Needed checkbox.
    • articy:draft: Instructions and Jumps are now converted as blank nodes with None() sequences instead of Group nodes.
    • Invector Controller: Added vAddItemByID() Lua function.
     
  8. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Thanks Tony! I can't wait for the rest of your Cutscene tutorials.
     
  9. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    Relax and have some fun! :D
     
    BackwoodsGaming and TonyLi like this.
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Summer Sale 2018 Ends Today

    This is just a quick reminder that the Asset Store's Summer Sale 2018 ends today. If the Dialogue System for Unity is on your wishlist, get it today while it's still on sale.

    Side note: Quest Machine is a completely separate product (although it has integration with the Dialogue System), but I set it up as an "upgrade" on the Asset Store. If you already own the Dialogue System, you can get Quest Machine for 50% off.
     
    BackwoodsGaming likes this.
  11. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Thanks for the heads up, I just grabbed the asset. I have two questions though.

    Firstly I'm trying to register for the forums on your site but it keeps telling me "The submitted form was invalid. Try submitting again. The confirmation code you entered was incorrect." despite the fact that I'm very sure that I'm filling in the captcha correctly.

    Pic https://imgur.com/a/kQ4ysEv

    Secondly Is there a way to 'filter' the things listed in lua conditions wizard? For example I made a couple of actors with unique variables embedded in them.

    Actor A has 3 variables
    -Met Actor A
    -Was rude to Actor A
    -Was nice to Actor A

    Actor B has 3 variables
    -Met Actor B
    -Attacked Actor B
    -Spared Actor B

    When using the conditions (lua?) wizard in the dialogue window while writing dialogue for Actor A it I will select "..." by conditions to open the wizard, then click on the "+" to add a new condition. Following I will select "Actor" - "Actor A" but in the last slot which lists the variables themselves (Met, nice, rude), despite having selected Actor A it will also list out the conditions for Actor B as well, (Met, attacked, spared) even though these are completely different conditions that Actor A does not share.

    It's a trivial issue for now, but I can imagine it becoming rather unwieldy to search through once several dozen actors and variables come into play.

    Thank you for your time.
     
    Last edited: Sep 11, 2018
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Thanks!

    Would you please try clearing your cookies and navigating to https://pixelcrushers.com/phpbb ? We recently enabled SSL, and we're still working out the kinks. In all the cases we've had so far, those steps have allowed people to register and log in.

    Not currently, but I can add that in a future release. Currently it shows all custom fields for all actors. The logic was that, if you added a custom field such as "Currency" or "Level" for one actor, odds are that you may want to use the same field for other actors, too.
     
  13. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    I tried clearing my cookies and using your link but that didn't work either. But once I tried it over my phone instead I managed to get through, so everything is good now. Thanks!

    Edit - or not? I can't seem to log in (on my pc) despite having made the account. I input my login data and it seems to accept it and places me on the forum, but I'm still not logged in. I'll fiddle around with it for a while and get back to you. Sorry to bother you on your vacation.

    Edit 2 - Man I have no clue. It lets me log in without issue on my phone (Dolphin browser, Samsung s7) but chrome and firefox on my desktop just aren't having it. Guess I'll just rough it for now. xD
     
    Last edited: Sep 11, 2018
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Thank you for these clues. I'm sorry it's still giving you trouble. I'll pass this along to the person who's helping set up SSL, and we'll see if we can get to the bottom of it.

    In the meantime, please feel free to post any questions here, or email me directly at tony (at) pixelcrushers.com.
     
    Last edited: Sep 11, 2018
  15. Stonepunsh-Studio

    Stonepunsh-Studio

    Joined:
    Jan 7, 2018
    Posts:
    5
    Wow. Thank you so much for this detailed answer. Sadly i missed the sale last week but i am happy to pay even the normal price for such an awesome tool and even better support. So i played a bit around with the Evaluation Edition and i noticed a bug (?) when i made a very basic test scene:

    Why is the secound line of the text a bit cut out?
    And one more small question i came up with is how i can let the player skip a line with the Space key but the player can´t skip decisions. Because if i press the skip button when i need to make a decision the dialog just ends

    Thank you very much ^^
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi,
    That's the fallback dialogue UI. It's used if no dialogue UI GameObject or prefab is assigned to the Dialogue Manager. It only allows for one line of text per response. Your response node probably has a newline at the end, making it 2 lines long. If you start with the Dialogue Manager prefab located in Plugins / Pixel Crushers / Dialogue System / Prefabs (as shown in the Quick Start tutorial), you'll get a nicer basic dialogue UI that scales.

    There are two ways to skip. The first is to use the Dialogue Manager's Input Settings > Cancel and Cancel Conversation inputs. By default, they're both mapped to the Escape key. Many devs map them to None instead, to prevent the player from cancelling the conversation.

    The second way is to enable the continue button. To do this, set the Dialogue Manager's Subtitle Settings > Continue Button dropdown to Always. The basic dialogue UI provided with the prefab fast-forwards text on the first click if it's still typing. On the second click, or if it's done typing already, it skips to the next stage of the conversation.

    If you tick the Dialogue Manager's Input Device Manager > Always Auto Focus checkbox, it will focus the continue button so the Space key will click it. Alternatively, you can add a UI Button Key Trigger to the button and set the Key to Space.

    Using this second method (Continue Button), the player can't cancel the conversation unless the Dialogue Manager > Input Settings > Cancel Conversation input is pressed (which you can set to None to disable).
     
  17. Stonepunsh-Studio

    Stonepunsh-Studio

    Joined:
    Jan 7, 2018
    Posts:
    5
    Still so impressed by the support you offer. ^^ My last question for the next weeks (at least i hope so) is that i thought about how to handle a huge structure of dialogs. I mean we will have a big amount of dialogs in our game and a non linear story. Our game is about you being a judge and i thought about making a database for every single trial but this could make some problems with the Variables and actors and all that stuff. How would you suggest to handle that? Because making more then 200 dialogs in one database will be pretty hard to keep organized.
    Btw is there a C# function to change the database of the dialog manager? Didn´t find one in the documentation.
     
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi,
    200 conversations in one group is hard to manage. But you can use forward slashes ( / ) in conversation titles to group them into submenus. For example:
    • OJ Simpson Trial/Opening Statements
    • OJ Simpson Trial/If The Glove Does Not Fit
    • OJ Simpson Trial/Verdict
    • Brown v Board of Education/Opening Argument
    • Brown v Board of Education/Majority Opinion
    • Brown v Board of Education/Dissenting Opinion
    • etc.
    This can make 200+ conversations easy to manage in a single database. A single database is the easiest to work with. But it's possible to work with multiple databases:

    Yes, use DialogueManager.AddDatabase(). See Working with Multiple Databases for info about using multiple databases. In particular, you can use the Sync feature to share variables etc. between databases. Use the Unique ID Tool to ensure that internal IDs are unique across the databases. And use an Extra Databases if you want to load more databases without scripting.
     
    BackwoodsGaming likes this.
  19. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Hey, sorry to be such a bother but I have a few more questions if that's okay.

    Firstly is there anything that can be done about substantial slowdown in a large variables menu or in the conversation editor during particularly long conversations? It's likely my own fault though given my use of what are probably inefficient practices, seeing as I already have a rather beefy collection of variables; probably around over 60. Basically when opening the variables menu the editor slows down to a crawl until I switch to a different tab, the same thing happens if I try to edit a particular conversation that is about 400 nodes long. I have pretty strong hardware so I'm not sure what I can do to smooth this out.

    Secondly, I would like to change the audio clip for the Unity UI Typewriter effect found on the Subtitle Line game-object mid-dialogue. I want to do this basically every time the current talking actor changes in order to give the different actors unique gibberish 'voices' similar to the Animal Crossing games or the Banjo-Kazooie series. What would you recommend to achieve this?

    Finally, say I have an integer variable called "Collectables" starting at 0. I would like to create a ui button game-object that when clicked during gameplay, adds +1 to said variable. Is there any easy way to do this? Because I'm not really capable of writing a c# script.

    Thank you for your time! :)
     
    Last edited: Sep 16, 2018
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Candy-Bomber - I can look into optimizing the conversation node editor more, but the speed of the variables table is a factor of Unity's editor functions. You can speed up the variables table by setting a filter. This will allow Unity's editor functions to draw a smaller subset of variables. For the conversation editor, you can split your conversation into multiple smaller conversations, such as one for each topic that the NPC can talk about. Then you can use cross-conversation links to connect them. Remember to use forward slashes ( / ) in conversation titles to group them into submenus -- for example, a submenu for each NPC containing all of its topic conversations. I prefer to do this anyway because it keeps things tidier and more organized.

    Here are two ways to do this:

    1. Set up a different subtitle panel for each actor, with its own subtitle text element and typewriter effect. Then you can assign a unique set of gibberish audio clips to each one. Add a Dialogue Actor component to each actor so you can specify which subtitle panel to use.

    2. Or use a single subtitle panel, and assign a C# method to the typewriter effect's OnBegin() UnityEvent. In this method, set the gibberish audio clips according to the current actor. If you're not comfortable with C# scripting, you may need to use suggestion #1 above.

    If this is a Dialogue System variable, then you can add a Dialogue System Trigger to the UI button:
    • Set the Trigger to OnUse.
    • Select Add Action > Run Lua Code.
    • Click "..." to open the dropdown menus. Select:
      Variable > Collectables > Add > 1
      Then click Apply.
    Finally, set the UI button's OnClick method to call the Dialogue System Trigger's OnUse method.
     
  21. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Thank you. You're a saint!
     
    flashframe likes this.
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Always happy to help!
     
    flashframe likes this.
  23. Rotary-Heart

    Rotary-Heart

    Joined:
    Dec 18, 2012
    Posts:
    813
    I'm giving a try to your evaluation plugin and it's amazing. I'm only having 1 question about it.

    Is there anyway I could make the player dialogue text to not be a selection? (Something like a checkbox or something that marks this dialogue entry as an input) I'm trying to use it in a way where the user can select what to say and then the player and the npc talk a little by themselves before needing the user input again. Tried searching on the help section and couldn't find anything like that.
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Rotary-Heart - Thanks for trying the evaluation! There are two ways:

    1. Inspect the Dialogue Manager, and untick Input Settings > Always Force Response Menu. When this is unticked and there is only one player node, that node will play automatically instead of showing as a single-button response menu. You may want to tick Subtitle Settings > Show PC Subtitles With Line, too.

    2. Or, include the special markup tag "[auto]" in your Dialogue Text. This will automatically play the node instead of showing a response menu.
     
    Rotary-Heart likes this.
  25. Rotary-Heart

    Rotary-Heart

    Joined:
    Dec 18, 2012
    Posts:
    813
    Well that was incredibly easier than expected! Thanks for a fast response!
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Glad to help!
     
  27. romandutov

    romandutov

    Joined:
    Sep 18, 2015
    Posts:
    16
    Hello @TonyLi. How can implementation skip button in dialog conversation?
    https://imgur.com/a/wmPpUuw
    Code (CSharp):
    1. public virtual void OnContinueConversation()
    2. {
    3.     if (isOpen) DialogueManager.instance.SendMessage(DialogueSystemMessages.OnConversationContinue, (IDialogueUI)this, SendMessageOptions.DontRequireReceiver);
    4. }
    DialogueSystemMessages class doesn't contains some message for skip, constant string OnConversationContinueAll works as usually Continue.
    =====
    I would like to be able to skip up to the specified entryID, as it did for example in the timeline startConversationPlayable
     
    Last edited: Sep 27, 2018
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @romandutov - The Dialogue Manager has two built-in ways to skip:
    • The first is the Dialogue Manager's Input Settings > Cancel input. If the player presses this input while a subtitle is showing, it will cancel the subtitle and progress to the next stage in the conversation.
    • The second is the continue button. If you've set the Dialogue Manager's Subtitle Settings > Continue Button mode, for example to Always, it will show the subtitle panel's continue button. The subtitle will wait until the player clicks the continue button or the sequencer command Continue() is called.

    It looks like you want to skip to a specific entry through code. If this is the case, you can use code similar to below. It jumps to conversation ID 1, dialogue entry ID 6:

    Code (csharp):
    1. var entry = DialogueManager.masterDatabase.GetDialogueEntry(1, 6);
    2. var state = DialogueManager.conversationModel.GetState(entry);
    3. DialogueManager.conversationController.GotoState(state);
    This assumes that a conversation is active. If a conversation isn't active, instead use DialogueManager.StartConversation() and specify the entry ID:

    Code (csharp):
    1. DialogueManager.StartConversation("MyConversation", player, npc, 6);
     
  29. romandutov

    romandutov

    Joined:
    Sep 18, 2015
    Posts:
    16
    Thanks, that's worked ;) I made an additional field in the database "SkipTo" for config.


    Code (CSharp):
    1.  
    2. public void OnSkipForward()
    3.     {
    4.         if (typewriterEffect != null)
    5.             typewriterEffect.Stop();
    6.        
    7.         if (runtimeDialogueUI != null && runtimeDialogueUI.isOpen)
    8.         {
    9.             var currentDialogEntry = DialogueManager.CurrentConversationState.subtitle.dialogueEntry;
    10.             var skipTo = Field.LookupInt(currentDialogEntry.fields, "SkipTo");
    11.  
    12.             if (skipTo != -1)
    13.             {
    14.                 var entry = DialogueManager.masterDatabase.GetDialogueEntry(DialogueManager.LastConversationID, skipTo);
    15.                 var state = DialogueManager.conversationModel.GetState(entry);
    16.                 DialogueManager.conversationController.GotoState(state);  
    17.             }
    18.         }    
    19.     }
    20.  
     
    TonyLi likes this.
  30. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    Hi,I am using UCC and Dialogue System, they all use WASD and Arrow keys, I want to separate them. For example, UCC uses WASD key to move, Dialogue System uses Arrow keys to select dialogue.
     
  31. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Any plans to support the new Ultimate Character Controller from Opsive? I'm looking to upgrading my UFPS to v2 but am hesitant cause I'll lose all the convenient integration. Although I don't think that integrating this with UFPS is too difficult being I'm sure it's just firing an event from an interact object.
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @AngelBeatsZzz - Yes, you can do this. The Dialogue System uses Unity's EventSystem. By default, the EventSystem has a StandardInputModule. The StandardInputModule navigates UIs by reading from the input axes specified by its Horizontal and Vertical properties. These properties' default values are "Horizontal" and "Vertical", meaning they read from the "Horizontal" and "Vertical" input definitions. If you select Edit > Project Settings > Input, you can see that these input definitions are mapped to WASD and the arrow keys.

    You can define new input definitions such as "UIHorizontal" and "UIVertical" that only read the arrow keys, and then assign them to the StandardInputModule.

    Hi @DespairBear - Yes! I'm just finishing it up. UCC's modular design, with definable states and presets, makes for a very clean integration. You can also save characters' position, attributes, and inventory, and adjust them using Lua functions in your conversations and Dialogue System Triggers. I plan to send the integration to Opsive today for a final look-over, so it should be available very soon.
     
  33. dyuldashev

    dyuldashev

    Joined:
    Mar 3, 2016
    Posts:
    76
    Hello. I am getting this error on Mac OS (Unity 2017.4.2f):
    "Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Interpreter/LuaInterpreter.cs(5,20): error CS0234: The type or namespace name `Library' does not exist in the namespace `Language.Lua'. Are you missing an assembly reference?"
    It is basically saying that Language.Lua does not contain Library--->there is not Language.Lua.Library in other words.
    Would you please help?
    Thanks...
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @dyuldashev - Did you perhaps pull down the project from a repository? It's likely that your version control system is configured to ignore folders named 'Library'. To fix this, import the Dialogue System from the Asset Store.

    In the upcoming version 2.0.5, the Lua 'Library' folder named been renamed to 'LuaLibrary' to avoid this issue.
     
  35. Smiff

    Smiff

    Joined:
    Jan 25, 2013
    Posts:
    2
    Hi Tony,

    First off, I love your Dialogue System. It's served me well during development of my mobile game.

    Secondly, I've got a functionality question. Is there a way to achieve shaking text like you see in many JRPGs? Here's an example:


    Thanks in advance for any assistance you can offer.
    -Smiff
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Smiff - Thanks! For interesting text effects like this, I recommend TextMesh Pro (TMP). It's built into Unity, and the Dialogue System has native support for it. The upcoming version 2.0.5's documentation has more detail about TMP support. I'll paste it here:

    The Dialogue System's Standard UI system natively supports TextMesh Pro as well as regular UI Text. Depending on the version of Unity and TextMesh Pro you're using, you may need to add TMP_PRESENT to your project's scripting define symbols to enable support. To do this, select Edit → Project Settings → Player. In the Other Settings section, add TMP_PRESENT to the Scripting Define Symbols field. If this field already contains text, put a semicolon between the existing text and TMP_PRESENT.

    If the TextMesh Pro Typewriter Effect still isn't available after adding the symbol, right-click on Plugins ► Pixel Crushers ► Dialogue System ► Scriptsand click Reimport. Then do the same for Plugins ► Pixel Crushers ► Dialogue System ► Wrappers.

    If you want to adapt one of the existing prefabs for TextMesh Pro, add an instance of the prefab to a Canvas in your scene, such as the Dialogue Manager's Canvas.

    When you add the template to the scene (in a Canvas), the Standard Dialogue UI, Standard UI Subtitle Panel, or Standard UI Menu Panel fields will look like this:

    textField1.png

    Unassign the field. The field will change into this:

    textField2.png

    Then you can remove the UI Text component from the NPC Subtitle Line GameObject, add a TextMeshProUGUI, and assign it to the field. If you want to use a typewriter effect, you can also remove the Unity UI Typewriter Effect from the GameObject and add a Text Mesh Pro Typewriter Effect.

    Note: The evaluation version is compiled without TextMesh Pro support.

    TMP's example scenes include examples of shaky text, color cycling, and more.
     
  37. Smiff

    Smiff

    Joined:
    Jan 25, 2013
    Posts:
    2
    Many thanks, Tony. I've been using TMPro but wasn't aware about the native support. Thanks again for the great asset and the wonderful tutorial videos. Cheers!
     
    TonyLi likes this.
  38. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    I've found a bug in version 2.0.1, also present in 2.0.4:

    I was noticing that everything was working fine until I changed my project to use the .NET 4.x API, instead of the old 3.5.

    when I did the change, the conversation dialogue entries started to show too quickly, instead of waiting for the last entry subtitle to completely show (with typewriter effect) they appear suddenly before, like they are not respecting the "Delay({{end}})" default sequence.

    doing some debugging I found out the reason:

    - {{end}} translates to characters_in_subtitle / SubtitleCharsPerSecond with SubtitleCharsPerSecond as defined in the Dialogue Manager.

    for some reason it works fine in .NET 3.5, but in .4.x I get this messages when I turn on debugging (notice that I set SubtitleCharsPerSecond to a very low value to see the problem clearly):

    Dialogue System: Sequencer.Play( Delay(3, 8)@0 )
    UnityEngine.Debug:Log(Object)



    SubtitleCharsPerSecond is set to 5, and the specific dialogue entry that executed that Delay sequencer command was a 19 characters long text. so 19 / 5 = 3.8.

    So the problem is that whatever script is doing the conversion from the string {{end}} to the seconds argument is putting literally the string "3,8" inside Delay(3,8), which makes the sequencer think we are trying to execute Delay with two arguments, instead of failing it works gracefully taking the first argument (3) and ignoring the second one (8).

    the final result is that the Delay() command executes on the floor (highest integer number less or equal to) of 3,8 or whatever float number is result of characters_in_subtitle / SubtitleCharsPerSecond

    I guess the problem is that some float Parser method in net 3.5 converts floats into strings like "13.44" while in .net 4.x it converts to "13,44" by default, hence making the lua compiler think that these are two arguments while it should be a float number with decimals, creating this bug.

    could you please check this out and if there is a quick hot fix (probably a one line change) could you instruct me where to do it so I can move on with my project?

    thanks.
     
  39. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Cleverlie - I'll PM you access information to download the hotfix soon. By default, .NET3 is culture invariant (i.e., ignores OS language settings) when converting decimal numbers, whereas .NET4 uses OS language settings by default. In .NET4, if your current language settings uses a comma ( , ) to mark the decimal point, all string<->number conversions will use commas, which of course will cause problems as you've seen. Version 2.0.1 fixed Lua to be culture invariant, but the sequence parser snuck past me. I've fixed it in the upcoming version 2.0.5, and I just need to bundle up a hotfix for 2.0.4 now.
     
    Cleverlie likes this.
  40. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    amazing Tony, thanks for the quick support again! and yes, I'm in a spanish version of Windows, that's why probably nobody noticed this particular bug before, it's a very tricky combination of things happening.

    cheers
     
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Cleverlie - I suspect that switching to .NET4 is going to give some people lots of headaches, completely unrelated to the Dialogue System. Even simple code like below is going to give different values based on whether they set their project's dropdown to .NET 3.x or .NET 4.x:
    Code (csharp):
    1. float x = 3.14f;
    2. print("x = " + x);
    You should find your download access info in your inbox.

    If anyone else needs the patch before version 2.0.5 is released, these are the release notes for the patch:
    • CHANGED: In Unity 2018+, define compiler symbol USE_PHYSICS2D to make the Dialogue System support Physics2D.
    • CHANGED: AudioWWW() sequencer command has been deprecated.
    • CHANGED: Renamed Lua ‘Library’ folder to ‘LuaLibrary’ to accommodate version control ignore lists.
    • Fixed: Lua math.random(x) now correctly return values [1..x] instead of [0..x].
    • Fixed .NET4 issue when a class named Assets is defined in the global namespace.
    • Fixed: TextMesh Pro Typewriter Effect wasn’t using alternate audio clips.
    • Fixed: Null reference exception when a custom menu panel didn’t have a canvas.
    • Fixed: Attributes [VariablePopup], [ActorPopup], and [QuestPopup] weren't populating dropdown lists in all circumstances.
    • Fixed: Removed copyright symbol from script file header comments. (Unity 2017+ inspector can’t handle the symbol.)
    • Improved: Updated for .NET Standard 2.0 compatibility.
    • Improved: Input Device Manager: Added Control Graphic Raycasters checkbox.
    • Improved: Standard & Unity UI dialogue UIs & quest log windows: Added Add EventSystem If Needed checkbox.
    • Improved: Standard UI Menu Panel now prevents second button clicks while menu panel is playing hide animation.
    • Improved: TimedEvent: Added option to count time by # of frames.
    • Improved: AnimatorSaver now saves parameter values as well as states.
    • Added: Sci-fi Dialogue UI.
    • articy:draft: Instructions and Jumps are now converted as blank nodes with None() sequences instead of Group nodes.
    • Corgi: Improved appearance of dialogue bubble.
    • Invector Controller: Added vAddItemByID() Lua function.
    • Rog Inventory Engine: Fixed actor prefab.
     
  42. Shinzironine

    Shinzironine

    Joined:
    Nov 30, 2013
    Posts:
    32
    Hi, I am really enjoying working with Dialogue System. Thank you for the asset.

    What I am doing in my game is some kind of a procedural conversation generation. Basically I have different parts of conversations that I then assemble (i.e. introduction, body, outro etc.) in a meaningful dialogue. Right now what I do is simply start one conversation after the other. It is simple and works, but have downsides: flashing of transition animations, additional instantiation of character portraits (I have a custom system). So I am curious if there is a way to stitch different conversations together dynamically into one conversation?
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Shinzironine - You could avoid the flashing of animations by overriding the dialogue UI's animation behavior. The Dialogue System is designed so the UI level and underlying data level operate relatively independently. However, I think there are better ways to handle this.

    Instead, I recommend:

    1. Use cross-conversation links and conditions. Write an entry-point conversation that links to all of the introduction conversations. (To link to another conversation, in the dialogue entry node's inspector select Links To: (Another Conversation).) Add Conditions to each of these introduction conversations.

    For example, let's say you have three introductions based on the character's feeling toward the player: Neutral Greeting, Happy Greeting, or Angry Greeting. Before starting the conversation, set a dialogue database variable such as "Feeling". (You can use DialogueLua.SetVariable() or a visual scripting action.) Let's say it's a Number variable in this range:
    • Neutral: -10 to +10
    • Happy: above +10
    • Angry: below -10
    Use the "..." dropdown to set the Happy Greeting conversation's Conditions to Variable["Feeling"] > 10, and so on. The entry-point conversation will go to the intro conversation whose Conditions are true. Use the same technique to link to a body conversation and then an outro.

    2. Use markup tags such as [var=varName] to get more use out of the same content. For example, you don't need two separate conversations for:
    • "Hello, I'm Adam the Alchemist." and
    • "Hi, I'm Bob the Baker."
    You can use one conversation with markup tags such as:
    • "[lua(RandomElement("Hello|Hi"))], I'm [var=Conversant] the [lua(Actor[Variable["ConversantIndex"]].Job)]."
    3. If you need to manually jump to a dialogue entry node, you can do it in code. Use DialogueManager.conversationModel.GetState() to get the current state of a node. Then use DialogueManager.conversationController.GotoState() to move the conversation there:
    Code (csharp):
    1. var dialogueEntry = DialogueManager.masterDatabase.GetDialogueEntry(conversationID, entryID);
    2. var state = DialogueManager.conversationModel.GetState(dialogueEntry);
    3. DialogueManager.conversationController.GotoState(state);
    A few more notes:
    • Remember that the Dialogue System evaluates conditions one extra level ahead to be able support certain continue button modes.
    • You can click on a link arrow and set its priority. This is helpful if you want to guarantee to follow a certain link if its conditions are true.
    • Group nodes (created by clicking the node's Group checkbox) act as passthroughs. They evaluate the Conditions and Script, but they don't show any subtitle content. You can use them to as "hubs" to reduce the number of link arrows in your conversations.
     
    TeagansDad likes this.
  44. Shinzironine

    Shinzironine

    Joined:
    Nov 30, 2013
    Posts:
    32
    Thank you for the explanation, and once again thank you for the asset!

    Group nodes do not execute events, is this intentional? It would be cool to use them as event hubs as well, I think. All of my functionality is working as needed through Lua in my project now though, which is more convenient.

    One more question: what is the best way to start from a random node in a conversation (i.e. not a bark). Right now I have each node check for a random condition (I have to write it in each node), but is there a cleaner way?
     
    Last edited: Oct 5, 2018
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Always happy to help!

    It's correct that group nodes don't run their OnExecute() UnityEvent. But I don't see why they couldn't. I'll add this in the upcoming version 2.0.5.

    What you're doing is correct for the current version. I'm experimenting with a way to do this without having to add random conditions. If it works out, I'll include it in version 2.0.5.
     
    Shinzironine and MrG like this.
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    I've added a sequencer command RandomizeNextEntry() to version 2.0.5. It tells the Dialogue System to choose the next dialogue entry node randomly from the list of valid nodes instead of using the first one in the list. I opted to add a sequencer command instead a dialogue entry node field to keep dialogue databases smaller. There's still time to rename this sequencer command if the community would prefer a different name for it.
     
    Shinzironine likes this.
  47. Shinzironine

    Shinzironine

    Joined:
    Nov 30, 2013
    Posts:
    32
    That is great! It would be cool to add a similar Lua command as well to support the group nodes. The name seems good to me.
     
  48. ClaudiaTheDev

    ClaudiaTheDev

    Joined:
    Jan 28, 2018
    Posts:
    331
    Hello! I hope somebody can help me i just can't figure it out.
    I want the player to choose short answers in the response menu.
    After giving the response the player should say more in a normal dialog.

    What i want (see image):
    Green: Normal dialog - no response menu.
    Red: Response menu

    upload_2018-10-6_10-53-11.png

    What i get:
    If "Always force Response menu" is OFF:
    The green nodes are skipped

    If "Always force Response menu" is ON:
    The green nodes are shown as response
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Done!

    Hi! Turn Always Force Response Menu OFF. When you want to show a player node in a response menu, add this markup tag to the Dialogue Text: [f]
    • Player: "[f] Yes"
    This will force the response menu for that node.

    ---

    Or, you can turn Always Force Response Menu ON. In this case, all player nodes will show a response menu. If you want to show a specific player node as a regular subtitle, add this markup tag to the Dialogue Text: [auto]
    • Player: "[auto]I like you a lot!"
     
    Shinzironine likes this.
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Cutscene Sequence Tutorials Parts 3 & 4

    Cutscene sequence tutorials 3 and 4 are now available on the Dialogue System for Unity 2.x Playlist.

    (You can also find tutorial 1 and 2 in this post.)

    Tutorial 3 covers messages, which are a handy way to time your sequences and even wait for gameplay activity.

    Tutorial 4 covers entrytags, which you should consider using if your project has voiceover content.