Search Unity

[70% OFF - FLASH DEAL] 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,706
    Can you use the mouse for other dialogue UI elements such as clicking on response menu buttons?
     
  2. Frax228

    Frax228

    Joined:
    Jul 19, 2016
    Posts:
    48
    Yes i can. But in text field not working
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Try this:

    1. Inspect the Dialogue Manager. Untick Control Graphic Raycasters. Tick Detect Mouse Control. These are probably already set, but it's good to check.

    2. Play the scene. When you get to the text field, inspect the EventSystem GameObject. At the bottom of the Inspector, "pointerEnter" will show what UI element the EventSystem has detected under the mouse cursor. If it doesn't detect the InputField, make sure no other UI elements are blocking it.

    If that doesn't help, please send an example scene to tony (at) pixelcrushers.com.
     
  4. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    I have a question. Im trying to create this. I have 2 characters running around and want them to have conversations that auto advance. Just like this.



    https://imgur.com/s0sihhZ

    Like they're running around a field during normal gameplay and then hit a trigger I want the convo to start and auto advance after a few seconds.

    I tried barks but barks didn't play out the full convo. I also want to use a normal UI like this.
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @namdo - Use a regular conversation like normal, except you don't need to configure a Dialogue System Events component to disable the player's control since the player should still be able to run around. Set the Dialogue Manager's Subtitle Settings > Continue Button to Never so it can auto-advance.
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @Frax228 - Thanks for sending an example scene. I moved the Text Field UI to be the last child of the Dialogue Panel. This puts it on top. Then I had to adjust the Canvas Group's Blocks Raycasts. I included a screenshot with the steps. If you don't see an email reply from me, let me know.
     
  7. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    That doesn't seem to work. When the convo starts by my player entering the trigger, i have to click the players dialog for it to advance.

    I have a dialog actor on the player and the npc following.
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Untick the Dialogue Manager's Input Settings > Always Force Response Menu.

    p.s. - When you change these settings on the Dialogue Manager, they apply to all conversations. If you want any of these settings to only apply to a specific conversation, inspect that conversation's properties by editing the conversation and clicking on blank canvas area to see the conversation's properties. Then click the Override checkboxes.
     
  9. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    Now it doesnt show players dialog, only npcs.



    https://imgur.com/PfVCGO7

    It skips over the blue bubbles and only shows the non blue one.

    EDIT: I finally got it working. I have to click show PC subtitles during lines. How do I set the amount of time to display subtitles before they auto advance.

    Also how do i remove the trigger conversation after it has played once.
     
    Last edited: Feb 11, 2019
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    You can set the Dialogue Manager's Camera & Cutscene Settings > Default Sequence, or the conversation-specific override, or set the Sequence field in each dialogue entry node.

    If you set it to Delay(5), then every line will display for 5 seconds. If you set it to Delay({{end}}) then it will display for a duration based on the text length. If you set it to AudioWait(audioclip) where audioclip is an audio clip in a Resources folder or assetbundle, then it will play the audio clip and display the subtitle for the duration of the the audio clip. And so on. There's a set of Cutscene Sequence Tutorials if you want more info about sequences.

    Select Add Action > OnExecute() Event. Configure the OnExecute() event to disable the Dialogue System Trigger component.
     
  11. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    DialogueSystemTrigger onDisable doesnt work. However Gameobect setactive does work.
     
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    I mean configure OnExecute() to disable the entire DialogueSystemTrigger component, not set the trigger type to OnDisable. But deactivating the GameObject certainly works, too.
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Dialogue System 2.1.2 Released!

    Version 2.1.2 is now available on the Asset Store. Highlights include:
    • More Mountains's TopDown Engine integration.
    • vis2k's uRPG integration.
    • Bark Group Members can now queue barks to wait for other members to finish barking first.
    • Actor nodes in Dialogue Editor can now use full 24-bit color palette for custom node colors.
    • Shortened folder names to help those who have placed their projects in deep disk directory hierarchies and are running into Windows OS path limits. To get the shorter names, delete Pixel Crushers/Common and Pixel Crushers/Dialogue System before importing the update. (Back up any custom files first.)

    Version 2.1.2 Release Notes
    Core:
    • Changed: Shortened folder names.
    • Added: InputDeviceMethods utility component to access InputDeviceManager in inspector.
    • Improved: Dialogue Editor can now support full color range for custom node colors for actors.
    • Improved: BarkGroupMembers can now queue barks within their groups instead of suppressing other members' barks.
    • Fixed: MessageSystem no longer throws error if sending message from object that's being destroyed.
    • Fixed: RuntimeTypeUtility API change to address iOS issue.
    • Fixed: GameObjects with multiple Dialogue System Triggers set to pause during conversations now pause & unpause correctly.
    • Fixed: In Focus template UI, moved text field on top of subtitle panel so it can be visible during subtitles.
    Third Party Support:
    • i2 Localization: CHANGED: Dialogue System terms now correctly exclude characters that i2 disallows.
    • TopDown Engine: Added support.
    • uRPG: Added support.
     
    DMRhodes and superwendel like this.
  14. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Awesome update. Especially excited about the actor nodes colors. Thank you so much for the continued development! :)
     
    TonyLi likes this.
  15. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    @TonyLi - If dialogue system is waiting for one of 3 possible outcomes from some other part of the game, what's the recommended way to structure that in DS? For instance, if it was combat and the outcome was win, lose, or draw and you paused the conversation during it to wait for the outcome.

    So, I'm guessing combat is sending: PixelCrushers.DialogueSystem.Sequencer.Message(combat_result)

    and the nodes are somehow handling the messages by maybe setting a variable?
     
    Last edited: Feb 18, 2019
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    You can use the WaitForMessage() sequencer command and Conditions.

    Since the Dialogue System must evaluate one extra level ahead to handle certain continue button modes, you will need to use an intermediate node to delay evaluation. You could set up the conversation like this:

    upload_2019-2-18_10-8-35.png


    The first node ("You're in combat!") waits for a sequencer message "CombatEnded". When combat ends, your gameplay script (or visual scripting FSM if you prefer) could run code like this:

    Code (csharp):
    1. DialogueLua.SetVariable("CombatResult", "Win");
    2. Sequencer.Message("CombatEnded");
    If you're using a continue button mode, set the <Delay Evaluation> node's Sequence to Continue() instead of None().

    The final three nodes check the value of Variable["CombatResult"].
     
  17. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    Perfect. Thanks!
     
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Glad to help!
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Dialogue System 2.1.2 Patch 20190218 Available

    A patch is available on the Pixel Crushers customer download site. If you need any of the updates below and don't have access to the download site, please PM me your Asset Store invoice number.

    Patch notes:
    • Fixed: Null reference exception in Dialogue Editor’s Watches tab when exiting playmode in certain cases.
    • Fixed: LuaTable bug affecting SimStatus. (Bug introduced in version 2.1.0.)
    • Improved: When using SimStatus, hover tooltip now shows node’s SimStatus.
    • Improved: Usable component now has OnSelect(), OnDeselect(), and OnUse() events.
    • articy: Fixed import of Response_Menu_Sequence property, multiparagraph markup conversion.
     
    DMRhodes likes this.
  20. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I finally got around to trying this, but I can't get it to work. I have Dialogue System 2.2 and I replaced ScenePortal with ScenePortalEMM and added the code to the LoadSceneProgress method in LoadingScreen.cs. I wasn't too sure about step 3, but I just added the ApplySaveSystemOnStart script to one object in each scene including the EMM MainMenu scene. However, it still doesn't go to the LoadingScreen when portaling to the new scene.
     
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @magique - Is the Scripting Define Symbol PIXELCRUSHERS_SAVESYSTEM defined?

    Here are the test scenes. Note: They will overwrite EMM's LoadingScreen and Maze scenes.

    To test:
    1. Add LoadingScreen, Maze, and Maze2 to build settings.
    2. Play LoadingScreen.
    3. Start a new game. This will load Maze. Move the sphere around so you can confirm that its position is saved.
    4. Move into the long bar (GameObject named SCENE PORTAL). This will load Maze2.
    5. Move into the long bar in Maze2. This will load Maze. You should see that the sphere's position was saved, and the loading screens should have appeared in both scene changes.
     

    Attached Files:

  22. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Yes, it is defined. Otherwise it won't even let you add the ScenePortalEMM script because it's completely in an #if block.

    I will try your steps and see if that is working.
     
  23. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    @TonyLi Have you ever seen where the typewriter effect is not working correctly on iOS? In particular, the typing sound is much louder, less frequent, and laggy. If there are 10 characters being typed, it sounds like only 4 or 5 typing sounds will trigger but they'll be louder than normal and possibly late. It all works fine in the Unity editor.
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @bradbecker - No, and a lot of games have been released iOS that use the Dialogue System. Here are some things to check:
    • Add an Audio Source to the typewriter effect's GameObject. Otherwise the typewriter effect will add one with default value at runtime.
    • If you've assigned a mixer channel to the Audio Source, check its values.
    • Try changing the Audio Manager's DSP Buffer Size to Best Latency.
    • This Knights of Unity blog post has some good reminders for audio import settings: Wrong Import Settings Are Killing Your Unity Game [Part 2].
    • Check the device log for any errors or warnings.
    • This last one isn't likely to be the issue, but if you're using assembly definition files, rename Plugins / Pixel Crushers / Dialogue System / Templates / Link / link.xml to link_old.xml, and rename link_asmdef.xml to link.xml. This will prevent code stripping from removing code that it's not supposed to remove. However, this shouldn't affect the typewriter effect anyway.
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Updated Adventure Creator Integration Video

    The Dialogue System's Adventure Creator integration video tutorial has finally been updated for version 2.x. (Sorry it took so long!) This video was tested with Adventure 1.66 and Dialogue System 2.1.2.

     
  26. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    @TonyLi Thanks! One more question: when using the Link To Another Conversation feature in the graph editor to link the last NPC node of one conversation to the start node of the next conversation, I'm often getting an empty response menu with one blank button showing up. FWIW, the only thing else in that node is usually one Audio() sequencer command. Do you know what setting I should be looking for to fix this?
     
  27. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @bradbecker - Try changing the START node's Sequence to: Continue()

    Or link to a different node in the destination conversation. You can link to a node whose Group checkbox is ticked. You can treat this node as a hub, and link other conditional nodes to it. The Dialogue System doesn't show group nodes in the UI; it just processes them and immediately moves to the next stage in the conversation.
     
  28. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    I tried changing both the start node and the node linking to it to continue() and it still stopped and showed a blank response button. Changing to link to another node worked. I'm guessing that <start> nodes aren't wired up to be linked to like other nodes or there's special logic there overriding other settings? Either way, I can still move forward and create new fake start nodes under the <start> node in every conversation that's linked to.
     
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    START nodes are handled slightly differently. This case may be particular to the way your project is set up. Using group nodes like you did is the way to go.
     
  30. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    For group nodes, why do they have Actor and Conversant fields? Aren't those irrelevant for group nodes?
    Also, is there a visual indicator for higher or lower priority links in the node view?
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    I suppose they are. I'll hide them in a future version.

    No, but that's a good idea. I'll add that to the roadmap, too. Currently you can either click on the link arrow to see its priority or click on the originating node to see its links' priorities in the inspector.
     
  32. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    OK, one more suggestion: the custom node colors per actor are super helpful for multi-conversant conversations but you lose the error color coding on nodes (when no incoming connection, etc). Either let the error coloring override the custom coloring OR switch the error coloration to a different mechanism (e.g. a red glow/outline)
     
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    What if you just don't use red as a custom actor color? Am I missing something?

    I'll certainly make the error coloring override the custom coloring, though, in the next release. Thanks for the suggestion.
     
  34. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    It may have been a fluke. It seems that error colors ARE overriding custom colors most of the time. Perhaps it just didn't show up until I switched conversations. Not sure.
     
  35. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    Two more questions:

    1. Is there an easy way to speed up the typewriter effect just for one node?
    2. What's the best way to add an automatic pause after a voice-over? Basically, is there an AudioWait+1s equivalent?
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi,
    You can use RPG Maker-style codes in your text.

    If that doesn't cover what you need, you can write a custom sequencer command.
    Code (csharp):
    1. public class SequencerCommandTypeSpeed : SequencerCommand {
    2.     void Start() {
    3.         Stop(); // Immediately set the typewriter effect and finish.
    4.     }
    5.  
    6.     void OnDestroy() {
    7.         var typewriter = (DialogueManager.dialogueUI as StandardDialogueUI).conversationUIElements.defaultNPCSubtitlePanel.GetTypewriter();
    8.         typewriter.charactersPerSecond = GetParameterAsFloat(0);
    9.         typewriter.StartTyping(DialogueManager.currentConversationState.subtitle.formattedText.text);
    10.     }
    11. }

    Change this Sequence (for example):
    Code (csharp):
    1. AudioWait(entrytag)
    to this:
    Code (csharp):
    1. AudioWait(entrytag)->Message(Done);
    2. Delay(1)@Message(Done)
    The first line sends an arbitrary message (in this case "Done") to the sequencer. The second line doesn't start until the sequencer receives this message; then it delays for 1 second.
     
  37. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    In the standard quest tracker HUD, is there a simple way to show completed quests with -strikethrough-?
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Yes, if you switch to TextMesh Pro. You can assign different TextMesh Pro elements for active, successful, and failed items to the Quest Track Template. Just turn on strikethrough for the successful and failed elements.
     
  39. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    Great--that was easy.
    Is there a safe way to reorder your conversations in the dropdown list? I know you can create subfolders by putting slashes in the name but with those at the same level, I tried changing the index of some but that seemed to create instability.
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @bradbecker - Select Menu > Sort > By Title.
     
  41. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    Is there a looping option for Audio()? One example is a phone that rings during a response menu until you answer it.
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    No, but you could use the SetEnabled() sequencer command. Say you have a GameObject named Phone. Add an Audio Source, tick Loop, and disable it. Use this sequencer command in the preceding node to start the phone ringing:
    SetEnabled(AudioSource,true,Phone)
    And, when the player chooses a response (i.e., in the response's Sequence), this command to stop:
    SetEnabled(AudioSource,false,Phone)
     
  43. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    @TonyLi One of my unity devs has been sending a message to DS like this:
    DialogueLua.SetVariable("someBoolean", true);

    and I'm checking it in a condition like:
    Variable["someBoolean"] == true

    and it's always false.

    Are we doing this wrong or should that code work?
     
  44. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    Nevermind--figured it out.
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Glad you got it figured out! BTW, you may find the Dialogue Editor window's Watches section to be helpful. Use it to see runtime values of your variables:

     
  46. jrackley

    jrackley

    Joined:
    Jan 26, 2017
    Posts:
    55
    Hello, I keep getting a running error whenever I am clicked on Dialogue Manager prefab in my heirarchy, and or scrolling the inspector options for it. I am using Unity 2018.2.14f1 and it is the Plus version. Weird thing is that it does not seem to happen on the free version, only my plus version.
    Anyhow here is the error code and I am hoping you could give me some advice as how to fix the issue, I understand it is dealing with the editor window which is why the inspector does not display the style correctly. The good thing is, so far it seems to not effect any of the asset, just really annoying,lol.
    I am also using the latest version 2.1.2 of DS.

    NullReferenceException: Object reference not set to an instance of an object
    PixelCrushers.DialogueSystem.DialogueSystemControllerEditor.DrawDisplaySettings () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Inspectors/Dialogue Manager/DialogueSystemControllerEditor.cs:171)
    PixelCrushers.DialogueSystem.DialogueSystemControllerEditor.OnInspectorGUI () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Inspectors/Dialogue Manager/DialogueSystemControllerEditor.cs:77)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1367)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    thanks for any help on getting this resolved.
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @jrackley - That's fixed in Patch 20190218 if you have access to the Pixel Crushers customer download site. (If you need access, please PM me your Asset Store invoice number.) It will also be in the upcoming version 2.1.3, and I attached the fix to this reply. [EDITED: Fixed attachment]
     

    Attached Files:

    Last edited: Mar 4, 2019
  48. jrackley

    jrackley

    Joined:
    Jan 26, 2017
    Posts:
    55
    Sent the PM with invoice number. When I download the above attachment, Unity says "Nothing to Import all assets already in project"
    Thank you in advance for your time.
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Sorry, human error; looks like I exported wrong. I just updated the file in my previous reply. This is why I automate regular releases. :)
     
    Weblox likes this.
  50. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi I have a database with many dialogues for different NPCs but when I talk to the NPCs the character name (under a box which you can use a picture) is always the same. For example I talk to a girl NPC (which I named it) then the name under the picture box is girl NPC but when I talk to other like Man NPC the name under the picture box in the dialogue screen says girl NPC