Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

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

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

  1. digiross

    digiross

    Joined:
    Jun 29, 2012
    Posts:
    259
    Thanks for the info, they are both on sale so i'll pick them both up. I would then own all of your non-UMA assets. :cool:
     
    hopeful and TonyLi like this.
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Thanks! If you have any questions, just let me know.
     
  3. digiross

    digiross

    Joined:
    Jun 29, 2012
    Posts:
    259
    Starting my new project this weekend and I purchased them last night. Just need coffee and hotpockets! :p
     
    TonyLi likes this.
  4. Hieroglyphics

    Hieroglyphics

    Joined:
    Aug 25, 2018
    Posts:
    2
    Hello
    So just to clarify, there is no longer any example scenes that show you how to do this as listed in the Features Demo page of what I assume must be the old documentation.

    I am having trouble trying to find out how to use the camera angles.
    I have a character who is taller than usual and I am trying to A) Either change the camera angle used on that character to use a WIDE or something else that would fit his face in, or B) Change the CLOSEUP for that character to be higher up where his face would be.
    I added a default camera angle script component to the character and then changed the text in the field to "Wide". It hasn't worked at all though. Am I missing some part of the Documentation that explains how to do this?
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Hi @Hieroglyphics - It sounds like you're looking at the legacy version 1.x document. The current documentation is here:

    Dialogue System for Unity Manual

    The Dialogue System Extras page has an example that uses overhead speech bubbles (direct download: For Unity UI, For TextMesh Pro). That's the method I recommend if you want your conversations to use overhead text.

    The documentation section on camera angles is here: Camera Angles

    The Cutscene Sequences Tutorials also cover camerawork.

    This forum thread is another discussion about using custom camera angles and the 'default' camera angle keyword. You can define a new camera angle for your tall character similarly to how the forum user set up camera angles for their shorter characters.
     
    Last edited: Dec 7, 2019
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Updated Integrations: Invector, Realistic FPS Prefab, uMMORPG

    The Dialogue System Extras page has updated integration packages for Invector controllers, RFPSP, and uMMORPG:
    • Invector: Automatically updates Unity UI EventSystem for navigation based on Invector's input settings.
    • RFPSP: Fixes a bug that set jump speed to zero after conversations.
    • uMMORPG: Adds CanTrade() Lua function and ability to show player's uMMORPG portrait in conversations.

    Reminder: The Dialogue System for Unity is 50% through December 13 in the Cyber Mega Sale.
     
  7. wangyucheng1992

    wangyucheng1992

    Joined:
    Feb 19, 2019
    Posts:
    60
    How to operate the Camera?when the NPC speaking,show the conversation clip, I set Continue Button=Always,so the dialogue text was still in the UI,when i click the continueButton go to the next dialogue,but the camera was go to next pos before I click the button,What i need is click the button then dialogue text and Camera go to next? upload_2019-12-9_13-58-10.png upload_2019-12-9_14-1-9.png
    upload_2019-12-9_14-1-53.png
     
    SamRock likes this.
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Hi @wangyucheng1992 - Try these settings:

    1. Set Dialogue Manager > Camera & Cutscene Settings > Default Sequence:

    Camera(default)

    Set Default Response Menu Sequence to:

    Camera(default,listener)

    upload_2019-12-9_8-51-55.png

    You do not need to change Entrytag Format. That is used for entrytags (more info: Entrytags, Entrytags Tutorial).

    2. Add a Default Camera Angle component to SharkMan. Set the angle to Full.

    upload_2019-12-9_8-47-31.png

    If a GameObject does not have a Default Camera Angle, it will default to Closeup.



    Explanation: In your current scene, the Default Sequence is probably:

    Camera(Full);
    required Camera(Full,listener)@{{end}}

    The first command moves the camera to a Full angle of the speaker (SharkMan).

    The second command waits for a duration based on the text length. Then it moves the camera to look at the listener. (The Moose) It does not wait for the continue button. It only waits until the duration of the text length, which is {{end}}.
     
  9. Hieroglyphics

    Hieroglyphics

    Joined:
    Aug 25, 2018
    Posts:
    2
    Many thanks Tony. Much appreciated.
     
    TonyLi likes this.
  10. wangyucheng1992

    wangyucheng1992

    Joined:
    Feb 19, 2019
    Posts:
    60
    Thank for you help!
    upload_2019-12-10_16-3-56.png

    In my object what i need is when subtitle chars was running then click a button it will show all chars immediately,I have try to change these parameter but failed,The effect doesn't seem to have changed at all.but I have not see other related parameter.
     

    Attached Files:

  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Hi,
    Set the Continue Button to Optional or Always:

    upload_2019-12-10_9-5-0.png

    Then make sure your dialogue UI has a continue button that uses Standard UI Continue Button Fast Forward:

    upload_2019-12-10_9-7-43.png

    When you click the continue button:
    • If the text is still typing, it will show all character immediately.
    • If the text is done, it will advance to the next stage of the conversation.
     
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Reminder: Cyber Mega Sale Ends Soon

    Reminder: The Cyber Mega Sale Ends on Friday.

    The Dialogue System for Unity is 50% off during the sale. If it's on your list, make sure to get it before Friday.
     
    Last edited: Dec 11, 2019
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Several games made with the Dialogue System for Unity are up for awards this year! Here are some of them. Voting is still open if you want to cast your votes.

    (Reminder: The Dialogue System for Unity is 50% off in the Cyber Mega Sale which ends in 2 days.)

    Disco Elysium

    Edit: Disco Elysium also just won IGN's PC Game of the Year.

    Windows Central just selected Disco Elysium as Best PC Game of 2019.

    In The Game Awards, Disco Elysium is up for Best Narrative, Best Independent Game, Best RPG, and Fresh Indie Game. If you're a fan of this wonderfully-written and voiced RPG, you can give it a vote. It's also up for several categories in The Unity Awards.




    Jenny LeClue: Detectivu

    Jenny LeClue is nominated for Best 2D Visuals in The Unity Awards for its fun and beautifully-animated art. The writing is also great, and a very kid-friendly choice for the holidays.



    The Way of Wrath

    The Way of Wrath is nominated for Indie of the Year on Indie DB. I'm looking forward to playing this one!



    Congratulations to ZA/UM, Mografi, Animmal, and all the many other devs who released and are developing fantastic games this year using the Dialogue System!
     
    Last edited: Dec 11, 2019
    SamRock likes this.
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Disco Elysium Sweeps Awards at The Game Awards

    Congratulations to Studio ZA/UM for sweeping all of their awards categories for Disco Elysium in last night's The Game Awards! ZA/UM used the Dialogue System for Unity and articy:draft to write their masterpiece.



    Reminder: Voting is still open for the Unity Awards (Jenny LeClue and Disco Elysium) and Indie DB Game of the Year (The Way of Wrath), all made with the Dialogue System.

    ---


    upload_2019-12-13_17-7-16.png

    This is your last chance of the year to get the Dialogue System for Unity at 50% off!
     
  15. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    206
    @TonyLi
    I am not able to find the use the "TimeLineTrigger" script anymore. Its not even appearing in the "Add Component"
    I tried reimporting Dialogue System. Nothing works.
    What could be wrong?
    timelinetrigger.PNG


    timeline.png
     
  16. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    206
    Congratulations @TonyLi! This is awesome news. I have been following the game every since I heard about it!
    I was so proud to know that they used the same Dialogue System as mine... and happy to invest in this great asset :)
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Hi @SamRock,
    Select menu item Tools > Pixel Crushers > Dialogue System > Welcome Window. Make sure the USE_TIMELINE checkbox is ticked. A common reason why this can get unticked is if a Complete Project asset is imported or updated, since they overwrite the settings in Edit > Project Settings > Player > Other Settings > Scripting Define Symbols.

    Thanks! All the credit for Disco Elysium goes to ZA/UM of course for their amazing writing and persistence. But I'm glad the Dialogue System was able to remove some technical hurdles so they could focus on creating their art.
     
    SamRock likes this.
  18. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    206
    Thank you so much. That fixed the issue. I went ahead and enabled CineMachine too. :)
    I recently upgraded to Unity 2019.2. This must have reset things as you said.
     
    TonyLi likes this.
  19. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    206
    @TonyLi

    I am trying to use the "CineMachine Priority" script during conversations, and it doesn't work in my Scene. But when open your example, everything works fine. I even copied your example Vcam to my scene and tried.

    One difference is that I use Cinemachine VCam as my main Cam for my Character. Helps me to transition smoothly during various events. This main Vcam's priority is set to 10

    Anything that I might be missing?
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Hi @SamRock - The CinemachinePriority() sequencer command sets the priority value of a vcam. Cinemachine uses the vcam that currently has the highest priority. So if you want to override the player's main gameplay vcam, you'd use CinemachinePriority() to set another vcam to a priority higher than 10.

    The syntax is:

    CinemachinePriority(vcam, [priority], [cut])

    First make sure the value you're passing for vcam is the name of an active GameObject with a Cinemachine Virtual Camera component. When the command runs, check the Console / output log for any warnings -- for example, if it warns that it can't find the vcam GameObject.

    The second parameter is the priority to use. If you omit this parameter, it uses 999.

    If you specify cut as a third parameter, Cinemachine will cut the camera immediately to the the vcam that has the highest priority. Otherwise Cinemachine will ease the camera from its current position to the vcam.

    If you checked everything above and it still doesn't work, and there are no warnings or errors in the Console, then check all the vcams in the scene. Make sure one isn't hiding somewhere with a higher priority.
     
  21. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    206
    Thank you! This is more flexible than using the CinemachinePriority script! :)

    I was able to switch the Vcam on "Conversation Start" event. ie., Vcam gets set to 999.
    But when I call the same function in "Conversation End" event like, CinemachinePriority(CM conversationCam,1); this does not work (priority remains 999). I can set it to Main cam, but then everytime, I will have to increment it to higher value than before .

    EDIT: Please IGNORE :) I added the same Sequence to my Player's "Conversation End" component. Now it works perfectly fine. THANK YOU SO MUCH
    Sequence.PNG
     
    Last edited: Dec 16, 2019
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Hi @SamRock - Not to complicate matters, but you can also use a Cinemachine Priority On Dialogue Event component. Add it to a character. When the character is involved in a conversation, it will set a vcam to a priority value when the conversation starts and another priority value when the conversation ends. This way you don't even have to deal with sequencer commands.
     
    SamRock likes this.
  23. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    206
    Thank you! Yes this is the best way to do it.
    I always did it to the Cube that triggered the Conversation. Applying to NPC makes perfect sense!
     
    TonyLi likes this.
  24. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    423
    Hello,

    I have a question about management of big databases, lets say I have lots of characters with a ton of dialogues, do I have to store them in 1 database or multiple? Do I make 1 conversation per NPC that contains lets say 10-20 dialogues? Do you have a picture of that many dialogues in 1 conversation, I just want to see how it looks.

    Also I can see that the variables are publicly accessible to every conversation, so Im thinking that I will end up with tens of variables, is there an option to make variables per conversation instead of per database?
     
    Last edited: Dec 18, 2019
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Hi @skinwalker - This section of the manual will help you decide between a single database or multiple: Working With Multiple Databases. A single database is certainly easier. The main reasons to use multiple databases are:
    • If you have multiple simultaneous writers. Since a dialogue database is an asset (like a 3D model or an image), only one person can make changes at a time.
    • If you have a really insane amount of content. That said, Disco Elysium (which does have an insane amount of content) uses one database, but they import it from articy:draft. Another factor is that Unity is working on a fix for a performance bug that affects editing of large assets in Unity 2019.2+ (issue tracker). As your database gets really huge, you may notice a bit of editor lag until Unity fixes the bug or I'm able to implement a workaround.

    In either case, I recommend putting each dialogue in a separate conversation. Group them into submenus by using forward slashes in their titles. For example:
    • Hamlet/Soliloquy
    • Hamlet/Get Thee To A Nunnery
    • Hamlet/Alas Poor Yorick
    • Ghost/I Am Thy Father
    • Polonius/Springs To Catch Woodcocks
    • etc.
    So all of Hamlet's conversations will be grouped in a submenu named "Hamlet". You can use multiple levels, such as "NPC/Hamlet/Soliloquy" and "Objects/Inspection/Tapestry", "Objects/Inspection/Poison", etc.

    You can set up Dialogue System Triggers that start each conversation when appropriate, or you can always start a "hub" conversation (such as "Hamlet/Hub") that simply links to the appropriate conversation based on the current conditions.

    If you'd still like to see an image, let me know. But I recommend multiple smaller conversations instead of a single monolithic one.

    You can add custom fields to conversations, actors, and quests. But most devs end up using variables anyway for convenience. You can add "categories" to variables by putting the category names at the front of the variable name, such as:
    • Play.TalkedToActors
    • Play.IsArranged
    • Play.ClaudiusReacted
    • Ophelia.IsDead
    • etc.
    You can sort alphabetically and/or use a filter like any other Unity window, for example to show only the "Play." variables.
     
    Last edited: Dec 18, 2019
    skinwalker likes this.
  26. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    423
    Thanks for the detailed answer! As far as I understand my writer can work on the dialogue in an empty unity project and then export a file, which I can import so we get 1:1 the same dialogues. Is it also possible to only import selected conversations (the new conversations he wrote) without overriding the whole database, in case I changed something on the old dialogues.
     
  27. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    206
    @TonyLi

    Sorry if this was answered before. But I couldnt find a solution.
    I am using the Letterbox UI for Dialogues. How do I let the NPC's subtitle text remain on screen while showing's PC's response?
     
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    The Dialogue Editor's Database section has a Merge Databases foldout, but it doesn't get as granular as individual conversations or nodes in conversations. If your writer's database has a conversation and your database has the same conversation (by internal ID number), then when you merge the writer's database into your database it will replace your database's conversation. If your writer provides you with a database containing all new conversations, those can merge into your database without overwriting anything.

    Inspect the NPC Subtitle Panel. (It's a child of the Top Panel.) Set Visbiility to Always Once Shown or Always From Start.
     
    SamRock and skinwalker like this.
  29. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    423
    Thanks, I just finished watching all the tutorials and managed to create some awesome stuff. I noticed you are using entrytags to load audio files, is there a way to somehow go 1 folder deeper that is named after the current actor (instead of putting all the audio in 1 folder), currently Ive tried this but doesnt recognize my folder named after the Actor "NPC"

    AudioWait(VoiceActing/Variable["Actor"] /entrytag);
    Delay({{end}})


    I also tried with just "Actor" or "ActorName"

    In my ideal scenario I will have

    Resources/VoiceActing/Npc1/ (all files here)
    Resources/VoiceActing/Npc2 (all files here)
    Resources/VoiceActing/Npc3 (all files here)

    Keep in mind that I will switch to Salsa very soon but I guess its the same thing just a different method call instead of AudioWait
     
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687

    It's possible to use [var=Actor] and [var=Conversant] as in AudioWait(Resources/VoiceActing/[var=Actor]/entrytag) but it's much easier to just use multiple Resources folders for each NPC:

    VoiceActing/Npc1/Resources/*
    VoiceActing/Npc2/Resources/*
    VoiceActing/Npc3/Resources/*

    BTW, Resources folders are handy to get things working quickly. If you want to switch to asset bundles later, you don't have to change any sequencer commands. Just call DialogueManager.RegisterAsset() to tell the Dialogue System to look in specific asset bundles in addition to Resources folders.

    That's correct. Use SALSA() instead of AudioWait().
     
  31. DespairBear

    DespairBear

    Joined:
    Nov 1, 2013
    Posts:
    229
    Hey this might be a duplicate question but is there a simple way to setup dialogue system for interaction just by attaching a simple script to the camera? Curious if this already exists before I go about scripting it. I'm using the Kinematic Character Controller, which I scripted my own behavior, and just need a way to interact with dialogue system triggers from a first person perspective
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Hi! Add a Selector component to the camera. Add a Usable component and a Dialogue System Trigger to interactable objects such as NPCs. By default, the Selector will target Usables in the center of the screen that are on the Default layer.

    If you also add a Selector Use Standard UI Elements component to the camera, it will use the Unity UI prefab that the Dialogue Manager GameObject instantiates at runtime by default. You can customize the prefab to change its appearance. If you don't add this component, the Selector will use legacy Unity GUI.
     
    DespairBear likes this.
  33. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    423
    Hello, I have it a try but for some reason its not working my folder structure is

    Resources/VoiceActing/Npc/NPC_1_1

    The Actor is called NPC and this is the code in DialogueManager

    AudioWait(VoiceActing/[var=Actor]/entrytag);
    Delay({{end}})

    It works if I get rid of [var=Actor] and change my file to be in Resources/VoiceActing
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    I didn't go into much detail in my previous post because I think this folder structure is simpler:

    VoiceActing/Npc1/Resources/*
    VoiceActing/Npc2/Resources/*
    VoiceActing/Npc3/Resources/*

    You don't have to worry about [var=Actor] tags this way. Just put the audio clips in the right folder, such as VoiceActing/Npc1/Resources/NPC1_1_1 and VoiceActing/Npc2/Resources/NPC2_7_42.

    However, if you want to use [var=Actor] and [var=Conversant] tags, this is how to do it:

    [var=Actor] will be the display name of the character assigned as the conversation's actor, typically the player.

    [var=Conversant] will be the display name of the character assigned as the conversation's conversant, typically an NPC.

    Let's say the NPC's display name is "NPC". Then put the audio clip in Resources/VoiceActing/NPC/ and use this Sequence:

    AudioWait(Resources/VoiceActing/[var=Conversant]/entrytag)

    Note that the folder name ("NPC") must exactly match the character's display name, including uppercase/lowercase.

    You can also set the Dialogue Manager's Default Sequence to the command above and leave the node's Sequence field blank.

    For the player's lines, you will need to set the Sequence (or the Dialogue Manager's Default Player Sequence) to:

    AudioWait(Resources/VoiceActing/[var=Actor]/entrytag)

    And of course this assumes that the player is assigned as the conversation actor and the NPC is assigned as the conversation conversant.
     
    skinwalker likes this.
  35. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    423

    Thanks, I get it now. With that structure "VoiceActing/Npc1/Resources/*" the multiple Resources folders act like one folder so I only need AudioWait(entrytag); no matter how nested it is.
     
    TonyLi likes this.
  36. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    423
    Hello, is the audio supported when using Bark actors? I noticed that the same setup works if I use conversation but not bark, maybe something Im missing in the setup. I use DialogueActor on the root game object and DialogueSystemTrigger on a child game object (Barket is set to the Root where DialogueActor is added). The text shows but the audio isnt playing.
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Hi @skinwalker - Yes, barks run sequences just like conversations, so sequencer commands such as AudioWait() should work fine. (Play DemoScene2 to listen to enemy NPCs bark with audio.) If your barker already has an Audio Source component, make sure it's not muted. If it doesn't have an Audio Source, the Audio()/AudioWait() command will automatically add one with default settings.

    To confirm that the sequencer command is playing, temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. When a character barks, it will log the text that it's barking as well as the sequencer commands.
     
    skinwalker likes this.
  38. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    423
    I got it to work by adding the AudioWait command on each dialogue node, it seems that it doesnt work if its just on the DialogueManager "Default Sequence" as in the conversations.
     
  39. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    That's correct. The Default Sequence is only used for conversations. Sorry for the confusion!
     
  40. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    206
    @TonyLi

    Thank you for helping me for the previous queries! I have a awesomely working Conversation setup now all working seamlessly with Cinemachine on NPC! Here is three different conversations. First one is a Timeline cutscene, 2nd and 3rd uses Cinemachine Vcam
    (Please ignore teh actual dialogues) :)


    Questions:
    1. Is there a way to trigger Save after completion of a conversation using Sequencer pr Lua script?
    2. Will I be able to use this asset with DoozyUI?
    3. I am trying to create two menu option "New Game" and "Load Game". What function should I call to load a new game? That is, ignore past saved data?
     
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Hi @SamRock - Looking good! I like your choice of font; it's clean and easily readable but interesting. But the big question is: Can you pet the dog? ;-)

    Add SaveSystemMethods and DialogueSystemEvents components to a GameObject*. Configure the DialogueSystemEvents' OnConversationEnd() UnityEvent to call SaveSystemMethods.SaveToSlot. (Or, in script, call SaveSystem.SaveGameToSlot(#).)

    *If you only want to save after a specific NPC, add it to the NPC. If you want to save after all player-involved conversations, add it to the player. If you want to save after all conversations, add it to the Dialogue Manager.

    There isn't a specific integration, but I don't see why not.

    Call SaveSystem.RestartGame("sceneName"). This will reset the save system's memory and load the scene that the player should start in when starting a new game. Or, in the inspector, add a SaveSystemMethods component and hook up a UnityEvent to SaveSystemMethods.RestartGame.
     
    SamRock likes this.
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Jenny LeClue Giveaway

    For the holidays, Mografi is giving away 5 copies of Unity Awards nominee Jenny LeClue - Detectivu, made with the Dialogue System for Unity. Details on Twitter.

    -----

    Disco Elysium On Sale

    ZA/UM's multiple Game of the Year award winning Disco Elysium, also made with the Dialogue System for Unity, is now on sale in Steam's Winter Sale.

    -----

    Many other popular games made with the Dialogue System are also in Steam's Winter Sale, including Crossing Souls, The Last Door, AvoCuddle, Witch Hunt, and many more!

    -----

    Happy holidays and happy gaming!
     
    SamRock likes this.
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Dialogue System for Unity - Version 2.2.4 Released

    Version 2.2.4 of the Dialogue System for Unity is now available on the Asset Store!

    Highlights of this release include:
    • Native Super Text Mesh integration
    • Your custom Lua functions can now appear in typing-free "..." dropdowns wizards
    • Various updates for Unity 2019.3

    Release Notes:

    Core:
    • Unity 2019.3 updates:
      • Updated to handle Disabled Domain Reloading (new feature in Unity 2019.3+).
      • Updated to handle UI Scaling.
      • Updated to remove deprecated API warnings.
    • Dialogue Editor:
      • Improved: Database template is now stored in database itself as well as EditorPrefs.
      • Fixed: Database auto-backups are saved to Auto Backup Folder instead of same folder as database.
    • Fixed: Dialogue System Events' OnConversationCancelled is now called even if speaker or listener is null.
    • Fixed: SetDialoguePanel() now handles subtitle panels and dialogue panel that all have animators.
    • Fixed: SetMenuPanel() no longer requires player to have a GameObject.
    • Fixed: SetPortrait() sequencer command now correctly changes listener's subtitle panel as well as speaker's.
    • Fixed: When adding multiple databases with overlapping content, Lua environment had content version from last-added database.
    • Fixed: TextMesh Pro Typewriter Effect now handles combination of TMP tags and RPG Maker style pause codes properly.
    • Added: New CustomLuaFunctionInfo asset allows you to add custom Lua functions in "..." dropdown wizards.
    • Added: Lua func UpdateQuestIndicators("quest").
    • Added: [QuestEntryPopup] scripting attribute.
    • Added: CinemachineTarget() sequencer command.
    • Added: Conversation field type to Templates folder. (Uncomment to use.)
    • Changed: ExtraDatabases script execution order changed to -10. If set to OnStart, no longer waits 1 frame.
    • Save System: Added SpawnedObjectManager option to call ApplyData on respawned objects' savers.
    • Text Table: Fixed: right-click context menu would select wrong field row.

    Third Party Support:
    • Adventure Creator: Fixed syncing items at conversation end even if AC.KickStarter.player is unassigned.
    • articy:draft: Dialogue Text and Menu Text now process embedded "\n" codes as newlines; added option to use no actor if not specified (instead of actors 0 & 1).
    • uMMORPG: Added Use Player Icon For Conversations checkbox, CanTrade/ManageGuild/Revive() Lua functions. Fix for QuestStateListeners that use player-dependent Lua conditions.
    • Ink: Added Sequence("commands") external function.
    • Invector: Bridge component now automatically sets up EventSystem to use current Invector UI navigation controls for conversation response menus.
    • PlayMaker: Added PlayMaker Global Variable Saver component.
    • Realistic FPS Prefab: Fixed jump speed which was being incorrectly set to zero after conversations.
    • SLATE: Fixed Start Conversation popup not saving selection.
    • Super Text Mesh: Added native integration for all Dialogue System UIs.

    Coming up on the roadmap:
    • Addressables support
    • New Input System support
    (There is currently a Tools > Pixel Crushers > Common > Enable New Input System... menu item, but it only silences errors about trying to read from the legacy Unity Input system if you've disabled the legacy Unity Input system. The next version should include full support for the New Input System.)
     
    SamRock and skinwalker like this.
  44. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    206
    Awesome updates!
    Thank you again for help on Loading /Saving games Works great
    Sorry just had more questions after implementing it.
    1. Loading Saved games and RestartGame - does it reload the entire level into memory or just resets the already loaded level data? Asking because I am using Level loading screen to show progress - wondering if I should call RestartGame after the level is loaded or before? Same with Loading a saved game.
    2. Is there a way to show all Saved slots like in a Load Screen? Does each slot have a datetime stamp too? Any examples of this? Any many limit on Saved game slots ?
    3. Does RestartGame resets all Saved slots? I assume not
     
  45. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    7,163
    @TonyLi I'm working on an external tool to create Dialogue System compatible CSVs. Is it cool if I release that as a sort of freeware thing? It all started because I wanted to do my dialogue stuff without having to deal with the full overhead of the Unity editor, but I figured I'd ask first just in case.
     
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Hi @SamRock - Call it before. SaveSystem.RestartGame loads the level fresh to make sure everything is reloaded to its original design time settings.

    No limit on slots. The Dialogue System Extras page has a free Menu Framework package that you can use as-is or look at as an example.

    No, it doesn't touch saved slots at all. It only clears the Save System's current memory and loads a starting scene.


    Hi @Murgilod - Sure! Please feel free to post a link here when you release it. I'm sure many people will be interested in it.
     
    SamRock likes this.
  47. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    423
    Hello,

    What is the best way to switch between conversations after one ends? I was thinking about adding a variable that increases after each dialogue ends, but not sure how to load the next or maybe there is a built in way that's better and will save me from making variables for each actor.
     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    Hi @skinwalker - You're ultimately going to need some kind of data point. It will come down to personal preference. I prefer to use Dialogue System variables. They just feel the most convenient to me, especially if I include a "grouping" in variable names, such as "Hart.TimesSpoken" (the number of times the player has talked with Hart), "Hart.GaveCodes" (a Boolean that records if the player has given the codes to Hart), "Hart.PlayerNickname" (a string containing the nickname that Hart has chosen to give the player), etc. Then I can sort them alphabetically to see them in their groups, or set a filter to see, for example, all variables that start with "Hart.". But if you don't want to use variables, you can use a custom field in the actor or an external variable in a C# script.

    Once you've chosen how you're going to store the data point (e.g., a variable), there are two common ways to switch conversations. The first is to always start the same "hub" conversation and immediately branch to different conversations based on the current variable value:

    upload_2019-12-28_9-21-58.png

    Remember to increment the variable in the conversation, too.

    The second way is to use multiple Dialogue System Triggers on the NPC, and set mutually-exclusive Conditions on each one so that only one will fire when the NPC is used:

    upload_2019-12-28_9-28-41.png
     
    skinwalker likes this.
  49. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    423
    Thanks for the answer, I have one more question - is there a reason why the dialogue system events arent getting called on my own game objects (OnConversationStart / End), but they work if I add them to the DialogueManager, Id like to have that script on my main camera as well and deactivate it from there.

    I've tried debugging this

    public void OnConversationStart(Transform actor)
    {
    conversationEvents.onConversationStart.Invoke(actor);
    Debug.Log("Start " + gameObject.name);
    }

    And Im only getting that event received on the DialogueManager game object not from Camera and PlayerInputs even though they all have DialogueSystemEvents component added, my only guess is maybe because "Camera" and "PlayerInputs" arent participants in the dialogue.
     
    Last edited: Dec 28, 2019
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,687
    This page explains which GameObjects receive the events. OnConversationStart/OnConversationEnd events are only sent to the Dialogue Manager and its children, and the participants and their children. The participants are generally those GameObjects assigned to the Dialogue System Trigger's Conversation Actor and Conversation Conversant fields. If the Conversation Actor field is unassigned, it will be the GameObject that triggered the Dialogue System Trigger or a GameObject with a Dialogue Actor that matches the conversation. If the Conversation Conversant is unassigned, it will be a GameObject with a matching Dialogue Actor or the Dialogue System Trigger GameObject itself.

    If you want a GameObject to handle the event regardless of who are the participants, you could put a Dialogue System Events component on your Dialogue Manager. Then add a script to your GameObject that adds a listener:

    Code (csharp):
    1. void OnEnable()
    2. {
    3.     var dsEvents = DialogueManager.instance.GetComponent<DialogueSystemEvents>();
    4.     dsEvents.conversationEvents.onConversationStart.AddListener(LogStart);
    5. }
    6.  
    7. void OnDisable()
    8. {
    9.     var dsEvents = DialogueManager.instance.GetComponent<DialogueSystemEvents>();
    10.     dsEvents.conversationEvents.onConversationStart.RemoveListener(LogStart);
    11. }
    12.  
    13. void LogStart()
    14. {
    15.     Debug.Log("A conversation started");
    16. }
     
    skinwalker likes this.
unityunity