Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. 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. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Hi - None of the dialogue UIs require clicking buttons. It's a configuration setting. Please see How To: Bypass Response Menu When Player Has One Choice.

    However, if these are prewritten texts, another possibility is to use quest entries, and activate each entry as the player does the activity.

    If the text is more dynamic, maybe something like this Backlog Example is what you're looking for.
     
    a2884350 likes this.
  2. a2884350

    a2884350

    Joined:
    Jun 22, 2019
    Posts:
    17
    Thank you for your help, it's already very close to what I need. I'll look into the other parameters tomorrow. Thanks!
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Glad to help!
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Dialogue System Games in LudoNarraCon

    Check out Gamious' Lake and its DLC, made with the Dialogue System for Unity, in the LudoNarraCon sale May 9-16.

     
    a2884350 likes this.
  5. a2884350

    a2884350

    Joined:
    Jun 22, 2019
    Posts:
    17
    Hello, I'm back again. Thank you for your patient response last time. Now I have a few more questions:

    1. I want to concatenate two dialogues without a line break between them. I couldn't find any relevant parameters for this, so I delete '\n' in StandardUISubtitlePanel.cs line 620. Will this cause any issues?

    2. In the dialogue system trigger, I found that it's triggered by a scene object and conversition number is specified. But I want the dialogue to be triggered by code, and I want to specify the conversition number in the code. Is there any way to achieve this?
     
    Last edited: May 11, 2024
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Hi - Please see [HOWTO] How To: Color Actor Name and Indent Text. It's better to make a subclass than to directly modify the Dialogue System's code. Otherwise, if you modify the code, you'll lose your modifications when you update the Dialogue System.
    Yes, use DialogueManager.StartConversation().[/QUOTE]
     
    a2884350 likes this.
  7. a2884350

    a2884350

    Joined:
    Jun 22, 2019
    Posts:
    17
    TonyLi likes this.
  8. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 5, 2024
    Posts:
    549
    Hi @TonyLi, I'm back with minor issues in specific circumstances! :)

    If you choose not to install the demos of Dialogue System, then the Wizard throws an error:
    And same with
    (253,83)
    line/column as well.
     
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Hi! This FAQ explains how to delete the demo: What files can I move or delete? In brief: Delete the Demo folder, but leave Scripts/Demo Scripts in place. They're small, and if you're not using them they'll get compiled out anyway. This allows people who do want to use the demo's movement or camera scripts to use them for quick prototyping without needing to have the whole demo in their project.
     
    Lurking-Ninja and a2884350 like this.
  10. a2884350

    a2884350

    Joined:
    Jun 22, 2019
    Posts:
    17
    Hello, I apologize for bothering you again. I'm trying to set up dynamic trigger supplementing dialogue in a custum WRPG template, with a scenario as follows:

    NPC: “The weather is really nice today.”'
    At this point, the player has 2 options:
    1. “Yes.”
    2. “It will rain later.”

    If a cat appears in the game at this point, the NPC will supplement the dialogue, it will be:

    NPC: “The weather is really nice today. Look, even the cat is out sunbathing."
    At this point, the player maybe has 3 options:
    1. “Yes.”
    2. “It will rain later.”
    3. “Cute cat!”

    I don't want to configure an entire dialogue separately for each instance, as there are many branches triggering supplementary dialogue. After repeatedly configuring and consulting the documentation, I haven't found a solution. Is there any good implementation solution?
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Hi! Let's say you've registered a C# method bool IsCatHere() with Lua that returns true if the cat is present. To show the "Cute cat!" response option when the cat is present, set that node's Conditions:

    upload_2024-5-13_9-49-5.png

    To also show it in the NPC's dialogue text, use the Conditional() function:

    The weather is really nice today. [lua(Conditional(IsCatHere(), "Look, even the cat is out sunbathing.")]​


    If you want to update the response options while the response menu is visible -- let's say the cat walks into the scene while the Dialogue System is waiting for the player to choose a response -- call DialogueManager.UpdateResponses() when the cat arrives or leaves. This will re-evaluate the Conditions on the response nodes and update the menu accordingly.
     
    a2884350 likes this.
  12. a2884350

    a2884350

    Joined:
    Jun 22, 2019
    Posts:
    17
    Thank you for your patience!

    DialogueManager.UpdateResponses() is what I needed.

    However, [lua(Conditional(IsCatHere(), "Look, even the cat is out sunbathing.")] doesn't meet my requirements because it seems to be checking before the dialogue node enters. But what I need is for the cat to appear after the dialogue has started, while the player is still in the selection interface. I need the NPC to append 'Look, even the cats are out sunbathing' at this point.
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    That's more complex because the conversation has already progressed past that dialogue entry and is now on the responses. You can "rewind" the conversation back to that entry by calling:

    Code (csharp):
    1. var previousState = DialogueManager.conversationModel.GetState(DialogueManager.currentConversationState.subtitle.dialogueEntry);
    2. DialogueManager.conversationController.GotoState(previousState);
    or you can just update the subtitle text:

    Code (csharp):
    1. DialogueManager.standardDialogueUI.conversationUIElements.defaultNPCSubtitlePanel.subtitleText.text = FormattedText.Parse(DialogueManager.currentConversationState.subtitle.dialogueEntry.DialogueText);
     
    a2884350 likes this.
  14. a2884350

    a2884350

    Joined:
    Jun 22, 2019
    Posts:
    17
    If I understand correctly, calling the code above first to return to the previous node, and then calling the code below to update the dialogue. It works! But using two of them gives errors as shown in the picture:
    2024-05-13 23-37-10-03.png

    On the other hand, I found a configuration that works, but there are many messy lines, especially after I added the situation where the dog is sunbathing. I'm not sure if there's a problem with that:
    2024-05-13 23-51-36-13.png
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Hi - Use one or the other of the code options I provided above, not both.

    I don't see how your example is any different from using the Conditional() function in a single NPC dialogue entry. You'd still need to somehow re-show the subtitle text as in either of the code examples I provided. If you don't need to update the NPC subtitle text, then you can use Conditional() instead to make your conversation tree simpler.
     
    a2884350 likes this.
  16. a2884350

    a2884350

    Joined:
    Jun 22, 2019
    Posts:
    17
    I understand now, it was my usage problem, thank you for your beautiful plugin!

    By the way, if I need to access the custom field 'customField' in the fields of the current displayed conversation, would it be like the following code? I can't find a function that gets the current conversation directly.
    Code (CSharp):
    1. var conversation = DialogueManager.masterDatabase.GetConversation(DialogueManager.lastConversationID);
    2. Debug.Log("customField:" + conversation.LookupValue("customField"));
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Hi - Yes, that's correct.
     
  18. a2884350

    a2884350

    Joined:
    Jun 22, 2019
    Posts:
    17
    Thank you. And I would like to report a minor error in the documentation. Missing a right ')'

    2024-05-14 21-35-41-49.png
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Thanks! I'll fix it in the next update.
     
  20. a2884350

    a2884350

    Joined:
    Jun 22, 2019
    Posts:
    17
    Hi, I'm back again, I hope you won't hit me, haha.

    After following your guidance last time, I used your second piece of code and encountered a problem:
    I used the WRPG template for the class, and the text updated through this method is not correctly recorded. After the player selects any option, the text reverts to its state before the update. It seems like I need to modify the record, but I couldn't find where to do it.

    Also, I'm looking for the backspace method in TextMeshProTypewriterEffect, that is, a method to reverse type the text, but it seems there isn't such a function. If there is, please let me know.

    By the way, TextMeshProTypewriterEffect.StartTyping and TextMeshProTypewriterEffect.PlayText seem to have no difference, and PlayText is not being called.

    I'll paste my relevant code below in case the issue is caused by how I'm using it:
    Code (CSharp):
    1.  
    2. var oldLength = Tools.StripTextMeshProTags(subtitleText.text).Length;
    3. var newText = FormattedText.Parse(DialogueManager.currentConversationState.subtitle.dialogueEntry.DialogueText).text;
    4. if (newText != subtitleText.text)
    5. {
    6.     subtitleText.text = newText;
    7.     if (Tools.StripTextMeshProTags(newText).Length > oldLength)
    8.     {
    9.         subtitleText.gameObject.GetComponent<TextMeshProTypewriterEffect>().StartTyping(newText, oldLength);
    10.     }
    11. }
    12.  
     
    Last edited: May 17, 2024
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    If I understand you correctly, when the player clicks a response button, it doesn't add the response text to the accumulated subtitle text. If that's the case, you just need to tick a checkbox. You don't need to do any scripting. See the screenshot in How To: Bypass Response Menu When Player Has One Choice. Tick the Dialogue Manager's Subtitle Settings > Show PC Subtitle During Line, and UNtick Skip PC Subtitle After Response Menu.
     
  22. a2884350

    a2884350

    Joined:
    Jun 22, 2019
    Posts:
    17
    My setup is the same as what you mentioned. The response text added to the accumulated subtitle text. But the NPC part updated through the code gets reverted.
    Let me simulate the previous scenario.
    my dialogue is configured as:

    The weather is really nice today. [lua(Conditional(IsCatHere(), "Look, even the cat is out sunbathing.")].

    Initially, there is no cat in the scene, and the text displays as:

    --------------------------------------------------------------------------------------------------
    The weather is really nice today.
    --------------------------------------------------------------------------------------------------

    While the panel is waiting for the player to select a dialogue option, the cat enters the scene, the IsCatHere() condition is met, and the panel is updated with the code above, appending the text to:

    --------------------------------------------------------------------------------------------------
    The weather is really nice today. Look, even the cat is out sunbathing.
    --------------------------------------------------------------------------------------------------

    After that, when the player presses the dialogue option button 'Cute cat!' the NPC dialogue above accumulates, but it reverts to:

    --------------------------------------------------------------------------------------------------
    The weather is really nice today.
    Cute cat!
    --------------------------------------------------------------------------------------------------
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Hi,

    Hi - Since that's a special case, you'll need to append the new text yourself to the subtitle panel's accumulatedText property.
     
    a2884350 likes this.
  24. a2884350

    a2884350

    Joined:
    Jun 22, 2019
    Posts:
    17
    Thank you very much, this is exactly what I was looking for.
    And I'm looking for the backspace method in TextMeshProTypewriterEffect, that is, a method to reverse type the text, but it seems there isn't such a function. Sorry to bother you. If this feature is not available at the moment, please ignore this question.
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    There isn't such a function. However, you can start typing at a specific index, not just at the beginning. This is useful if you're appending text. Alternatively, you could look into Text Animator for Unity. The Dialogue System has Text Animator integration.
     
    a2884350 likes this.
  26. a2884350

    a2884350

    Joined:
    Jun 22, 2019
    Posts:
    17
    I'm using start typing at a specific index, it works very well. I will try Text Animator for Unity. Thank you very much!
     
    TonyLi likes this.
  27. DGOneNB

    DGOneNB

    Joined:
    Dec 4, 2022
    Posts:
    6
    I used the code to get the node of the conversation with the corresponding title and modify the dialogue text, but what is displayed in the dialogue UI is not the latest dialogue text which I assigned by the code, but the previous dialogue text which is not the latest content. The dialogue text is not the latest content, and I have used various reset APIs of the tool, but I still can't solve the problem.
     

    Attached Files:

  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Hello,

    To do that, use:
    Code (csharp):
    1. Conversation conversation = DialogueManager.masterDatabase.GetConversation("title");
    2. DialogueEntry entry = conversation.GetDialogueEntry("AnswerReactionATitle").DialogueText = "GOGOGO!!";
    Dialogue databases are ScriptableObject assets. If you change a dialogue database asset at runtime, the change will persist even when you exit play mode. To prevent this, by default the Dialogue Manager instantiates an in-memory copy of the database to use at runtime. (You can turn this off by unticking the Dialogue Manager's Other Settings > Instantiate Database.) If you edit the dialogue database asset like in your code, it won't be reflected in the in-memory copy. Use DialogueManager.masterDatabase to access that in-memory copy.

    However, generally speaking, the correct way to change dialogue text in a subtitle is to use an OnConversationLine method such as:

    Code (csharp):
    1. void OnConversationLine(Subtitle subtitle)
    2. {
    3.     // Replace the word "{GOLD}" with the player's current amount of gold:
    4.     subtitle.formattedText.text = subtitle.formattedText.text.Replace("{GOLD}", Player.Gold.ToString());
    5. }
    and change response menu text using an OnConversationResponseMenu method such as:

    Code (csharp):
    1. void OnConversationResponseMenu(Response[] responses)
    2. {
    3.     for (int i = 0; i < responses.Length; i++)
    4.     {
    5.         if (i % 2 == 0)
    6.         {
    7.             // Bold every even-numbered response:
    8.             responses[i].formattedText.text = $"<b>{responses[i].formattedText.text}</b>";
    9.         }
    10.     }
    11. }
    However, if you want to edit the in-memory database instead, that's fine. Just use the first code example I provided above.

    Also note: Conversation Evaluate Conditions One Extra Level Ahead

    p.s. - The full API is here: Dialogue System API Reference

    Once we've answered this to your satisfaction, please correct your review. Thank you very much!
     
  29. DGOneNB

    DGOneNB

    Joined:
    Dec 4, 2022
    Posts:
    6
    I've been browsing the API for almost an hour but can't find access to get the values of the runtime variables.
    There's nothing more I can do.
    upload_2024-5-25_22-32-53.png
     
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Hi - Use DialogueLua.GetVariable(). Example:
    Code (csharp):
    1. int pictureCount = DialogueLua.GetVariable("PictureCount").asInt;
    2. bool correctness = DialogueLua.GetVariable("Correctness").asBool
    More info in the manual here.
     
  31. DGOneNB

    DGOneNB

    Joined:
    Dec 4, 2022
    Posts:
    6
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Glad to help!
     
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Dialogue System 2.2.46 Released

    Version 2.2.46 is now available on the Asset Store!

    Version 1.0.14 of the Dialogue System Addon for OpenAI, ElevenLabs, etc., is also now on the Asset Store, now with GPT-4o integration.

    Release Notes:

    Core:
    • Changed: If Dialogue Manager's Allow Alerts During Conversations is UNticked, now queues alerts during conversations for when conversation ends.
    • Improved: Conversation dropdowns (e.g., Dialogue System Trigger) now have Open button to quickly open conversation in Dialogue Editor.
    • Improved: Dialogue Editor Watches tab now shows active conversations with buttons to jump to conversation in editor.
    • Improved: Added option to remove synced content from other databases when breaking sync connection.
    • Improved: Usable.overrideName, Usable.overrideUseMessage, and Selector/ProximitySelector.defaultUseMessage are now virtual properties.
    • Improved: StandardDialogueUI.CloseAfterPanelsAreClosed is now virtual.
    • Improved: Added InputDeviceManager.cursorLockMode if you want to change default cursor lock mode from Locked to Confined.
    • Improved: Added Misc section to Lua "..." wizards containing relevant built-in Lua functions.
    • Improved: Added no repeat option to RandomizeNextEntry() sequencer command and Lua function.
    • Fixed: SetContinueMode(original) sequencer command.
    • Fixed: StandardUISubtitlePanel.ShowContinueButton() when other process delays continue button and block input duration is set.
    • Fixed: Updated Tools.StripTextMeshProTags to strip <pos>, <cspace>, <mspace>, <noparse>, <style>, and <voffset>.
    • Fixed: Removed temporary debug log line from StandardUIQuestLogWindow that was inadvertently left in.
    • Fixed: SaveSystem.saveDataApplied is now still invoked even if scene has no savers.
    • Fixed: DialogueLua.SetVariable() and IncrementOnDestroy now observew Assignment.MonitoredVariables.
    • Changed: Release of sequencer camera now only waits 1 frame plus end of frame to allow active required commands to finish instead of 2 frames.
    Third Party Support:
    • Adventure Creator: Lua action now uses "..." wizard.
    • articy:draft:
      • Added "Reorder IDs" option.
      • Fixed importer translation of "///".
      • Custom Conditions property content now properly goes into dialogue entry's Conditions field.
      • Instruction nodes followed by input pin condition now import a buffer node between to delay evaluation until instruction code has run.
    • Cinemachine: Updated integration for Unity 6 (Cinemachine 3) compatibility.
    • i2 Localization: DialogueSystemUseI2Language component now has option to use custom field (e.g., Articy Id) for dialogue entry terms.
    • Ink: Added Lua(x) function.
    • Input System: Monitors InputSystem.onDeviceChange. No need to configure Joystick/Keyboard inputs To Watch.
    • Playmaker: Added Add/SubtractFsmFloat/Int() Lua functions.
    • SALSA Lipsync Suite: SALSA components can now be on subject's child GameObjects.
    • Text Animator: Updated to support typewriter skip ahead without animating skipped characters. Requires Text Animator 2.1.2+.
    • Timeline: Improved preview text for Timeline-controlled conversations; added ability to override dialogue UI.
    • Yarn: Added <<appSeq>> command to append sequences to previous line.
     
    a2884350 likes this.
  34. SOL3BREAKER

    SOL3BREAKER

    Joined:
    Oct 11, 2021
    Posts:
    46
    Sir, if I used a custom lua function to reward player after complete a quest, can player use cheat engine to modify any lua code to get that reward any time they like? Another example is if a quest could only be assgined if player has some dlc, I would add a condition on an entry, but if player could modify that string, then they could unlock that too. Anyway to deal with those circumstances?
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    If it's a single player game, players can generally cheat regardless of whether it's Lua or not. The Dialogue System uses a custom Lua implementation, so they can't just load up any old Lua interpreter to run code. Cheating would need to be kind of similar to someone running one of your C# methods in one of your scripts.

    If you're making a multiplayer game, then regardless of whether it's Lua or C# all requests should go to the server for authorization before making a change.
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Dialogue System-Powered Games - Demos To Play

    Several games that use the Dialogue System for Unity just released public demos or will release them in Steam Next Fest. Two of my favorites are:

    Ova Magica


    Traveler's Refrain


    Reminder - If you have the Dialogue System for Unity, the Addon for OpenAI is 50% off in the Template Toolkits Sale. You can use it to break out of writer's block, quickly prototype conversations and barks, fix up grammar and spelling, translate your content to other languages, and generate voiceover audio.

    Quest Machine is 50% off, too!
     
  37. Enzo36t

    Enzo36t

    Joined:
    Aug 30, 2020
    Posts:
    85
    Hello Tony!

    Dialogue system is awesome. Thanks for making such a great assett! I'm just having some difficulty at the moment though!

    I added a list of items with the dialogue system although I want to make it so these items need to be collected. They seem to be true every time I test out the game. I set the items collected to false using a conversation and then run the game again although it doesn't save. Is there a way to make it so that the inventory items aren't true when playing until they are collected? And, how do I make it so the inventory saves when items are collected or lost?

    Thanks for help on this!
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Hi! Thanks for using the Dialogue System!

    Please set up the save system, and tick the Dialogue Manager's Persistent Data Settings > Include All Item & Quest Data:

    upload_2024-6-8_20-49-16.png

    (Please see the save system link since it contains details not shown in the screenshot above.)
     
  39. Enzo36t

    Enzo36t

    Joined:
    Aug 30, 2020
    Posts:
    85
    Thanks so much Tony.

    I set up everything exactly as guided and it works although I keep having an issue where the Auto Save Load component is in a loop when it's active and keeps loading the game when playtesting and so makes it unplayable. However if the Auto Save / Load component isn't active during play and then I make it active it won't loop but it will load the data. Did I do something wrong? :(

    **edited**
    I created a button to Save and Load
    I also made a seperate button to activate Auto Save Load Component to load the game data.
    This is my only work around at the moment and it is Saving the data and loading the dialogue data perfectly! :)

    Just having a wierd looping issue only if the Auto Save Load Component is set to active and then playtesting. Thanks again, you're one awesome and amazing dude!
     
    Last edited: Jun 9, 2024
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Hi - Glad to help! Yes, your solution is good. Auto Save Load will, as it says, auto load when you playtest. So your solution is a good way to manage that. BTW, as you test builds, you may find that you don't want to auto load in the first scene in build settings -- for example, if it's a splash screen. In this case, you can add that scene's build index to the Auto Save Load's Don't Save In Scenes list.
     
  41. Enzo36t

    Enzo36t

    Joined:
    Aug 30, 2020
    Posts:
    85
    Hello Tony!

    I'm having an issue when playing the game after it is built. The game runs fine except the dialogue system seems to be missing O,O. When I playtest in Unity it's all working fine, however when playing the build version it doesn't exist... Any idea what's going on here?

    I had a dig around and found that someone had this issue and you reccomended; "As another test, try adding a Canvas Scaler to the canvas if it doesn't already have one. Change it to Scale With Screen Size." I checked the Canvas for Dialogue System and it has one already assighned. I'm definitly quite puzzled. This build is for Windows and not VR. Unable to determin the casue of it not showing at the moment.

    I also made a build with just the dialogue builder on screen (It's a 2D game project) No luck there either and so no issue with the canvas hidden behind anything.

    As far as I know I'm using the latest version of Dialogue Builder which was downloaded just last week.

    Thanks for your help. :)
     
    Last edited: Jun 11, 2024 at 5:02 PM
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Hi! Make sure the first scene in build settings has a Dialogue Manager GameObject. This should be your fully-configured Dialogue Manager set up the way you want it (e.g., correct database and dialogue UI assigned).

    If you're using TextMesh Pro and the TextMesh Pro UI elements don't appear, check that the Welcome Window's TextMesh Pro checkbox is still ticked. If you added a build platform after ticking the checkbox, the checkbox may not be ticked for your current build target.

    If none of that helps, set the Dialogue Manager's Other Settings > Debug Level to Info. Then make a build and play it. Review the Player.log file. First check for any errors or warnings. If there are none, confirm that the conversation is starting. If the conversation is starting but doesn't appear onscreen, it could be a dialogue UI issue.
     
  43. Enzo36t

    Enzo36t

    Joined:
    Aug 30, 2020
    Posts:
    85
    Thanks Tony.

    I already had everything set up on the first scene and still no luck after making a new build with TextMesh Pro checked. I wasn't using TextMesh Pro although I have ticked the box for TextMesh Pro now. I followed your guide on setting up dialogue builder and I don't remember being asked about a build platform, how do I check that?

    Also, the conversations are set to On Start, it was the only way I could get them to work, although when I click the buttons on screen the conversations will start up in Unity with no problem. Everything works perfectly in Unity just not in the Build.

    Updated
    I tried to find out further where the issue could be arising and so I put the UI prefab in to a Canvas and disabled the Dialogue Manager on the scene and disabled the Standard Dialogue UI script. I built the game and the prefab still doesn't show in the canvas. Here's an example below of what I had done.




     
    Last edited: Jun 11, 2024 at 10:03 PM
  44. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Hi @Enzo36t - Build settings are a Unity thing, not specifically a Dialogue System thing. In the example screenshot below, this version of Unity has the Windows, Mac, Linux standalone built target installed. The other build targets (Android, iOS, etc.) are grayed out, meaning they're not installed.

    upload_2024-6-11_16-55-19.png

    In the screenshot above, the first scene in build settings is DemoScene1.

    In your own project, make sure the first scene in your build settings has a Dialogue Manager GameObject that's configured the way you want. Then open that scene in the Unity editor and play it in the editor's play mode. Make sure that works.

    If that works, set the Dialogue Manager's Other Settings > Debug Level to Info in the scene. Then tick the Development Build checkbox in your Build Settings window, make a build, and play it. Review the Player.log file. First check for any errors or warnings. If there are none, confirm that the conversation is starting. See the Logging & Debugging Tips video tutorial for an explanation of what the log messages will look like in the Player.log file. (They will be the same as in the Console window in the editor's play mode.)

    Make sure you see "Dialogue System: Starting conversation..." when you try to start a conversation. If the conversation is starting but doesn't appear onscreen, it could be a dialogue UI issue. If you don't see this message, then it's not starting the conversation in the first place.
     
  45. Enzo36t

    Enzo36t

    Joined:
    Aug 30, 2020
    Posts:
    85
    Thanks Tony. The game begins in the first scene on my build so no issue there and that's where the Dialogue Manager is also. There is an error on screen in the build:

    Dialogue System. Dialogue System Trigger "Object" can't fire. There is no Dialogue Manager Game Object.

    Null Reference exception. Object Reference not set an instance of an object.

    I don't have this issue in Unity. Somehow Dialogue System isn't including itself in the build, any ideas?
     
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Thank you! That's exactly the kind of info we needed to know. These components are singletons: Dialogue System Controller, Input Device Manager, and Save System. This means they only allow one instance of them to exist. If two GameObjects have an Input Device Manager or Save System component, one of the GameObjects will be automatically destroyed in the component's Awake method. Your scene probably has another GameObject with a Save System or Input Device Manager component. Unity doesn't guarantee the order in which Awake methods run. In the Unity editor's play mode, the Dialogue Manager GameObject's Awake probably runs first, and then it automatically destroys the GameObject with the other Save System or Input Device Manager component. However, in your build, the other GameObject's Awake method probably runs first, which makes it destroy the Dialogue Manager GameObject.

    The solution is to make sure only the Dialogue Manager GameObject has an Input Device Manager component, and only one GameObject has a Save System component. If you're using a separate Save System prefab GameObject, remove the Save System component from the Dialogue Manager.
     
  47. Enzo36t

    Enzo36t

    Joined:
    Aug 30, 2020
    Posts:
    85
    Awesome! It was because of a duplicate Input Device Manager. Thank you so much for helping out, Tony! :D
     
    hopeful likes this.
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,757
    Glad to help!
     
    Enzo36t likes this.