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,692
    "Scrum and videogames" Series by The Game Kitchen

    Mauricio García of The Game Kitchen (developers of the popular episodic horror The Last Door, made with the Dialogue System) is collaborating with Hack'n'Plan on a series of articles called Scrum and videogames. The second article just came out today. If you're working on a large project and/or or with a team, it's a useful read.

    If you'd like to see how The Game Kitchen switched their content pipeline from another system to the Dialogue System, including a neat timelapse video, see their article Designing a new dialogue pipeline.
     
    MilziPPG likes this.
  2. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    242
    Is there going to be an updated textsync integration ?
    Many thanks
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Yes, that'll be included in version 2.1.8, which I expect to release soon.
     
    shredingskin likes this.
  4. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    For the RogoDigital Lypsync integration, how do i make sure a bark dialogue does not vanish until the audio is complete?

    Also is it possible for bark dialogue to play a dialogue chain? Or should i just make it a conversation and try to set up a worldspace UI for it?
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @sacb0y - Tick Wait Until Sequence Ends. It will wait until the bark's LipSync() sequencer command ends.

    Barks are best left as one-off lines. Make your dialogue chain a conversation. Add a Dialogue Actor component to your character, set Dialogue UI Settings > Subtitle Panel to Custom, and assign a world space subtitle panel such as Bubble Template Standard UI Subtitle Panel.
     
  6. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    Thanks I appreciate the fast reply! I read in a rush at the time so I didn't have time to say thanks earlier lol.

    I have another question.

    The dialogue system already supports chat history similar to a chat log or messenger app type appearance .

    What if I wanted to do a pool of responses to any number of dialogue rather than a specific chain.

    For example, a character says a line, then you can ask about that line or respond to it in a list of responses at any time later? Meanwhile other conversations may take place?

    The goal is to make player responses more up to when the player wants to say something, not forcing them to respond immediately.
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @sacb0y - It's quite possible. How you set it up depends on how you want it to appear to the player. Here's one approach:
    1. In the Dialogue Editor's Variables section, add a Boolean variable for each topic that the player can unlock. As the player goes touches on different topics, set the corresponding variable true.
    2. Write a conversation titled, for example, "Other Topics". Link its START node to a Group node. From the Group node, link to each topic. Use Conditions so that the link is only valid if the corresponding variable is true.
    3. Add a separate UI button for "Another Topic". When the player clicks this button, jump to the Other Topics conversation's Group node.
    You may also want to use the Conversation Position Stack functions. These let you save a point in your conversation and then return to it later. In #3 above, before jumping to Other Topics, call PushConversationStack(). This saves the player's current place. In Other Topics, in the node where the player is done and wants to return to the position before they clicked "Another Topic", call PopConversationStack().
     
    sacb0y likes this.
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    30% Off articy:draft 3 on Humble Store

    articy:draft 3 is currently 30% off in the Humble Store. The Dialogue System can import from articy:draft, including localization and voiceover data. (articy:draft is not required to use the Dialogue System. The Dialogue System has its own powerful editor.)
     
  9. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    Awesome, thanks again, I'll look into this .

    What about displaying text history separate from the main dialogue.

    Like players can click a button to see the most recent previous dialogue lines. Can a template read dialogue twice for that?

    I assume I would just need to attach the relevant script again .But I figured I'd ask since I'm here
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Are you talking about scrolling back in the current conversation? If so, tick the dialogue UI subtitle panel's Accumulate Text checkbox as in the WRPG and Runic prefabs.

    Or do you want to review a transcript of the previous conversation? If so, add a little script similar to ConversationLogger.cs. Instead of logging to the Console like ConversationLogger does, store the lines in a string or a UI Text element. Add the script to the Dialogue Manager. The code might look something like:
    Code (csharp):
    1. public UnityEngine.UI.Text transcriptText;
    2.  
    3. void OnConversationStart(Transform actor) {
    4.     transcriptText = string.Empty; // New conversation. Clear transcript.
    5. }
    6.  
    7. void OnConversationLine(Subtitle subtitle) {
    8.     transcriptText += subtitle.speakerInfo.Name + ": " + subtitle.formattedText.text + "\n";
    9. }
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Dialogue System 2.1.8 Released!

    Version 2.1.8 is now available on the Asset Store!

    If you're using 2.1.7, you should update to 2.1.8 since it fixes a crash bug if a sequence contains an unrecognized command.

    In addition to a number of improvements to the editor and runtime features, this version also includes updates to several integrations, including support for SALSA LipSync Suite (SALSA 2.0) and Super Text Mesh, and a text helper export feature for LipSync Pro batch processing.


    Version 2.1.8 Release Notes
    Core:
    • Dialogue Editor:
      • Added option to show Title on dialogue node instead of Dialogue Text.
      • Added option to always auto arrange after adding every node.
      • Added option to increase dialogue node width 2x, 3x, or 4x.
    • Improved: Can now assign Sprites (not just Textures) as actor portrait images.
    • Breaking change: If you have written a custom IDialogueUI C# implementation, you will need to update methods that use Texture2D to use Sprite instead.
    • Improved: If actor's portrait image is null, Standard Dialogue UI deactivates Image component.
    • Improved: Lua "..." Conditions & Script wizards remember last dropdown settings.
    • Fixed: If sequence had unrecognized command, caused a stack overflow instead of reporting that command is not recognized.
    • Fixed: Applying a template to a dialogue database no longer resets the types of variables.
    • Fixed: Added missing built-in sequencer commands to Sequence > + > All Sequencer Commands menu.
    • Improved: Added Fade(unstay) keyword.
    • Improved: SetDialoguePanel() sequencer command accepts optional second parameter immediate.
    • Added: ConversationView.overrideGetDefaultSubtitleDuration delegate to provide custom {{end}} function.
    • Added: Dialogue Manager > Input Settings > Response Timeout Action > Custom for custom timeout handling.
    • Text Tables: Improved performance in very large tables; added PlayMaker actions; GetFieldText() replaces "\n" with newlines.
    • Save System: DiskSavedGameDataStorer inspector now has button to delete saved games; SaveSystemTestMenu is now reskinnable.
    Third Party Support:
    • articy:draft: Unassigned slots converted as Display Name now convert as blank string instead of 0x0000000000000000; added Other Script Fields to converter to convert custom fields from expresso to Lua.
    • LipSync Pro: Added editor feature to export lipsync guide text files for batch processing.
    • Opsive Controllers: Updated for latest controller versions; disambiguated CameraController namespace.
    • SALSA LipSync Suite: Added support for SALSA 2 and TextSync.
    • Super Text Mesh: Added support.
    • uMMORPG: Added DialogueSystemLootQuestInfo.
     
    DMRhodes and SickaGames1 like this.
  12. SorraTheOrc

    SorraTheOrc

    Joined:
    Jun 11, 2016
    Posts:
    207
    I think I may have found a bug and a fix in your RT Voice Pro integration, though I'm not sure how many folks will hit it as I may have caused it to surface by going outside the common use case.

    What I did...

    I'm on Windows and using RT Voice Pro for prototyping. I'm at the stage of needing a larger variety of voices than Windows normally provides. So I imported all the English TTS voices in Windows which come with multiple different languages (en-GB, en-CA, en-IN etc.). After a little registry hacking (thanks for the link in the manual) I had the voices appearing in RT Voice Pro.

    I setup my preferred languages which meant adding a Language code to my RT Voice Actor components, which had been empty previously.

    When I ran my test scene both the characters were using the same voice - the first in the list of available voices. Clearly I had broken something.

    After a while I discovered that
    Localization.Language
    was an empty string. This resulted in
    RTVoiceActor.GetVoice()
    failing to match a voice to my NPC voice preferences.

    This method checks for an empty
    Localization.Language
    string when retrieving the list of voices but then skips over all the voices found with
    if (string.Equals(voicePreference.language, culture))
    . By adding
    string.IsNullOrEmpty(culture) || 
    in this if statement I was able to get things to work again.

    It seems to me that it was working before as my
    voicePreference.language
    was also an empty string.

    I posted this over on the RT Voice Pro forum where Stefan said:

    "If you are using standalone (Windows) only, imho a better way to determine the language is this:"

    Code (CSharp):
    1. string culture = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
    My solution got me working but it might be worth using Stefan's approach for Windows platforms:

    Full text of the
    RTVoiceActor.GetVoice()
    method, with my edit:

    Code (CSharp):
    1.        
    2. public Voice GetVoice()
    3.         {
    4.             var culture = Localization.Language;
    5.             var availableVoices = string.IsNullOrEmpty(culture) ? Speaker.Voices : Speaker.VoicesForCulture(culture);
    6.             foreach (var voicePreference in voicePreferences)
    7.             {
    8.                 if (string.IsNullOrEmpty(culture) || string.Equals(voicePreference.language, culture))
    9.                 {
    10.                     foreach (var availableVoice in availableVoices)
    11.                     {
    12.                         if (MatchesVoicePreference(availableVoice, voicePreference))
    13.                         {
    14.                             return availableVoice;
    15.                         }
    16.                     }
    17.                 }
    18.             }
    19.             return (availableVoices != null && availableVoices.Count > 0) ? availableVoices[0] : null;
    20.         }
    21.  
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @fgardler - I'll go one further. If the Dialogue System's localization language hasn't been set, it will search for matches using the current system language. If for some reason the system language isn't available, it will match preferences regardless of language.

    You can download the updated package from the Dialogue System Extras page or right here:
    RTVoice_Support_2019-07-03.unitypackage
     
    SorraTheOrc likes this.
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Dialogue System 2.1.8 Patch 20190708 Available

    A patch is available on the Pixel Crushers customer download site. If you need access, please PM me your Unity Asset Store invoice number. These improvements and fixes will also be in the next full release on the Asset Store.

    Patch 20190708 Release Notes:
    • Dialogue Editor node search bar: When cursor is in search bar, Enter key starts search; clicking on some areas of node editor search bar no longer accidentally opens conversation title dropdown.
    • Added: NavMeshAgent(stop|destination, subject) sequencer command.
    • Changed: AnimatorPlay[Wait]() sequencer commands now specify fade duration in seconds instead of normalized.
    • Changed: On Watches tab, renamed Update to Refresh to clarify its function.
    • Improved: Custom sequencer commands now support Awake() method, recommend using Awake() instead of Start().
    • Fixed: If continue button assigned but no event configured, StandardUISubtitlePanel now correctly adds OnContinue() only once.
    • articy:draft: Fixed conversion of custom Lua fields that reference articy variables.
    • Invector: Added support for free version of controller.
    • RT-Voice: RTVoiceActor uses current system language if no language specified for Dialogue System.
    • TopDown Engine: Fixed Unity UI input when conversations play without pausing game.
     
    SamRock, DMRhodes and SickaGames1 like this.
  15. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Hi Tony,

    I just updated the asset (removed old version as there were too many error when I upgraded to 2019.2) and when I run the game I see the UI all the time . I didnt trigger any Dialogues. How do I fix it? Did I mess up by deleting old folder?

    DailgoueUI.PNG

    EDIT: When I run the game I see this error in the console. It doesnt stop the gameplay though
    Code (CSharp):
    1.  
    2. NullReferenceException: Object reference not set to an instance of an object
    3. PixelCrushers.DialogueSystem.StandardUISubtitleControls.CheckActorIDOnStartConversation (System.Int32 actorID, System.Collections.Generic.HashSet`1[T] checkedActorIDs, System.Collections.Generic.HashSet`1[T] checkedPanels) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitleControls.cs:426)
    4. PixelCrushers.DialogueSystem.StandardUISubtitleControls.OpenSubtitlePanelsOnStartConversation () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitleControls.cs:395)
    5. PixelCrushers.DialogueSystem.StandardUIDialogueControls.OpenSubtitlePanelsOnStart () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUIDialogueControls.cs:118)
    6. PixelCrushers.DialogueSystem.StandardDialogueUI.Open () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardDialogueUI.cs:91)
    7. PixelCrushers.DialogueSystem.ConversationView.Initialize (PixelCrushers.DialogueSystem.IDialogueUI ui, PixelCrushers.DialogueSystem.Sequencer sequencer, PixelCrushers.DialogueSystem.DisplaySettings displaySettings, PixelCrushers.DialogueSystem.DialogueEntrySpokenDelegate dialogueEntrySpokenHandler) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:75)
    8. PixelCrushers.DialogueSystem.DialogueSystemController.StartConversation (System.String title, UnityEngine.Transform actor, UnityEngine.Transform conversant, System.Int32 initialDialogueEntryID) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Manager/DialogueSystemController.cs:698)
    9. PixelCrushers.DialogueSystem.DialogueSystemController.StartConversation (System.String title, UnityEngine.Transform actor, UnityEngine.Transform conversant) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Manager/DialogueSystemController.cs:743)
    10. PixelCrushers.DialogueSystem.DialogueManager.StartConver
    EDIT#2: I see two Canvas under DialogueManager object when the game runs. However only when when in Edit mode. Is this normal? (Sorry unable to check with backed up version)
    DialgoueUI2.PNG
     
    Last edited: Jul 9, 2019
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @SamRock - I just PM'ed you your access info to download the patch. The line number you reported doesn't match version 2.1.8. Importing the patch may get everything into a good state.

    Since the Dialogue Manager is instantiating a copy of your dialogue UI prefab, it needs to put it in a Canvas. The first Canvas shown in your image is inactive, so in this case the Dialogue Manager creates a new Canvas for the dialogue UI. So the second part of your post is normal.
     
    SamRock likes this.
  17. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    I noticed "Custom Subtitle Panel" does not carry the yposition value of the canvas from the prefab.

    upload_2019-7-9_22-48-11.png

    In play mode it bumps back to zero, and i can't set a height for the character. If i set the height in the UI it makes the panel rotate weirdly cause the pivot is still at the base of the character.

    For now i'm just disabling Y-axis, but is there a solution for this?
     
  18. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Hey, was messing around with the corgi engine integration. The demo integration scene "Corgi Inventory Example" seems to be broken. Talking to the first dude who asks you if you want a teddy bear results in the following error if you select yes

    Code (CSharp):
    1. Dialogue System: Lua code 'mmAddItem("MainInventory", "Teddy", 1)' threw exception 'Tried to invoke a function call on a non-function value. If you're calling a function, is it registered with Lua?'
    2. UnityEngine.Debug:LogError(Object)
    3. PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:219)
    4. PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:120)
    5. PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry, Boolean, Boolean, Boolean) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:233)
    6. PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:297)
    7. PixelCrushers.DialogueSystem.ConversationController:OnFinishedSubtitle(Object, EventArgs) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/ConversationController.cs:224)
    8. PixelCrushers.DialogueSystem.ConversationView:FinishSubtitle() (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:391)
    9. PixelCrushers.DialogueSystem.ConversationView:OnFinishedSubtitle() (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:398)
    10. PixelCrushers.DialogueSystem.Sequencer:FinishSequence() (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:478)
    11. PixelCrushers.DialogueSystem.Sequencer:Update() (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:471)
    and this error if you select no.

    Code (CSharp):
    1. Dialogue System: Lua code 'return mmGetQuantity("MainInventory", "Teddy") > 0' threw exception 'Tried to invoke a function call on a non-function value. If you're calling a function, is it registered with Lua?'
    2. UnityEngine.Debug:LogError(Object)
    3. PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:219)
    4. PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:120)
    5. PixelCrushers.DialogueSystem.Lua:IsTrue(String, Boolean, Boolean) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:162)
    6. PixelCrushers.DialogueSystem.ConversationModel:EvaluateLinksAtPriority(ConditionPriority, DialogueEntry, List`1, List`1, List`1, Boolean) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:378)
    7. PixelCrushers.DialogueSystem.ConversationModel:EvaluateLinks(DialogueEntry, List`1, List`1, List`1, Boolean) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:358)
    8. PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry, Boolean, Boolean, Boolean) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:252)
    9. PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:297)
    10. PixelCrushers.DialogueSystem.ConversationController:OnSelectedResponse(Object, SelectedResponseEventArgs) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/ConversationController.cs:257)
    11. PixelCrushers.DialogueSystem.ConversationView:SelectResponse(SelectedResponseEventArgs) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:467)
    12. PixelCrushers.DialogueSystem.ConversationView:OnSelectedResponse(Object, SelectedResponseEventArgs) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:460)
    13. PixelCrushers.DialogueSystem.AbstractDialogueUI:OnClick(Object) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Abstract/Dialogue/AbstractDialogueUI.cs:346)
    14. PixelCrushers.DialogueSystem.StandardDialogueUI:OnClick(Object) (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardDialogueUI.cs:215)
    15. UnityEngine.Component:SendMessage(String, Object, SendMessageOptions)
    16. PixelCrushers.DialogueSystem.StandardUIResponseButton:OnClick() (at Assets/Packages/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUIResponseButton.cs:124)
    17. UnityEngine.EventSystems.EventSystem:Update()
    The other demo scene seems to be working fine though.

    Thanks for your time, regards
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @sacb0y - That's correct. It instantiates it at the position of the parent (e.g., the NPC). You can apply an offset to a child GameObject of the subtitle panel. The next update will allow you to specify an offset to use when instantiating, just like the Dialogue Actor's Bark UI has.

    Hi @Candy-Bomber - Corgi's inventory examples use Inventory Engine. If you import the Inventory Engine Support package, the example scenes should work.
     
    DMRhodes likes this.
  20. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Ah woops. That did the trick, thank you. :)
     
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    No worries! Glad it's working now.
     
  22. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    Awesome thanks!

    How do i reference a audio file to play during a voice line. I keep getting errors, is it because the names are ismialr to the lipsync files?

    upload_2019-7-10_11-31-36.png

    upload_2019-7-10_11-31-56.png
     

    Attached Files:

  23. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Thanks for the patch!! It did not resolve my issue. However I figured out what the problem was. The issue occurs when I use the customized LetterBox UI template created using past version (probably 2 or 3 updates ago). When I switch to the Template provide with your updates the overlays are gone. Not sure if that helps. But now I am good to go! :)
     
    TonyLi likes this.
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    If you want to play the audio using LipSync Pro for a single dialogue entry:

    1. In the Sequence field, click "+" > Audio Drag-n-Drop > Use LipSync():

    upload_2019-7-10_11-48-32.png

    2. Drag the audio clip (not the lipsync file) into the Sequence field.

    ---

    However, this is a lot of work if you have many dialogue entries. In this case, use entrytags as shown in Part 4 of the Cutscene Sequence Tutorials.

    It looks like your LipSync data files are already named by entrytag. Leave your Sequence field blank, and set the Dialogue Manager's Camera & Cutscene Settings > Default Sequence to:
    Code (sequence):
    1. LipSync(entrytag)
    ---

    In either case, once you set it up, you can move the audio clips out of the Resources folder. Only the LipSync data files need to be there.
     
  25. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    Ooooh i see how the drag and drop works now. I think the issue was that it didn't like that two files shared the same name in that folder. I was intending to use the audio() tag but it wasn't working. But i didn't need the lipsync files for those i just had them made XD
     
  26. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    Apologies if this has been addressed already, but is there an integration for Game Kit Controller included in this package?
     
  27. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @Neviah - There isn't a dedicated integration package, but the Dialogue System provides many ways to integrate with other assets, including:
    • Lua functions: Make GKC functions available in dialogue entry nodes' Conditions and Script fields.
    • Sequencer commands: Call GKC functions in cutscene sequences.
    • Scripting hooks: Add methods to your own scripts that the Dialogue System will invoke.
    • Dialogue System Events: Hook up events in the inspector to run when Dialogue System activity occurs.
    The many dedicated integration packages for other assets use the features above.
     
    hopeful likes this.
  28. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    Hi so I downloaded the textline extra from your site and i get this error.

    Assets\Dialogue System Extras\Textline\Scripts\MenuUtility.cs(20,30): error CS0246: The type or namespace name 'Pause' could not be found (are you missing a using directive or an assembly reference?)

    I downloaded the TextingLogUI_2016-09-21.unitypackage
    I get this error
    "
    Assets\Dialogue System Examples\Conversation Log UI Example\TextingLogUI.cs(66,132): error CS1503: Argument 2: cannot convert from 'UnityEngine.Sprite' to 'UnityEngine.Texture2D'"
     
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi,
    Textline requires the Menu Framework package, too.

    It also has the most up to date version of the texting log UI script, so you don't need the other package from 2016.
     
  30. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    Alright thanks. I was also looking for the SMS text example you did some months ago.
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    The Textline package contains the most up to date SMS text style functionality.
     
  32. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    Yeah ok. Does it contain how you did it before. The one that works like a real text log from different contacts and also saves messages so you dont have to go through the same messages again every time you open the log.
     
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Yes. The manual has instructions for setting up a "lobby" with different contacts. And it auto-saves when you return to the main menu, lobby, or when you close the app.
     
  34. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    Is there a discord where one could join to easily ask questions and such?
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    I've been sitting on the invite link for a while as I mull over how to enforce its use as a place for the community to discuss assets and help each other out with quick questions, but not as a primary support channel. For support questions, I'll still ask that people post here or on the Pixel Crushers forum since discord isn't a good way to provide answers that other people can easily find in the future.

    That said, what the heck, let's open it up: https://discord.gg/FwUaCNt :)
     
    DMRhodes and Akshara like this.
  36. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    I think i figured out what i would prefer from the cinemachine integration, I would prefer integration where the system instead of adjusting priority, instead toggles activation of the camera object. That's how my system works currently for other camera management when it comes to UI and stuff.

    If the system worked like this, instead of having to worry about if the priority reset when the dialogue/conversation ends, it would simply disable if it's not active. Priority would be set, and i can just have it to a high value to override other cameras at the base value and activation control when it works.

    I might just try to set this up myself, as i think it would be much more manageable. If i want a camera to maintain through multiple scenes I could just repeat the sequence.
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    @sacb0y - That's fine. Here are some suggestions to accomplish that:
    • Use SetEnabled() sequencer commands to disable/enable a VirtualCamera component, or SetActive() to activate/deactivate the entire GameObject.
    • Or write your own custom sequencer command if you'd like to specify your own name or syntax.
    • Or add a Dialogue System Events component to the character. In the OnConversationStart() event, enable a vcam. In OnConversationEnd(), disable it.
    • Or add a script with OnConversationStart and OnConversationEnd methods that do the same.
     
    SickaGames1 likes this.
  38. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    Does set active only work until the dialogue line or conversation is over?

    In currently trying to make the script work like the lipsync function cause that only plays the audio so long as the text is displayed. Skipping text ends the audio early.

    This seems to work with the "on destroy" to make that happen.
     
  39. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    No, it's permanent. It works like the C# GameObject.SetActive() method, or ticking the GameObject's active/inactive checkbox in the inspector.

    If you don't want to write your own sequencer command, you can use a sequence like
    Code (sequencer):
    1. SetActive(MyVcam,true);
    2. LipSync(entrytag)->Message(Done);
    3. required SetActive(MyVcam,false)@Message(Done)
    The first line sets "MyVcam" active.

    The second line plays LipSync() for the current dialogue entry. When it's done, it sends the sequencer message "Done". (Sequencer messages are arbitrary strings of your choosing.)

    The third line waits until the sequencer message "Done" is sent. Then it deactivates MyVcam. If the player skips early, the "required" keyword ensures that the command runs anyway, to guarantee that MyVcam is deactivated.
     
  40. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    Oooooh, cool, that's really impressive stuff!

    I think I'll still do sequencer command cause I'm going to be changing camera angles a lot. In short I'm trying to make dialogue more cinematic by doing so (but also allowing optional player camera control). So making it easy to add with a single sequence command is ideal.
     
    TonyLi likes this.
  41. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    I tried this but it's not working, what am i doing wrong? XD

    it doesn't even activate the object.

    Code (CSharp):
    1. #if UNITY_2017_1_OR_NEWER
    2. using UnityEngine;
    3.  
    4. namespace PixelCrushers.DialogueSystem.SequencerCommands
    5. {
    6.  
    7.     /// <summary>
    8.     /// Sequencer commannd CinemachineToggle(vcam, [Enabled])
    9.     ///
    10.     /// Enables a Cinemachine virtual camera.
    11.     ///
    12.     /// - vcam: The name of a GameObject containing a CinemachineVirtualCamera.
    13.     /// - enabled: (Optional) Set vcam enabled (Default True).
    14.     /// </summary>
    15.     public class SequencerCommandCinemachineToggle : SequencerCommand
    16.     {
    17.         public Cinemachine.CinemachineVirtualCamera vcam;
    18.         public bool active;
    19.         public void Start()
    20.         {
    21.             var subject = GetSubject(0);
    22.             vcam = (subject != null) ? subject.GetComponent<Cinemachine.CinemachineVirtualCamera>() : null;
    23.             active = GetParameterAsBool(1, true);
    24.             if (vcam == null)
    25.             {
    26.                 if (DialogueDebug.LogWarnings) Debug.LogWarning("Dialogue System: Sequencer: CinemachineToggle(" + GetParameters() +
    27.                     "): Can't find virtual camera '" + GetParameter(0) + ".");
    28.             }
    29.             else
    30.             {
    31.                 if (DialogueDebug.LogInfo) Debug.Log("Dialogue System: Sequencer: CinemachineToggle(" + vcam + ", " + enabled + ")");
    32.                 vcam.gameObject.SetActive(active);
    33.             }
    34.             Stop();
    35.         }
    36.  
    37.         public void OnDestroy()
    38.         {
    39.             active = GetParameterAsBool(1, false);
    40.             vcam.gameObject.SetActive(active);
    41.         }
    42.     }
    43. }
    44. #endif
    EDIT: It's definitely running the sequence, and the debug log seems correct. What am i doing wrong here...

    EDIT:

    upload_2019-7-19_13-57-57.png
     
    Last edited: Jul 19, 2019
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    @sacb0y - The Stop() method makes the sequencer command immediately stop and call OnDestroy(). Since you're calling Stop() in the Start() method, it's probably activating the vcam and then deactivating it in the same frame. You'll need to change the logic so it doesn't call Stop() until you want it to stop. Also, if you send a second parameter to your command, then GetParameterAsBool(1, XXX) will always return the parameter's value, regardless of whether you're calling GetParameterAsBool(1, true) or GetParameterAsBool(1, false). The second value (true/false) is the default value to use if you haven't provided a parameter, such as GetParameterAsBool(1).

    A simpler alternative to a sequencer command might be to add a script with a method like this to the characters:

    Code (csharp):
    1. public Cinemachine.CinemachineVirtualCamera myVcam;
    2.  
    3. void OnSubtitleLine(Subtitle subtitle)
    4. {
    5.     var amISpeaking = subtitle.speakerInfo.transform == this.transform;
    6.     myVcam.gameObject.SetActive(amISpeaking);
    7. }
     
    Last edited: Jul 19, 2019
  43. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    Ok, so how does the lipsync function determine if it should continue playing the audio or if the audio has concluded? Sorry i'm a bit of a noob programmer :/

    Cause that function works in my ideal way where it only plays the voice line so long as that subtitle is active.

    EDIT: Or maybe i'm wrong and it only stops the line cause a new line is playing?...
     
    Last edited: Jul 19, 2019
  44. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    It has three methods:
    • Start(): Starts LipSync by finding the subject's LipSync component and playing lipsync data.
    • Update(): Checks the LipSync component's IsPlaying property. When it's true, calls Stop().
    • OnDestroy(): Stops LipSync if it's still playing (e.g., if the player clicked the skip/continue button).
    If you don't want to use the OnSubtitleLine() method I mentioned above, another idea is to copy the LipSync sequencer command (maybe name yours SequencerCommandLipSyncVcam) and customize it to also activate/deactivate Vcams.
     
  45. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    Well like i said before it's going to be changing cameras, all the time, per line. Think of how a movie might work, except i don't want simply shot and reverse shot.

    Maybe i'll just be forced to use the sequencer setup you mentioned earlier. Being dependent on lipsync is less than ideal...I think i understand how that works now.

    That sequence is exactly what i want, i just wish it was automatic for the sequence command itself XD. If it worked that way it would save me tons of time. EDIT: But maybe that doesn't make sense with how this works

    EDIT2: No i see whats wrong now, hmmmmm, i'll have to think on this longer -_-

    That sequence isn't quite right either...

    EDIT3: To make it clear, i'm in a scenario where the dialogue my be interrupted at any time, and if that happens i have to make sure whatever camera is there is deactivated...perhaps i could just override it with camera priority but thats risky as the game plays longer...

    Thats why the above isn't viable for me.

    EDIT4:

    If i do:
    Code (CSharp):
    1. SetActive(MyVcam,true);
    2. required SetActive(MyVcam,false)@Message(Done);
    That gets me half there but it prevents the dialogue from continuing unless a skip button is selected. The continue button does not appear otherwise.
     
    Last edited: Jul 19, 2019
  46. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    Ok let me ask this then.

    What do i do if i want a function to call when the "continue" button is clicked (when a subtitle has concluded), and not before. I assume this is similar to it ending in the case of a skip or ending the conversation since the message(done) thing worked.

    Is this outside the scope of the sequencer?
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    I'm writing a reply. I think it's easier than you think. Give me a minute to finish it.
     
  48. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    Ah ok cool sorry XD
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    It sounds like this sequence would work:

    Code (sequencer):
    1. SetActive(MyVcam,true);
    2. LipSync(entrytag)->Message(DoneTalking);
    3. required SetActive(MyVcam,false)@Message(DoneTalking)
    Note that I used the entrytag keyword so the sequence can apply to any dialogue entry.

    When LipSync is done, it will send "DoneTalking". SetActive(MyVcam,false) will deactivate MyVcam when "DoneTalking" is sent. If the player skips ahead, LipSync will stop and SetActive(MyVcam,false) will run immediately.

    If you don't want to type this for every dialogue entry, there are several features to make it easier, such as:

    Default Sequences
    Add the sequence above to the Dialogue Manager's Camera & Cutscene Settings > Default Sequence. If the dialogue entry's Sequence field is blank, it will use the Dialogue Manager's Default Sequence.

    To specify a different sequence for player-spoken lines, set Camera & Cutscene Settings > Default Player Sequence. If Default Player Sequence is blank, it will use Default Sequence for the player.


    Conversation Overrides
    The Dialogue Manager's settings apply globally. To override them for an individual conversation, inspect the conversation's properties by clicking on empty canvas space in the node editor. Then tick Override Display Settings.


    {{default}} Keyword
    If you want to play the default sequence and something else, too, use the keyword {{default}}. For example:

    Code (sequencer):
    1. {{default}};
    2. Fade(out,1)@2
    becomes this at runtime:

    Code (sequencer):
    1. SetActive(MyVcam,true);
    2. LipSync(entrytag)->Message(DoneTalking);
    3. required SetActive(MyVcam,false)@Message(DoneTalking);
    4. Fade(out,1)@2

    Shortcuts
    You can also use Sequencer Shortcuts components to define additional shortcut keywords that work like {{default}}. For example, you could define a shortcut {{talk}} that's set to:

    Code (sequencer):
    1. SetActive(MyVcam,true);
    2. LipSync(entrytag)->Message(DoneTalking);
    3. required SetActive(MyVcam,false)@Message(DoneTalking)
    and another shortcut {{yell}} that's set to:

    Code (sequencer):
    1. SetActive(MyVcam YELLING,true);
    2. LipSync(entrytag)->Message(DoneTalking);
    3. required SetActive(MyVcam YELLING,false)@Message(DoneTalking)
    The difference is that the second sequence activates a vcam named "MyVcam YELLING". Maybe it's a closer shot, or angled looking up at the actor's face. Then you can set the dialogue entry's sequence to:

    Code (sequencer):
    1. {{yell}}
    instead of having to type all of the lines above.


    Variables and Lua Code
    You can include Lua variables and Lua code in your sequences using the [var] and [lua] markup tags. For example, when a conversation starts, it sets some variables including: Actor and Conversant. Let's say your player is named Shepard and your Conversant is named Miranda. You can create vcams named "Shepard vcam" and "Miranda vcam". Then you can set the sequence to:

    Code (sequencer):
    1. SetActive([var=Actor] vcam,true);
    2. LipSync(entrytag)->Message(DoneTalking);
    3. required SetActive([var=Actor] vcam,false)@Message(DoneTalking)
    Assuming that you have assigned Shepard to the Dialogue System Trigger's Conversation Actor field, this is equivalent to:

    Code (sequencer):
    1. SetActive(Shepard vcam,true);
    2. LipSync(entrytag)->Message(DoneTalking);
    3. required SetActive(Shepard vcam,false)@Message(DoneTalking)

    You can mix and match these features, too. The {{default}} tag is replaced first, then [var] and [lua] tags, then shortcuts.

    So I think you should be able to set it up without having to writing any code.

    If you do want to hook something up to the continue button, it's just a regular UI button. You can add to its OnClick() event in the inspector.
     
  50. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    I'm sorry i think i might be causing some confusion XD

    This is exactly what i don't want.

    Here's a video with a timestamp of 10:43 that's what i'm looking for in terms of how things play out.



    Works the same without voice acting (different time stamp)



    In short i'm trying to make dialogue conversations play out more like a cut scene, dialogue system works for this but only if a dialogue sequence is inescapable mid dialogue. The camera will change almost every dialogue line. This should work regardless of if there's lipsync.

    In the above example, if the player pauses the game and hits "skip cutscene" then the camera will return to it's former gameplay state, and there's no risk of the formerly active camera coming back unless called again which in most cases it never will be. I need this to happen without knowing which camera is currently active. Camera priority didn't work cause i would have to reset the value for whatever the existing camera is, so activating and deactivating the camera game object is much easier.

    If i solved this by code i could just populate a list of every possible camera for that scene and just make sure it's disabled when the button is clicked, but I thought it would be more efficient to have the camera disabled mid sequence.