Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Fluent Dialogue

Discussion in 'Assets and Asset Store' started by ReynV, Oct 9, 2018.

  1. ReynV

    ReynV

    Joined:
    Sep 24, 2014
    Posts:
    50
    @avillaindesire
    Great that that works for you. I'll have to think about the effect that has.
    Thanks
     
  2. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    Hey @ReynV - thanks for your work and support of this system, it's a pleasure to use!

    I wondered if you could point me in the right direction to edit the options presenter input scheme. I'd like to select dialogue options using the mousewheel, but this control is bound to the 'Vertical' axis input, and I can't seem to find any of your code related to it, which makes me think there's some Unity UI magic going on, but I'm not having much luck finding out more...

    EDIT: I figured out that I needed to tweak values in the Standalone Input Module attached to the event system. I created a new axis using the mousewheel, and set that as the vertical input.

    Now my question is how to stop the UI from registering mouse clicks, as my project doesn't have a visible pointer, but mouse clicks still deselect the dialogue options...

    EDIT 2: Figured that one out too- had to spin up a custom input module, based on replies to this thread.

    Posting this in case it helps someone else make quicker progress!
     
    Last edited: Jan 3, 2021
  3. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    Hey @ReynV, so I have a new question, maybe you can help...

    For context, I'm making a project where the player can move and interact with other objects (eg. switches etc) during dialogues. They can also start new dialogues with other dialogue objects.

    I've got this working using `optionsPresenterScript.ClearOptions();` and `optionsPresenterScript.Hide();` when starting a new dialogue, as suggested by @avillaindesire above. If the player initiates a new dialogue whilst the UI for a previous dialogue is still displayed, then it is cleared and the new one is initiated.

    However there's one minor wrinkle- if the player initiates a second dialogue before the options for the first are populated, then the options for the first dialogue are added to the options for the second dialogue. This seems to be dependent on initiating the second dialogue during the delay between starting the dialogue and the options being displayed, or maybe during the text typing animation duration. Interestingly, if you reply with an option for the wrong dialogue (ie. the previous one), then the dialogue continues following the previous FluentScript, if you reply with a 'correct' option, then it continues following the other (correct) FluentScript.

    I wondered if you had any suggestions for workarounds. One idea that occurs is for me to simply skip directly to the end of the transition displaying the options (ignoring the delay and the typewriting), before calling ClearOptions() and Hide() (not sure if there are methods for that?). But I thought I'd ask in case you had any better ideas...
     
  4. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    @ReynV sorry for the multiple posts, this is a tiny question- how can I set up SoundNodes to use audio from places other than the Sounds/ directory in the Fluent asset? Not a big deal but I'd like to keep my audio files organised :)
     
  5. ReynV

    ReynV

    Joined:
    Sep 24, 2014
    Posts:
    50
    @Jshh Hi!

    The SoundNodes are handled by the SoundHandler, which creates SoundPlayers. Have a look at the SoundPlayer's source, it simply uses Resources.Load, feel free to change that to work however you like.

    You are the second person to request concurrent / multiple dialogues. Please send me a small example of what you are trying to achieve, so that I can get to the issue quicker.

    Thanks!
     
    Jshh likes this.
  6. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    Thanks @ReynV! I really appreciate that you continue to give attention to people asking for help with your asset.

    Here's a quick vid you can check out:



    In case it's not 100% clear, there are two cubes using test dialogues from your example scene- the (first person) player can start a conversation with either one, and then choose to either respond to or ignore the dialogue. A bit like the dialogue systems in Firewatch, Cyberpunk, Oxenfree, maybe others... Anyway if the player initiates a dialogue with the other cube whilst the UI for the first cube is still being written (or the options haven't yet appeared), there are a couple of issues I haven't been able to fix yet- firstly there are some artefacts in the text being typed, secondly, if the response options haven't yet been drawn when the second conversation is initiated, they are sometimes added to the list of options available for the second dialogue.

    Seems like maybe there are coroutines for time delays that I'm not cancelling properly when I call the Hide() and ClearOptions() methods?

    If you want me to send you the example scene let me know. There's quite a bit of other code handling the interactions, but the main Fluent codebase is untouched, I've only made cosmetic changes to the example UI prefabs, and I'm not using a FluentManager script. You can see the same kind of results in your example scene if you disable the playerCanMove code.
     
  7. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    And another tiny one- I've noticed that if I play a sound and then End() the conversation, the OptionsPresenter remains displayed until the end of the sound. That's generally sensible, but it'd be cool if there was a way to override it with a manually specified delay (like the Write() command), so that the OptionsPresenter could be closed whilst a sound continues (for example if a character the player is in a dialogue with starts mumbling and wanders off).

    Maybe there's a workaround for this? Hide() the OptionsPresenter first then play the sound?
     
  8. ReynV

    ReynV

    Joined:
    Sep 24, 2014
    Posts:
    50
    Yeah that should work
     
  9. TKDR

    TKDR

    Joined:
    Apr 14, 2016
    Posts:
    2
    Hi @ReynV,

    I'm in the very early stages of some kind of classic CRPG-esque project, and I was researching dialogue solutions when I came across this. First of all, let me say that it's truly awesome to have assets like this out there. Not only is it rare to find something of this quality that's free, but it's exceedingly rare to find something like this that has been receiving support for years.

    Anyways, as my hobby project (if it ever gets made...) will feature a lot of dialogue, with some pretty complex scenarios, it seems like a must have to be able to jump around in the dialogue tree at will. It's clear to me after taking a look at this asset this afternoon that this is mostly feasible with the provided nodes, but it would be far more powerful if you were given the ability to jump to any exact place within the dialogue tree. I'm thinking there would be some kind of node that has no purpose other than to denote a point of interest (with some kind of unique identification), and there would be another node that would take you to that position within the tree (that uses the aforementioned unique identification), like goto or jump-to-line (but not really).

    Have you considered implementing something like this? I have no knowledge of how fluent script works, and I'd never heard of it before encountering this asset, so maybe I'm asking for something that isn't even possible, idk. It would be very nice to be able to jump to a certain spot though. Thank you for your continued support of this asset.
     
  10. ReynV

    ReynV

    Joined:
    Sep 24, 2014
    Posts:
    50
    I've finally implemented the ability to terminate a script from outside the script, which kills all the coroutines. I'll try and get that on the store in the next week.

    Hi @TKDR

    I have thought about doing something like that, it felt like having a graphical representation would be a better fit for the use case. It could get very messy looking at and figuring out what code like that would do.

    Using the feature selectively would be a plus though, just like selectively using goto.

    I could .Tag("Name") nodes and have a Goto("Name") on branch selection. It is technically possible but not trivial.
    I'll think about it.

    Of course if you just want some common piece of logic to run at different places you can simply put that into a method and call that at multiple places, that is not jumping but at least you don't have duplicate code.

    Thanks!
     
    Jshh likes this.
  11. riaxi18

    riaxi18

    Joined:
    Jun 12, 2018
    Posts:
    1
    Hey Reyn! Your asset has been so helpful for my student game project. Thank you for making it available and accessible for those of us that are just getting started.

    A bug/problem I haven’t been able to figure out:

    I only want the dialogue to run once. After it runs I set the NPC that contains the dialogue script to inactive since I don’t want player to see or interact with that NPC any more. It all works well except when I press talk button again, it shows a blank dialogue box, and if I press space it shows the options from the script of the inactive NPC.

    Any idea what’s going on there?

    thank you!
     
  12. nurbagus7

    nurbagus7

    Joined:
    Jul 2, 2022
    Posts:
    4
    Thanks for this amazing tools @ReynV, this tools is simple to use and to the point. I have a question, how to automatically (without pressing option menu) end the dialogue after the dialogue has been displayed? For better context I use it for intro of my educational rpg game.
    Thanks for your help!