Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    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,626
    Dialogue System & Quest Machine 50% Off in Best Of... Sale

    If you missed last week's sale, you're in luck!
    The Dialogue System for Unity and Quest Machine are both in the Best of Dev Days of Summer sale.

    upload_2023-8-17_13-17-5.png
     
  2. GrassWhooper

    GrassWhooper

    Joined:
    Mar 25, 2016
    Posts:
    103
    Hey, so, i just made a really quick configuration, and the focus template appears to be broken for some reason?

    1.i dragged and dropped the dialogue manager prefab
    2.i added the focus template
    3.i assigned "continue button mode to always"
    4.i disabled "Always include response"
    5.i started the game, and i have a dialogue system trigger that uses the "OnStart"

    as you can see in video, the "portraits" simply do not switch



    Note:
    i noticed that, if i undo points 3 and 4, the portraits start "switching" (fading in and out).

    Note 2: prefabs i dragged into the scene, are prefabs, of the template, i have not modified them in any way.

    Note 3: Gameplay starts in 1:00

    Note 4: none of the conversation blocks (subtitles) use any "script" or "sequences"
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    GrassWhooper likes this.
  4. GrassWhooper

    GrassWhooper

    Joined:
    Mar 25, 2016
    Posts:
    103
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Glad to help!
     
  6. EpicMcDude

    EpicMcDude

    Joined:
    Apr 15, 2013
    Posts:
    117
    Heya Tony!

    Trying to make the Spawnpoint work but I'm having trouble getting it to work.
    - I followed the Save system video tutorial and put the Position Saver component onto my Player object and ticked Use Player Spawnpoint. Added all the necessary components to the Dialogue Manager.
    - I made an empty game object and copied it's string name onto the PM action Load Scene At Spawnpoint, so no spelling mistakes there.
    upload_2023-8-21_3-41-51.png

    But still the next scene loads and Player remains in the same position as the previous scene even though the Spawnpoint gameobject is available in the loaded scene. I have tried both the PM action and the component Scene Portal, calling its method UsePortal upon interaction with a door. upload_2023-8-21_3-42-28.png

    Any ideas as to what I might be doing wrong? Thanks!
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Hi! Check for any errors or warnings in the Console window.

    If there aren't any errors or warnings, make sure your Position Saver has a unique key (e.g., "playerPosition" or something).

    And if that checks out, check your player controller script(s). Maybe they're preventing the Position Saver from moving the player GameObject. Position Saver will check if the player has a NavMeshAgent; if so, it willl use NavMeshAgent.Warp() to move the player. Otherwise it will set the player transform's position and rotation.

    Failing all that, feel free to send reproduction steps or a reproduction project to tony (at) pixelcrushers.com, or set a breakpoint in PositionSaver's ApplyData() method in your code editor and step through to see if uses the spawnpoint.
     
    EpicMcDude likes this.
  8. EpicMcDude

    EpicMcDude

    Joined:
    Apr 15, 2013
    Posts:
    117
    Thank you, after exhausting all the options I found out I needed to have "Pause during transitions" ticked in the Standard Scene Transition Manager for the set position to take place!
     
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Great! I'm glad you found a solution. Pausing must prevent some player controller script of yours from overriding the position that Position Saver sets.
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    While The Iron's Hot, Eternights, and Others at Gamescom

    At Gamescom? Stop by Humble Games in Hall 8 to play the latest version of Bontemps Games' While The Iron's Hot, made with the Dialogue System for Unity and Quest Machine:



    Also at Gamescom, Studio Sai just announced at the Future Games Show that Eternights will be releasing early on September 12 and will get a physical release:



    The lead designer of Eternights also did a short interview with FGS: Eternights Developer Interview

    Reminder: The Dialogue System for Unity and Quest Machine are both 50% off in the Best Of... Sale.

     
  11. carmofin

    carmofin

    Joined:
    May 13, 2017
    Posts:
    89
    I have encountered an issue, let me try to explain.
    I created a Starter scene into which I put all the UI components for my game.
    This includes the Dialogue Manager.
    I am using your system for scene transitions and it indeed plays the animation nicely when I exit the scene.
    But ever since I put the dialogue system into the starter, the next scene starts without a transition being played.
    It seems like it just forgets to do it because it didnt get reloaded.
    Is there any obvious way to fix this?
     
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Hi! Are you using a Standard Scene Transition Manager component on your Dialogue Manager, like in DemoScene1's Dialogue Manager? Alternatively, you can import the SaveSystemPrefabs package from the Dialogue System Extras page and add set it up using the README file in the package. If you use the SaveSystemPrefabs package, make sure your Dialogue Manager GameObject doesn't have a Save System component.
     
  13. carmofin

    carmofin

    Joined:
    May 13, 2017
    Posts:
    89
    I am using the Standard Scene Transition Manager like this:
    upload_2023-8-24_14-2-59.png
    What can I do to make it work?
     
  14. carmofin

    carmofin

    Joined:
    May 13, 2017
    Posts:
    89
    I'll try to explain again: It works when I leave the scene. But it does not work when the next scene loads in! The enter scene transition is not working.
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    How are you initiating the scene change?

    Are you using an unmodified version of the SceneFaderCanvas that ships with the Dialogue System? Or something custom?

    As a test, if you add DemoScene1 & DemoScene2 to build settings, play DemoScene1, and use the door on the left to go to DemoScene2, does the scene transition fading work?
     
  16. carmofin

    carmofin

    Joined:
    May 13, 2017
    Posts:
    89
    I have not modified anything.
    The scene change is initiated using the scene portal. Everything worked fine while each scene had its own dialogue manager.
    Now that the dialogue manager is located in the starter scene that only loads once, the eneter scene transition stopped working.
    Edit: the example scenes work fine, as expected.
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    The GameObject with the Save System component (which I believe is the Dialogue Manager GameObject in your case, as it is in DemoScene1) moves itself into the DontDestroyOnLoad scene, so it doesn't matter if it's in a starter scene or a gameplay scene. It needs to put itself in DontDestroyOnLoad so it sticks around to fade in after the scene change.

    Are there any errors or warnings in the Console window?

    Please feel free to send a reproduction project or reproduction steps to tony (at) pixelcrushers.com.
     
  18. carmofin

    carmofin

    Joined:
    May 13, 2017
    Posts:
    89
    The SaveSystem sits on the Dialogue Manager.
    The Dialogue Manager sits in DontDestroyOnLoad.
    There are no error messages.
     
  19. carmofin

    carmofin

    Joined:
    May 13, 2017
    Posts:
    89
    It sticks around properly, because when I leave the next scene, it fades out properly. It just will not fade in.
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Are you using the same SceneFaderCanvas and animator controller that DemoScene1 uses?

    Is something in the next scene doing anything with Time.timeScale on start?

    If you can determine reproduction steps, or if you can send a reproduction project, please feel free to send it to me.
     
  21. carmofin

    carmofin

    Joined:
    May 13, 2017
    Posts:
    89
    I can tell you this: The transition was working completely fine when every scene had a dialogue manager sitting in it.
    I copied the manager to the starter scene and deleted it form all the other scenes and since then the transition is missing.

    I would love to send you the project, but it is really large and entangled in a lot of other components that i dont know how to untangle!
     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    I've attached an example. Add DemoScene1X and DemoScene2 to build settings, then play StarterScene. You should see fade in and fade out when going from StarterScene to DemoScene1X and from DemoScene1X to DemoScene2. Please compare this to your own scene setup. Maybe it will highlight a difference.
     

    Attached Files:

  23. mirts

    mirts

    Joined:
    Dec 26, 2012
    Posts:
    32
    Hello!
    I've noticed that QuestLog.AddQuestStateObserver is "time sensitive". I am calling it in Start() and it works if I use Playmode in the Editor. But in a build, the Observer isn't registered successfully (or maybe overwritten).
    To test the theory of time sensitivity I added a delay of 1 second in Start() before calling AddQuestStateObserver. And yes, then the registration is successful and the callback happens.
    But I obviously don't want to just add delays everywhere. Do I need to check if DialogueSystem / Lua is ready before I can add an observer? Where in the lifecycle can I call the method and be sure the registration sticks?
    Thanks!
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Hi - The observer system also initializes in Start(). The simplest solution is to wait until the end of the frame:
    Code (csharp):
    1. IEnumerator Start()
    2. {
    3.     yield return new WaitForEndOfFrame();
    4.     QuestLog.AddQuestStateObserver(...);
    5. }
    However, you can also wait until DialogueManager.instance.isInitialized is true or hook into the C# event DialogueManager.instance.initializationComplete.
     
  25. mirts

    mirts

    Joined:
    Dec 26, 2012
    Posts:
    32
    I tried the solution with WaitForEndOfFrame but it doesn't work. The callback still doesn't happen.

    Calling DialogueManager.instance.initializationComplete in Start results in a null reference exception.
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Does your scene have a Dialogue Manager GameObject? (Otherwise there will be no instance, so DialogueManager.instance will be null.)

    Instead of "yield return WaitForEndOfFrame();", you could use "yield return null;".
     
  27. mirts

    mirts

    Joined:
    Dec 26, 2012
    Posts:
    32
    I found the issue. The Dialogue Manager was in a partial scene that was loaded after the scene that had the object which registers the callback. Your pointer regarding the scene having no Dialogue Manager was right on the money!
    Now when the Manager is loaded before my code it seems I can register the callback in Start without any additional checks.
    Thanks so much for the quick support! :)
     
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Glad you found the issue. Happy to help!
     
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Peglin at Gamescom

    I forgot to mention that Red Nexus Games' breakout hit Peglin is also at Gamescom, in addition to Eternights, While the Iron's Hot, and others. If you're there, say hi to the dev team!

    upload_2023-8-26_8-29-22.png


    Reminder: The Dialogue System for Unity and Quest Machine are both half price -- 50% off -- in the Best Of Dev Days Of Summer Sale.
     
  30. fax58

    fax58

    Joined:
    Dec 27, 2021
    Posts:
    42
    Hi Tony!
    I have a small problem: I need to change color to invalid responses. I'm already using the "Show invalid" boolean in the Dialogue Entries templates, and I read that in an old post you wrote:
    "You can also specify an emphasis setting ([em] code) for invalid entries to further distinguish them from clickable responses", but I didn't understand how to use it.
    Do I have to specify an [em-something] in every node that could be disabled and then set it in the Emphasis settings? Could you please provide some example?
    Thanks in advance
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Hi - You don't need to specify an [em#] tag in every node. By ticking Include Invalid Responses and setting the [em# Tag For Invalid Responses, the Dialogue System will automatically add [em#] tags around your invalid response button text:

    upload_2023-8-26_10-11-52.png

    upload_2023-8-26_10-11-59.png

    If you want to conditionally show some invalid responses but not others, please see this forum post.
     
  32. fax58

    fax58

    Joined:
    Dec 27, 2021
    Posts:
    42
    Hi Tony and thanks for the explanation. It was so easy but I didn't see it :(
    I'm having another issue I've been trying to resolve, happening only in the build, never in the editor. Basically in the last node of a conversation I set a quest state and then I run some custom Lua code. Even if that is the last node and is not connect with anything, it automatically restart the conversation with the same NPC, as if I pressed the interact button again (of course running the next conversation with that NPC in a infinite loop).
    I have 5 NPC's and this is happening just with this one, even if they all run the same code. And having this bug just in the build and not in the editor is very strange.
    Did something similar happened to you or some other Dialogue System user?
    Thanks in advance
     
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Does it restart when you click a continue button to dismiss the conversation? If so, inspect your Dialogue System Trigger and tick Prevent Restart On Same Frame Ended.
     
    fax58 likes this.
  34. fax58

    fax58

    Joined:
    Dec 27, 2021
    Posts:
    42
    Thanks for your answer, I found the bug.
    That NPC has the Dialogue System Trigger set to OnTriggerEnter just for the first conversation. Then I wrote a super easy script to change it to OnUse after the first conversation end. It works perfectly in the editor but apparently it does not in the build


    public class NPCFromTriggerToUse : MonoBehaviour {

    DialogueSystemTrigger dialogueSystemTrigger;

    private void Start() {
    dialogueSystemTrigger = GetComponent<DialogueSystemTrigger>();
    }

    private void OnConversationEnd(Transform actor) {
    dialogueSystemTrigger.trigger = DialogueSystemTriggerEvent.OnUse;
    }

    }


    Is there some built in tool to achieve the same result? Or do you know why the OnConversationEnd does not work in the build?
    Thanks in advance!
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    @fax58 - OnConversationEnd() is only invoked on the Dialogue Manager GameObject and the conversation's primary conversation actor and conversation conversant, and their children. (Script Methods & Recipients) Maybe this GameObject isn't being used as the actor or conversant. (Actor GameObject Assignments) You can check by setting the Dialogue Manager's Debug Level to Info. (Debugging & Logging Tutorial)

    You could add 2 Dialogue System Triggers, one set to OnTriggerEnter, one set to OnUse. Leave the OnUse trigger disabled. In the OnTriggerEnter trigger, use an OnExecute() UnityEvent action to disable the OnTriggerEnter trigger and enable the OnUse trigger.
     
    fax58 likes this.
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
  37. fax58

    fax58

    Joined:
    Dec 27, 2021
    Posts:
    42
    Hi Tony, I solved the bug, thank you very much for all your support! :)
    I have a very last bug on the project: after a conversation with an NPC, a GO becomes visible (in the dialogue node Sequence I have SetActive(GOname, true)). It works perfectly in the editor, but in the build it doesn't become visible. Do you have any idea why this could happen?
     
    Last edited: Aug 27, 2023
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Hi - Glad to help! Maybe the GameObject (GOname) isn't present in the build, or maybe there is more than one instance of it. Temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. Then make a Development Build. This will log verbose details to the Player.log file. As soon as you reproduce the problem in the build, examine the Player.log file. Locate the SetActive() sequencer command near the bottom of the file. It may report what the issue is.
     
    fax58 likes this.
  39. fax58

    fax58

    Joined:
    Dec 27, 2021
    Posts:
    42
    Hi Tony, thanks to your advice I was able to fix also this bug. In the Player.log I noticed that the GO that was not activating, instead of having (GO.Trasform,true) had (GO.RectTrasform,true). So after few modification it is now working also in the build!
    Thanks again, you're the best!
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Always glad to help!
     
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Boba Studios' "Bring Us To Life" Kickstarter for Squirrely Roo Rabbit

    The "Bring Us To Life" plushie kickstarter for Boba Studios' Squirrely Roo Rabbit, made with the Dialogue System for Unity, is live! If you're a fan of the game or want to support a women-owned indie game studio in Baltimore, Maryland, check out the kickstarter options to pledge for rewards such as plush dolls of the game's character, pins, decals, and more.




    upload_2023-8-31_8-42-26.png

    Reminder - the Devs Days of Summer sale ends soon! Now is your last chance to get the Dialogue System for Unity and Quest Machine for 50% off in this sale.
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Dialogue System Games At PAX West - Clam Man 2, BIOMORPH

    At PAX West? Check out some of these great games made with the Dialogue System for Unity:

    Clam Man 2: Headliner (Team Clam, Booth #3026)

    upload_2023-9-2_15-54-48.png


    BIOMORPH (Lucid Dreams Studio, Booth #2925)

     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Eternights - Out Now!

    Congrats to Studio Sai (a single-person-led studio) on the release of Eternights!
    It uses Dialogue System for Unity for dialogue, cutscenes, save system, and more!

    Eternights is a dating action game where you try to make the most out of life during the apocalypse. Monday: Go on a date. Tuesday: Clear dungeon. Friday: Freak out! The clock is ticking!!



    From Noisy Pixel's Eternights Review – An Impressive Action RPG Debut:
     
  44. liboyan

    liboyan

    Joined:
    Sep 21, 2015
    Posts:
    5
    I want to enable tracking of one of multiple tasks when they are started. The corresponding NPC of the task displays a question mark or exclamation mark. How should we operate?
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Hi! Add indicators such as your question mark and exclamation mark elements to your NPC. They can be sprites, 3D objects, whatever you want. Then add a Quest State Indicator component, and assign the elements. In the example below, element 0 is nothing, element 1 is a question mark, and element 2 is an exclamation mark:

    upload_2023-9-13_8-23-20.png

    These are its indicator levels. (0 = nothing, 1 = question mark, 2 = exclamation mark.)

    Then add a Quest State Listener for the quest. Set the Quest Name dropdown. In the Quest State Indicator Levels and/or Quest Entry State Indicator Levels sections, add entries for each quest state or quest entry state that you want to show an indicator. The example below shows a Quest State Listener for the demo's "Enemy Attack" quest. When the quest is in the unassigned state, it shows indicator 1, which is the question mark:

    upload_2023-9-13_8-24-11.png

    Here's another example that shows the exclamation mark indicator (indicator 2) when quest entry 1 is in the success state:

    upload_2023-9-13_8-27-11.png
     
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Congratulations again to Studio Sai -- Eternights, made with the Dialogue System for Unity, is not only #1 on New & Trending on Steam:



    It's also on Sony's PlayStation front page:

     
  47. liboyan

    liboyan

    Joined:
    Sep 21, 2015
    Posts:
    5

    I mean, I just want to display the NPCs corresponding to the currently tracked tasks. The Quest State Indicator script can only control the display of the icon corresponding to the state of the task. When there are multiple NPCs in the scene, how do I know which NPC is tracked by my current task?

    Thank you very much for your answer!
     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    I'm sorry; I don't understand. Would you please post a drawing or a mock-up screenshot that illustrates what you're looking for?
     
  49. liboyan

    liboyan

    Joined:
    Sep 21, 2015
    Posts:
    5
    For example, I have received multiple tasks and I want to find the NPC corresponding to each task. How to give a hint. If there are indicators in the scene, I don't know which NPC I should find to complete the task

    It's like tracking the corresponding NPC in an RPG game where I can see the location of the corresponding mission NPC on the map. Other untraced tasks will not be displayed on the map. Then I can accurately find the NPC who can complete the task
    upload_2023-9-14_10-36-51.png
     
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Hi! Thanks for clarifying. I understand now. The Dialogue System has OnQuestTrackingEnabled() and OnQuestTrackingDisabled() methods to notify you when the player toggles a quest's tracking on or off. (See Quest Script Methods.) You can add a script with these methods to the Dialogue Manager GameObject. In your methods, you can show and hide indicators as appropriate. You don't have to use Quest State Listener components for this; you can use your own indicators.

    If you don't want to write your own script, you can use the Toggle Track Indicator Example (direct download) available on the Dialogue System Extras page. It does what I described above. In the example scene, the Dialogue Manager has a TrackableNPCManager component, and the example NPC has a TrackableNPC component.