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

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    How to: Response menu buttons with portrait images

    On the Pixel Crushers forum, someone asked how to add portrait images to response menu buttons. In his scenario, there are multiple player actors. The portraits let the player know which player actor will speak each response.

    Since the Dialogue System is modular, it's quite easy. Here's an example:
    MenuButtonPortraitsExample_2018-11-04.unitypackage

    Assuming you're using the Standard Dialogue UI, just replace your StandardUIResponseButton with this custom subclass:

    CustomResponseButton.cs
    Code (csharp):
    1. using PixelCrushers.DialogueSystem;
    2.  
    3. public class CustomResponseButton : StandardUIResponseButton
    4. {
    5.     public UnityEngine.UI.Image image;
    6.  
    7.     private void OnEnable()
    8.     {
    9.         if (response == null) return;
    10.         var actor = DialogueManager.masterDatabase.GetActor(response.destinationEntry.ActorID);
    11.         image.sprite = UITools.CreateSprite(actor.portrait);
    12.     }
    13. }
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Cutscene Sequence Tutorial Videos

    The final two cutscene sequence tutorial videos are live!

    Part 5: Timeline


    Part 6: Custom Commands


    The full playlist of all Dialogue System video tutorials is here.
     
  3. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    hi people, first off thanks @TonyLi for the quick support, adding runtime support for i2 will be great since we want to use the I2 feature of runtime fetch of the translation tables from google drive.

    I have a problem though, until now I've been working on the project with the editor set for desktop export, today I switched platforms to iOS (iPhone, iPod and iPad) and I'm having a strange problem.



    when I start playing the game the dialogue system seems broken, I have some warning messages saying the script reference is missing, the scripts missing are from Dialogue System, and my guess is that this is something related to having wrappers scripts for the actual scripts, thing that I still don't know why is needed, but it might be the source of the problem, with the editor switched to iOS this happens:

    warns.jpg

    probb.jpg

    there are no compile errors in the console, the game starts fine, this seems to have something to do with the fact that these scripts are like wrappers for the actual scripts.

    if I go back to desktop platform in the editor, the problem persists, is like something breaks when you switch to iOS and is still broken after moving back to PC.

    any ideas?
     
  4. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    UPDATE: I figured out that for some reason the flag TMP_PRESENT was gone from the "scripting define symbols" in player settings, that fixed the warnings about missing referenced scripts, but didn't solve the actual problem.

    this is a really weird problem, in the screenshot below you can see that the gameobjects generated by the Textline dialogue UI have their names correctly assigned (check the game object called "Hi PlayerName, Can I..." thats the actual dialogue line that should be appearing in the chat-like UI) but for some reason the system is not assigning the TextMeshProUGUI component the correct text string as well.

    cvcvcv.jpg


    EDIT: I FIGURED IT OUT

    for some god forsaken reason the TMP_PRESENT flag was removed from the preprocessor directive flags (as explained above) and that created the warnings about missing references since the scripts affected had the #if TMP_PRESENT preprocessor flag.

    this also made all scripts that use the class UITextField which is a wrapper to hold either a unity UI text component or a TMP text component to forget their serialized referenced to all textmeshproUGUI components.

    so basically when I re-added the TMP_PRESENT flag I also had to go through each field in each component that used to have the text linked and re link it again :(:(

    I have no idea why switching between PC desktop and iOS as target platform removed the flag in the first place, but it happened in multiple computers so it's either a Unity bug, and a very bad one, or something else. I finally found the solution by myself but thanks anyway!
     
    Last edited: Nov 5, 2018
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Cleverlie - The updated i2 Localization package on the Dialogue System Extras page adds an option to fetch translations from i2 at runtime. Add the DialogueSystemUseI2Language script to the Dialogue Manager, and tick Use I2 Language At Runtime. Currently this only fetches subtitle translations. In the next update (2.0.6), it will also fetch translations for response menu buttons, quest log windows, quest tracker HUDs, and alert messages.

    After switching the platform to iOS in the Build Settings window, set the Scripting Define Symbol TMP_PRESENT. The TextMeshProTypewriterEffect script is conditionally compiled only if this symbol is defined. Each build platform has its own set of Scripting Define Symbols.
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Our posts crossed. I'll investigate this. It might be related to a Unity bug that I've reported. What version of Unity are you using?
     
  7. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    yeah sorry we were writing at the same time haha, here it goes:

    EDIT: I FIGURED IT OUT

    for some god forsaken reason the TMP_PRESENT flag was removed from the preprocessor directive flags (as explained above) and that created the warnings about missing references since the scripts affected had the #if TMP_PRESENT preprocessor flag.

    this also made all scripts that use the class UITextField which is a wrapper to hold either a unity UI text component or a TMP text component to forget their serialized referenced to all textmeshproUGUI components.

    so basically when I re-added the TMP_PRESENT flag I also had to go through each field in each component that used to have the text linked and re link it again :(:(

    I have no idea why switching between PC desktop and iOS as target platform removed the flag in the first place, but it happened in multiple computers so it's either a Unity bug, and a very bad one, or something else. I finally found the solution by myself but thanks anyway!

    Unity version 2018.2.14f1
     
    TonyLi likes this.
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    That's exactly what I was going to reply. If you compile without TMP_PRESENT defined, and then you save the scene so that it reserializes the assignments, you'll lose the assignments to TextMeshProUGUIs.

    It's by design that each platform has its own set of scripting define symbols. I think it would be helpful to change the Tools > Pixel Crushers > Dialogue System > Tools > Enable TextMesh Pro Support menu item to offer an option to add the symbol to all build platforms, not just the current build platform. I'll add that in the next update.
     
    Cleverlie likes this.
  9. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    I think all platforms share scripting define symbols, the field even has a asterisk * with the comment "* Shared setting between multiple platforms". so yeah its probably a Unity bug.

    EDIT: you are right, each platform has it's own scripting symbols, the asterisk is really confusing, so in fact what happened here is that Dialogue system added TMP_PRESENT at some point, but only for the platform currently set at that moment, then when I switched platforms to iOS, there was never defined there. yes it might save some trouble in the future for other people if you change the behaviour so it adds the flag to all platforms at once, even if there is a "general" scripting symbols field that applies to any platform that would be great, thanks again!
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    In the case of iOS, that means it's shared between iOS and Android. But it's not shared to desktop, UWP, or WebGL; each of those have their own separate settings.
     
    Cleverlie likes this.
  11. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    I'm kind of pondering real-time seasonal events in my game (I.e. An xmas event in the month of December, or Halloween in October etc) so I have a maybe sort of an out of scope question. How would you recommend getting the current system time, specifically the current month and setting it to a dialogue system text variable?

    Thank you for your time.
     
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Candy-Bomber - Here's an example script that returns the current month as a number:

    DateLuaFunctions.cs
    Code (csharp):
    1. using UnityEngine;
    2. using PixelCrushers.DialogueSystem;
    3.  
    4. public class DateLuaFunctions : MonoBehaviour
    5. {
    6.     void Awake()
    7.     {
    8.         Lua.RegisterFunction("CurrentMonth", this, SymbolExtensions.GetMethodInfo(() => CurrentMonth()));
    9.     }
    10.  
    11.     public static double CurrentMonth()
    12.     {
    13.         return System.DateTime.Now.Month;
    14.     }
    15. }
    Just drop it on your Dialogue Manager. Then you can write Conditions like these:

    upload_2018-11-6_14-10-26.png

    I increased the priority of the Group node "Monthly Events" so it will be checked first. If it's January (month 1), the conversation will say "Happy New Year!". If it's December (month 12), it will say "Ho! ho! ho!". Otherwise it will say "Just a normal day."


    If you want to set a text variable "Month" instead, you could add a script like this to the Dialogue Manager:

    SetMonthOnConversationStart.cs
    Code (csharp):
    1. using UnityEngine;
    2. using PixelCrushers.DialogueSystem;
    3.  
    4. public class SetMonthOnConversationStart : MonoBehaviour
    5. {
    6.     void OnConversationStart(Transform actor)
    7.     {
    8.         DialogueLua.SetVariable("Month", System.DateTime.Now.ToString("MMM", CultureInfo.InvariantCulture);
    9.     }
    10. }
    Then your Conditions can check the value of Variable["Month"], which will be short names such as "Jan", "Feb", etc.
     
    flashframe and hopeful like this.
  13. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Thank you kindly, that is a much more precise answer than I expected! :)
     
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Glad to help!
     
  15. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Hey Tony,

    I'm setting up the Dialogue System in a project using the new Incremental Compiler, which means getting all the scripts out of Plugins and into Assembly Definition files.

    The main annoyance with assembly definition files over the Plugins or StandardAssets folder, as you probably already know, is getting all the editor scripts into their own assembly. This usually means moving around all the editor folders of every third party asset you use into one main editor folder (the only other option is to create a ton of assemlies for each editor folder, which has its own downsides). So one solution is to bug asset developers to adjust their folder structure so all editor scripts exist in one folder which is separate from all build scripts. I realize it's annoying to have individual people asking you to change your folder structure and risk breaking other users' projects.

    I recently happened upon another solution which may be the best of both worlds: the NodeCanvas project on the asset store uses an approach to editor scripts where it simply wraps every editor script in #if UNITY_EDITOR directives. This allows the entire project to simply be dropped into any folder with an assembly definition file and compile and build just fine. This allows you to use any folder structure you find intuitive, including editor folders, but it also allows the entire codebase to simply dragged and dropped by users into the plugins folder, or any assembly folder they want, with no further tweaking required.

    Would love it if you'd think about using this approach, unless there are downsides I'm not aware of.

    Thanks a lot for you time!

    Alic
     
    Last edited: Nov 7, 2018
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Alic - The Dialogue System already comes with assembly definition files. Just import the file Plugins / Pixel Crushers / Dialogue System / Scripts / DialogueSystemAssemblyDefinitions.unitypackage. They were added in version 2.0.3, so you may need to update if you're using an older version. There are 4 assembly definition files:
    • Common
    • CommonEditor
    • DialogueSystem
    • DialogueSystemEditor

    If you want to define different assembly definition files, all editor scripts are in Plugins / Pixel Crushers / Common / Scripts / Editor and Plugins / Pixel Crushers / Dialogue System / Scripts / Editor. They're not scattered throughout the asset.
     
    Alic likes this.
  17. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Didn't realize you'd already done it! Thanks Tony!
     
  18. romandutov

    romandutov

    Joined:
    Sep 18, 2015
    Posts:
    16
    Hello @TonyLi. Found some unpleasant moment. When uncheked property
    jumpToSpecificEntry в StartConversation ( timeline clip ), then property
    entryID saving past value and after start timeline, dialog cant start if a non-existent ID was specified in the past ( but jumpToSpecificEntry == false ). I think that it is necessary to reset the value of the parameter
    entryID to 0.
    Code (CSharp):
    1. [CustomPropertyDrawer(typeof(StartConversationBehaviour))]
    2.     public class StartConversationBehaviourDrawer : PropertyDrawer
    3.     {
    4. ///....
    5.   public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    6.         {
    7. ///...
    8. if (jumpToSpecificEntryProp.boolValue)
    9.             {
    10.                 singleFieldRect.y += EditorGUIUtility.singleLineHeight;
    11.                 EditorGUI.PropertyField(singleFieldRect, entryIDProp);
    12.             }
    13.             else
    14.             {
    15. //new code
    16.                 entryIDProp.intValue = 0;
    17.             }
    18.  
    Thnx.
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @romandutov - No need for the custom drawer. That issue is fixed in the updated Timeline support scripts that are coming in version 2.0.6 (being released soon). You can download them here:

    DS2_TimelineSupport_2018-11-08.unitypackage
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Dialogue System 2.0.6 Released!

    Version 2.0.6 is available now on the Pixel Crushers customer download site. (PM me your Asset Store invoice number if you need access.) It should be available on the Asset Store in 3-7 business days.

    This version adds more options to the Sequence field's "+" menu.


    Version 2.0.6
    Core

    • Added: DOF() sequencer command to control DepthOfField PostProcessing effect.
    • Added: DialogueDatabase.GetEntrytaglocal() function.
    • Fixed: Automatic checking of Alert variable no longer show 'nil' if variable is undefined.
    • Fixed: RandomizeNextEntry() Lua function reported error in some circumstances; now works on group node linked directly from START.
    • Fixed: OnConversationCancelledLine() no longer reports error if there is no previous subtitle.
    • Fixed: DialogueManager.hasInstance now updates if active Dialogue Manager instance changed.
    • Fixed: Float conversion in .NET4 is now fixed to be culture invariant.
    • Fixed: Cross-conversation link dropdowns no longer split dialogue text at '/' characters.
    • Fixed: Sequence parser no longer reports error on double semicolons (';;').
    • Fixed: Fade() sequencer command's default duration is now correctly 1 second.
    • Fixed: Timeline preview UI cleans up properly when changing to playmode.
    • Fixed: ActorPopup, ItemPopup, QuestPopup, and VariablePopup attributes can now be nested in lists.
    • Improved: Timeline Start Conversation clip no longer requires assignment of GameObject.
    • Improved: Significant performance improvement in node editor when editing very large conversations.
    • Improved: Sequence field helper menu ('+') has more options, submenu that lists all available commands.
    • UI:
      • Can now disable Standard UI Menu Panel scrollbar reset value.
      • Optimized initialization when using default legacy GUI option with Selector & Proximity Selector.
      • Panel show/hide animations now also support legacy Animation component as well as Animator.
    Third Party Support
    • articy:draft: Fixed parsing of compound expresso expressions containing semicolons. Added option to import documents into a conversation submenu.
    • Emerald AI: Updated EmeraldAISaver for Emerald AI 2.1.1+.
    • i2 Localization: Updated for i2 Localization 2.8.9. Added support for runtime translation of dialogue & menu text.
    • Realistic FPS Prefab: Updated example scene for RFPSP 1.45.
    • RT-Voice: Updated for RT-Voice 2018.3+.
     
    Deckard_89 and Weblox like this.
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Version 2.0.6 is now available on the Asset Store!


    Corgi Platformer Engine Support Package Updated

    The Dialogue System Extras page has an updated support package for Corgi 5.2, which had an API change.
     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    articy:draft Lua Functions Patch Available

    If you use articy:draft, a bug in ArticyLuaFunctions caused getProp() and setProp() to not update the Lua environment. If you use getProp() and setProp() in your articy:expresso expressions, you can download a patch on the Dialogue System Extras page.
     
    SickaGames1 likes this.
  23. romandutov

    romandutov

    Joined:
    Sep 18, 2015
    Posts:
    16
    Hello @TonyLi. After completing this sequence, Unity hangs. I can move to next dialog in conversation after complete custom sequence (Stop command sequence complete successfull)?
    P.S. Without last string
    required Continue()@Message(Done); 
    the dialogue does not end, most likely waiting for the Continue event, 'cause Continue mode for DB set - Always.
    upload_2018-11-13_18-14-12.png
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @romandutov - Does this conversation run in a Timeline?

    Does your custom GoUpgradeItem sequencer command call Stop()?
     
  25. romandutov

    romandutov

    Joined:
    Sep 18, 2015
    Posts:
    16
    1) Does this conversation run in a Timeline?
    No, this conversation run ussually call
    DialogueManager.StartConversation(conversation, actor, conversant, entryID);

    2) Does your custom GoUpgradeItem sequencer command call Stop()
    Yes, GoUpgradeItem call Stop() command.

    Code (CSharp):
    1. using System;
    2. using Cinemachine;
    3. using FMOD.Studio;
    4. using PixelCrushers.DialogueSystem;
    5. using PixelCrushers.DialogueSystem.SequencerCommands;
    6. using UnityEngine;
    7.  
    8. public class SequencerCommandGoUpgradeItem : SequencerCommand
    9. {
    10.     private Transform cameraTransform;
    11.  
    12.     private float duration;
    13.     private Vector3 originalPosition;
    14.     private Vector3 targetPos;
    15.  
    16.     private CafeItemType cafeItemType;
    17.  
    18.     private float t;
    19.     private bool isShowingWindow;
    20.    
    21.     public void Start()
    22.     {
    23.     //init...
    24.     }
    25.  
    26.  
    27.     public void Update()
    28.     {
    29.              
    30.         if (t < 1)
    31.         {
    32.             t += Time.deltaTime / duration;
    33.            
    34.             cameraTransform.position = Vector3.Lerp(originalPosition, targetPos, t);
    35.         }
    36.         else
    37.         {
    38.             if (!isShowingWindow)
    39.             {
    40.                
    41.                 print("Complete camera move to upgrade item");
    42.                 isShowingWindow = true;
    43.                
    44.                 cameraTransform.position = targetPos;
    45.  
    46.                 //complete moving camera to upgrade item
    47.                 var findingCafeItem = UpgradeManager.Instance.GetCafeItemByType(cafeItemType);
    48.                 if (findingCafeItem != null)
    49.                 {
    50.                     //level up cafe item
    51.                     findingCafeItem.LevelUp();
    52.                    
    53.                     //show upgrade dialog cafe item, with delegate callback on click button
    54.                     UIManager.Instance.UpgradeItemWindow.Open(findingCafeItem, StopApplyUpgrade);
    55.                 }
    56.                 else
    57.                 {
    58.                     StopApplyUpgrade();
    59.                 }
    60.             }
    61.         }
    62.     }
    63.  
    64.  
    65.     public void StopApplyUpgrade()
    66.     {
    67.         print("stop sequence"); // debug ouput is OK
    68.         Stop();      
    69.        
    70.         //try next dialog in conversation - dont work
    71.         //DialogueManager.Instance.SendMessage("OnConversationContinue");
    72.     }
    73. }
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi,
    Does this mean that, without the last string, the Sequence is:

    SetContinueMode(false);
    GoUpgradeItem(walls_kitchen_1floor,1)

    Or is it different?

    Thanks. I shouldn't have assumed it was in a Timeline.

    In this case, I think if you move SetContinueMode(false) to the previous node, it will take effect. Let's call the previous node "node 1" and let's call this node "node 2". This is because the sequence runs after node 2 has already set up the logic to wait for a continue message. SetContinueMode(false) only hides the continue button and tells subsequent nodes to not wait for a continue message. You could move the command to node 1, for example like this:

    YourOtherCommands();
    required SetContinueMode(false)@Message(Continue)

    Or you can do what you did in your original post. That works, too.
     
  27. RecursiveFrog

    RecursiveFrog

    Joined:
    Mar 7, 2011
    Posts:
    350
    @TonyLi Hello, I tried to view your demo at http://pixelcrushers.com/dialogue_system/demos/demo/ but I received this error.

    Code (CSharp):
    1. An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was: Uncaught SyntaxError: Unexpected end of JSON input
     
  28. romandutov

    romandutov

    Joined:
    Sep 18, 2015
    Posts:
    16

    GoUpgradeItem(walls_kitchen_1floor, 1)->Message(Done);
    required SetContinueMode(false)@Message(Done);

    Thats work, but it’s more like a dirty hack when we hide the Continue button after sequence complete.
     
  29. RecursiveFrog

    RecursiveFrog

    Joined:
    Mar 7, 2011
    Posts:
    350
    @TonyLi Even though the demo site doesn't work, I did download the free trial and have been examining it.

    Does this tool work on consoles like the Nintendo Switch or PS4? Has anybody here used it to create a game on these consoles, and were there issues?

    Also, I know that this tool has support for Asset Bundles. Are there plans to integrate Unity's Addressable system in the future, once it becomes more stable and there are more open APIs for it?
     
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Please feel free to try the demo again. The web hosting provider had an outage this week that may have affected it. I think it's reset now. It appears to play fine.

    Yes, many games made with the Dialogue System such as Crossing Souls, City of the Shroud, Jenny LeClue, and Disco Elysium are all cross-platform on consoles (Switch, PS4, Xbox, etc.) and Windows, Mac, and Linux, with no issues. You can find games that use the Dialogue System on every platform that Unity can build to.

    Probably. As you said, we need to see what final form it takes.

    I apologize; it's been a very long day. I got back into the office to double-check this, and I was completely mistaken. SetContinueMode() sets the behavior of the current node, the way you would expect it to properly behave. Here is an example:

    upload_2018-11-13_23-17-38.png

    If the Dialogue Manager's Continue Button dropdown is set to Always, then:
    • "aaa" will show the continue button and wait for it to be clicked.
    • "bbb" will not show the continue button. It will automatically continue after 3 seconds.
    • "ccc" will show the continue button and wait for it to be clicked.
    I haven't been able to reproduce the issue you described. Are you sure "stop sequence" appears in the Console / output log? Can you send a reproduction example to tony (at) pixelcrushers.com?
     
  31. RecursiveFrog

    RecursiveFrog

    Joined:
    Mar 7, 2011
    Posts:
    350
    Thanks, the more I dig into the tool the more impressive it looks. The number of integrations is astounding.

    One question, I see that it comes with its own Save/Load system, but I already have built one for all the game and character data that isn't dialog related (inventory, money, flags). Is there an API that allows us to save your tool's game state into our own format as part of our existing save file, and then reload it back at runtime? Must we use the integrated Save/Load system that ships with Dialogue System?

    Edit : One more question @TonyLi , I have the licensed Rewired plugin already and am using it in my non-dialog sections, but it's not very clear how I'm supposed to use it with Dialog System. I extracted the RewiredSupport unity package, and the demo scene only seems to recognize the axis control. No buttons on the controller do anything in that demo.

    I'd even thought to capture the Rewired input with my current setup and simply use my recognized rewired input to manually call APIs on Dialog System, but I don't see how I'm intended to do that. Like, once I have received my Rewired confirm button press, how would I then translate that into "Continue" button presses? Or the up/down buttons into dialog choice navigation?
     
    Last edited: Nov 14, 2018
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    You can use your own save solution. To get the Dialogue System's data, call PersistentDataManager.GetSaveData():
    Code (csharp):
    1. string data = PersistentDataManager.GetSaveData();
    Then you can store this string in your own save solution. To apply the data back into the Dialogue System on load, call ApplySaveData():
    Code (csharp):
    1. PersistentDataManager.ApplySaveData(data);
    The Dialogue Manager's inspector has a Persistent Data Settings section that lets you specify what Dialogue System data is included in this string.

    Two steps:

    1. Import Plugins / Pixel Crushers / Common / Third Party Support / Rewired Support, and add an InputDeviceManagerRewired component to the Dialogue Manager. (There's also a similar package in Dialogue System / Third Party Support. They're basically functionally equivalent, but the one in Common will position you better if you end up using any other Pixel Crushers assets in your project.)

    2. Import this update: SelectorSupportInputDelegate_2018-11-10.unitypackage
    The Selector and ProximitySelector components were originally just demo scripts, and so they were the only two that weren't originally written to use whatever input delegate was assigned to the Dialogue System. They've developed into first class components that many games use in production now, so I finally updated them to use input delegates. This update will also be in 2.0.7.
     
  33. RecursiveFrog

    RecursiveFrog

    Joined:
    Mar 7, 2011
    Posts:
    350
    @TonyLi Thanks for your quick support, this was great and it got me up and running with Rewired. Really impressive work!
     
    TonyLi likes this.
  34. romandutov

    romandutov

    Joined:
    Sep 18, 2015
    Posts:
    16
    Hey @TonyLi. It's me again :) After update to new version of 2.0.6 Conversation track in timeline lose content clips.
    upload_2018-11-15_17-49-53.png
    upload_2018-11-15_17-51-48.png
    upload_2018-11-15_17-52-2.png
    But in console log no error. I think it's be recompile script, but it Plugins folder doesn't allow it. If i moved main folder Pixel Crushers into Assets, when i get many error's. What do I need to do to make the timeline track work again?
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @romandutov - What version of Unity are you using? The only change in StartConversationClip.cs is that the copyright symbol "©" was replaced by "(c)" in a comment because the Unity editor's Inspector preview had a bug that can't handle extended unicode characters. (Unity has fixed this for version 2018.3.)

    If you're using Unity 2018.2+, this is probably a known bug that will be fixed in Unity 2019.1. The bug may be present in earlier versions of Unity, too, but it has been confirmed in 2018.2+.

    The workaround is to delete the first and last lines from the scripts in Plugins / Pixel Crushers / Dialogue System / Scripts / Timeline / Playables.

    First line:
    Code (csharp):
    1. #if UNITY_2017_1_OR_NEWER && !(UNITY_2017_3 && UNITY_WSA)
    Last line:
    Code (csharp):
    1. #endif
    These lines exist because of another bug in Unity 2017.3 with the Windows Store platform.

    So three Unity bugs in one post. :)
     
    romandutov likes this.
  36. romandutov

    romandutov

    Joined:
    Sep 18, 2015
    Posts:
    16
    I use Unity 2018.2.10f1. Delete compiler derective work for me. Thnx
     
    TonyLi likes this.
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
  38. cheesee09

    cheesee09

    Joined:
    Mar 30, 2018
    Posts:
    35
    Is there a tutorial on how to use dialogue system with Invector?
     
  39. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @cheesee09 - The included Invector Support package comes with step-by-step setup instructions and an example scene that you can pick apart and play with. If you have any questions about using Invector with the Dialogue System, just let me know!
     
  40. TonyLi

    TonyLi

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

    Version 2.0.7 is now available on the Asset Store.

    Release Notes
    Core:

    • Improved: Selector/ProximitySelector now read from input delegate.
    • Fixed: DialogueSystemTrigger.StopConversationIfTooFar wasn't checking distance if actor wasn't assigned.
    • Fixed: Added missing internal sequencer commands to + menu.
    Third Party Support:
    • articy:draft: Fixed ArticyLuaFunctions to change Lua environment instead of database. Pins on instructions are now imported.
    • Corgi: Updated to support Corgi 5.2.
    • TextMesh Pro: Updated LocalizeTextMeshPro for non-UGUI version.
     
  41. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    How to localize the Actor's name?
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @AngelBeatsZzz - Add a custom field whose type is Localization and name is Name plus the language:

    upload_2018-11-21_7-46-21.png

    I prefer to use Display Names and keep the Name field unique. You can do that, too:

    upload_2018-11-21_7-46-58.png
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Black Friday Reminder

    The Dialogue System for Unity is 55% off, along with several other great assets such as Final IK and Behavior Designer, in the Ultimate Characters Bundle during Black Friday and Cyber Monday weeks.
     
  44. ZygoUgo

    ZygoUgo

    Joined:
    Jul 11, 2017
    Posts:
    63
    Hi all, I wonder if anyone can help me with this, I'm getting these two errors and can't figure out what's causing them, I can't progress on my game until they are fixed:

    Assets/Plugins/DialogSys/Scripts/Editor/Tools/Setup Wizards/DialogueManagerWizard.cs(590,29): error CS1061: Type `PixelCrushers.DialogueSystem.DialogueSystemSaver' does not contain a definition for `saveAcrossSceneChanges' and no extension method `saveAcrossSceneChanges' of type `PixelCrushers.DialogueSystem.DialogueSystemSaver' could be found. Are you missing an assembly reference?

    Assets/Plugins/DialogSys/Scripts/Editor/Tools/Setup Wizards/DialogueManagerWizard.cs(589,137): error CS0039: Cannot convert type `UnityEngine.Component' to `PixelCrushers.DialogueSystem.DialogueSystemSaver' via a built-in conversion

    Thankyou for any help!
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @ZygoUgo - Have you added a new script named "DialogueSystemSaver" or "Saver" or edited the ones that come with the Dialogue System? Or perhaps you imported another asset that defines a class named "Saver" but neglected to properly put it in a namespace.

    Please try the following:
    • Import the Dialogue System in a new, empty project. Confirm that there's no error.
    • Back up your project. Then update to the latest version of the Dialogue System.
    • In a pinch, delete DialogueManagerWizard.cs. You won't be able to access the Dialogue Manager Wizard, but it may allow your project to compile. If you have another misbehaving asset or script in your project, this might not be sufficient.
    If that doesn't work, let me know what versions of Unity and the Dialogue System you're using.

    Please also feel free to send a copy of your project to tony (at) pixelcrushers.com. I'll be happy to take a look.
     
  46. ZygoUgo

    ZygoUgo

    Joined:
    Jul 11, 2017
    Posts:
    63
    Thankyou! I'll send you a message :)
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Thanks! You should have an email reply from me. If you didn't get it for some reason, here's the summary:

    Try deleting the Assembly Definition files, since they got out of sync when you moved around a lot of folders. (Re-add DialogueManagerWizard.cs, too.) If that doesn't do the trick:
    1. Make a good backup of your project.
    2. Completely remove the Dialogue System, Quest Machine, and Love/Hate from the project.
    3. Reimport them. Also reimport any third party packages you might need. Remember that some third party integrations have packages in Common/Third Party Support, too. If you're using TextMesh Pro, enable support.
    When moving folders, you'll need to follow some rules that Unity has established regarding special folders:
    • Anything that's in Plugins must stay in Plugins.
    • Anything that's inside an Editor folder must stay in an Editor folder.
    • If you import the optional Assembly Definition files from the provided unitypackages, you must update them to point to the right files. Assembly Definition Files tell Unity what files to compile and in what order.
     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Black Friday Sale Ends Today

    The Asset Store's Black Friday Sale ends today. During the Black Friday Sale, you can get the Ultimate Characters Bundle, which includes the Dialogue System for Unity, for 55% off each asset in the bundle. You only pay for assets you don't already own.
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Ink Support Updated

    The Dialogue System Extras page has an updated support package for Inkle's Ink for Unity that adds some requested features such as accessing Dialogue System variables inside Ink stories, and accessing Ink story variables from within the Dialogue System's Lua environment. (Version 2.0.7 manual page.)

    In the updated package, and in the upcoming version 2.0.8, these functions are available in your Ink stories:

    EXTERNAL ShowAlert(x) // ShowAlert("message")
    EXTERNAL CurrentQuestState(x) // CurrentQuestState("quest")
    EXTERNAL CurrentQuestEntryState(x,y) // CurrentQuestEntryState("quest", entry#)
    EXTERNAL SetQuestState(x,y) // SetQuestState("quest", "inactive|active|success|failure")
    EXTERNAL SetQuestEntryState(x,y,z) // SetQuestEntryState("quest", entry#,state as above)
    EXTERNAL GetBoolVariable(x) // Returns the bool value of Dialogue System variable x
    EXTERNAL GetIntVariable(x) // Returns the int value of Dialogue System variable x
    EXTERNAL GetStringVariable(x) // Returns the string value of Dialogue System variable x
    EXTERNAL SetBoolVariable(x,y) // Sets Dialogue System variable x to value of bool y
    EXTERNAL SetIntVariable(x,y) // Sets Dialogue System variable x to value of int y
    EXTERNAL SetStringVariable(x,y) // Sets Dialogue System variable x to value of string y



    These functions are available in the Dialogue System's Lua environment:

    Function Description
    SetInkBool("variable", value) Sets a Boolean value in your Ink stories.
    SetInkNumber("variable", value) Sets a number value in your Ink stories.
    SetInkString("variable", "value") Sets a string value in your Ink stories.
    GetInkBool("variable") Gets a Boolean value from your Ink stories.
    GetInkNumber("variable") Gets a number value from your Ink stories.
    GetInkString("variable") Gets a string value from your Ink stories.



    Ink isn't the only way to write your content. The Dialogue System can also import articy:draft, Chat Mapper, Neverwinter Night's Aurora Toolset, TalkIt, and CSV (Excel) -- and of course you can use the full-featured built-in editor.
     
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Dialogue System for Unity 50% Off in Cyber Week Mega Sale

    The Dialogue System for Unity is 50% off in the Asset Store's Cyber Week Mega Sale!

    Andrew at the Asset Store posted a great spreadsheet that lists every single asset in the Cyber Week Sale. See it here.

    Turns out this week you can also still get the Dialogue System for 55% off in the Ultimate Characters bundle, too.


    Version 2.0.8 Released

    Version 2.0.8 is now available on the Asset Store. Release Notes:
    • Improved: If USE_UNET symbol is defined, Lua Script wizard dropdowns have additional NetSet options.
    • Improved: Dialogue Editor: Template > Apply Template: Applies the template's field type to all assets in database.
    • articy:draft: Importer can now populate a Text Table with the text in an articy document.
    • Ink: Added functions to get/set Ink vars in Lua and Lua vars in Ink.