Announcement

Collapse
No announcement yet.

Blueprint Dialogue System

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by Grogger View Post
    I haven't done this myself, but this should be something you can achieve by overriding the DisplayUI function in BPC_Dialogue to do what you want instead of adding a 2d ui to the viewport, and probably would use the 'passive mode' to auto-flow (depending on your use case).
    Probably, but out-of-the-box functionality is always better than digging someone else's BPs

    Comment


      New Update (v1.4)

      New Update Available:
      This version supports UE4 4.9 to 4.14

      This build is mostly a bug fix build with some minor convenience changes. Support for 4.14 has been added.
      v1.4 Changelog:

      General Changes:
      • Moved GetScriptArg macro to the dialogue macro library, so it can be accessed from anywhere (macros are not inheritable)
      • Added CPF_SaveGame flag to the Dialogue variables array

      Fixes:
      • Fixed a bug with the use scanner not always reporting UsableLost
      • Fixed Substance Plugin error (substance plugin is NOT used in this system)
      • Fixed TypewriterDelay 0 not being instant
      • Fixed typewriter effect's max speed being restricted by frame rate, and will now consider excess time for the next item
      • Fixed a crash bug with 4.14 caused by substring receiving an invalid length

      Documentation:
      • Removed incorrect information about executing scripts in branches. It is not currently possible to execute script in the branch column.

      Comment


        Hey Grogger, I'm having some issues with implementing the setpassive system inline. When I put {SetPassiveDialogue(bPassive)} in the text field, it does make the dialogue passive, but I cannot move, interact, or use esc to close the play session.
        When I specify a delay, the play window crashes and returns an infinite loop error.
        Any ideas? I've haven't modified anything from basic setup.

        Comment


          Originally posted by andreasmaragakis View Post
          Hey Grogger, I'm having some issues with implementing the setpassive system inline. When I put {SetPassiveDialogue(bPassive)} in the text field, it does make the dialogue passive, but I cannot move, interact, or use esc to close the play session.
          When I specify a delay, the play window crashes and returns an infinite loop error.
          Any ideas? I've haven't modified anything from basic setup.
          Hi andreasmaragakis. I can't think of anything off the top of my head, I'll check it out tonight when I get home and I'll get back to you soon.

          Comment


            Originally posted by andreasmaragakis View Post
            Hey Grogger, I'm having some issues with implementing the setpassive system inline. When I put {SetPassiveDialogue(bPassive)} in the text field, it does make the dialogue passive, but I cannot move, interact, or use esc to close the play session.
            When I specify a delay, the play window crashes and returns an infinite loop error.
            Any ideas? I've haven't modified anything from basic setup.
            Hi again andreasmaragakis,

            I'm not able to recreate this issue, it doesn't crash and it also doesn't handle input (4.14.1). Trying it out in the sample project and everything worked as expected (Jump is still disabled, but that's because the sample doesn't check if the dialogue is passive or not - this is outside the scope of the sample).

            Are you able to reproduce this same issue in the sample project?

            EDIT: Oh, are you setting the SetPassiveDialogue in the dialogue text column? If you are, try putting it in the PreAction column instead.
            Last edited by Grogger; 12-22-2016, 10:48 PM.

            Comment


              Originally posted by Grogger View Post
              Hi again andreasmaragakis,

              I'm not able to recreate this issue, it doesn't crash and it also doesn't handle input (4.14.1). Trying it out in the sample project and everything worked as expected (Jump is still disabled, but that's because the sample doesn't check if the dialogue is passive or not - this is outside the scope of the sample).

              Are you able to reproduce this same issue in the sample project?

              EDIT: Oh, are you setting the SetPassiveDialogue in the dialogue text column? If you are, try putting it in the PreAction column instead.
              Thanks! The PreAction worked. I'm trying to set up animations right now. Say I have an animation asset 'sad' in my animset, and in the text column I have {PlayAnim('sad')}, is there anything else I need to add besides this script function override? (I'm not entirely sure I've implemented it properly)

              Click image for larger version

Name:	DialogueMood.PNG
Views:	1
Size:	134.4 KB
ID:	1120514

              Comment


                Originally posted by andreasmaragakis View Post
                Thanks! The PreAction worked. I'm trying to set up animations right now. Say I have an animation asset 'sad' in my animset, and in the text column I have {PlayAnim('sad')}, is there anything else I need to add besides this script function override? (I'm not entirely sure I've implemented it properly)

                [ATTACH=CONFIG]122736[/ATTACH]
                Glad to hear the pre-action worked

                For the custom function handler, all that's left (that I can see) is to name the switch's parameter (it should be the name of your function instead of Case 0 - eg. PlayAnim). The switch case is searching for the exact text of the function name to know what path to take.

                Comment


                  I'm having a little trouble getting this to work. Going off the documentation, if my inline script is {PlayAnim('laughing')}, would I be making the switch on name node case 0 into PlayAnim, or laughing? And does it make a difference if I use the play anim node shown above should I be using the play slot animation node where I can specify the asset?

                  Here is the inline:

                  Click image for larger version

Name:	Dialogue.PNG
Views:	1
Size:	8.6 KB
ID:	1120524
                  Attached Files
                  Last edited by andreasmaragakis; 12-24-2016, 05:30 PM.

                  Comment


                    Example Animation function

                    Originally posted by andreasmaragakis View Post
                    I'm having a little trouble getting this to work. Going off the documentation, if my inline script is {PlayAnim('laughing')}, would I be making the switch on name node case 0 into PlayAnim, or laughing? And does it make a difference if I use the play anim node shown above should I be using the play slot animation node where I can specify the asset?

                    Here is the inline:

                    [ATTACH=CONFIG]122749[/ATTACH]

                    Oh right, you're passing in a parameter, sorry I was completely overlooking what you were trying to achieve with my last response (Holiday season, so I'm all over the place haha).

                    The animation 'laughing' needs to be converted into the reference of your animation asset, this is done by copying it into the asset table (copy [ctrl+c] the animation asset from the content browser and paste to the AssetReference column)

                    1) The "switch on name" case 0 should be the name of the function (PlayAnim).
                    2) Place your animation in the asset table (eg. ctrl+c on the asset and paste it
                    3) Use GetScriptArg on your Args array to extract the name of the animation from idx 0 (macro available in MLib_Dialogue if you're using the latest version, else you can find it in BPC_Dialogue and copy it over to your child class)
                    4) Get the named asset from the asset table using the extracted animation name (GetAsset dialogue function)
                    5) Play animation


                    I felt that was a bit hard to follow, so I pasted my version here: https://blueprintue.com/blueprint/k1zzv0s9/

                    I also felt that the blueprintue was hard to follow, so I took some screenshots :P

                    AssetTable
                    Click image for larger version

Name:	AnimAssets.jpg
Views:	1
Size:	283.2 KB
ID:	1120525

                    Example Animation Function
                    Click image for larger version

Name:	DialogueAnimFunc01.JPG
Views:	1
Size:	142.3 KB
ID:	1120526


                    Click image for larger version

Name:	DialogueAnimFunc02.JPG
Views:	1
Size:	162.1 KB
ID:	1120527


                    Click image for larger version

Name:	DialogueAnimFunc03.JPG
Views:	1
Size:	133.0 KB
ID:	1120528

                    Comment


                      I'm not able to copy the animation asset to the dialogueassets data table. In the data editor I can't edit anything but width and height. How would I go about importing the data table to CSVed?

                      Comment


                        Originally posted by andreasmaragakis View Post
                        I'm not able to copy the animation asset to the dialogueassets data table. In the data editor I can't edit anything but width and height. How would I go about importing the data table to CSVed?
                        Aye, the data table editor is limited in some ways. Importing CSV files is explained here: https://docs.unrealengine.com/latest...portingprocess
                        You can work in excel/google spreadsheets too if you prefer (I've been using google sheets for a while now, and used CSVed before that). They export to CSV too

                        Comment


                          Argh! I've replaced DT_DialogueAssetsMain with my own csv and replaced the references, but now the dialogue doesn't start at all when I use E to interact.
                          Going to leave it for the moment. I know there's probably something stupid I'm doing wrong but I'm stumped. Thank you for your help thus far

                          Comment


                            Okay - I've rebuilt the handle function script override and created the animation function - nearly. At the end of the script you have a function; RunEndofAnimScript. I don't have this function. How am I building it?
                            Edit: I also don't have a function for GetAnimInstance that doesn't target the skeletal mesh component. Is this an issue? I don't want to have to reference one skeleton because I'd like to be able to use multiple skeletons with this script.

                            As it is right now, I have 'laughing' as an element for the arg string array but the animation doesn't play.

                            I'm also creating a component I can attach to NPCs that will generate a random name from a markov list. However, whenever I try to cast the new speaker attribute row to the UI_dialogue I get a compile error. What am I missing here?

                            Click image for larger version

Name:	markov.PNG
Views:	1
Size:	122.5 KB
ID:	1120565
                            Last edited by andreasmaragakis; 12-26-2016, 02:54 PM.

                            Comment


                              Hi Greg - I'm noticing BPC dialogue no longer works due to depricated features in UE4. Are you planning an update that fixes these for non-coders?

                              Comment


                                Originally posted by andreasmaragakis View Post
                                Okay - I've rebuilt the handle function script override and created the animation function - nearly. At the end of the script you have a function; RunEndofAnimScript. I don't have this function. How am I building it?
                                Edit: I also don't have a function for GetAnimInstance that doesn't target the skeletal mesh component. Is this an issue? I don't want to have to reference one skeleton because I'd like to be able to use multiple skeletons with this script.

                                As it is right now, I have 'laughing' as an element for the arg string array but the animation doesn't play.

                                I'm also creating a component I can attach to NPCs that will generate a random name from a markov list. However, whenever I try to cast the new speaker attribute row to the UI_dialogue I get a compile error. What am I missing here?

                                [ATTACH=CONFIG]122902[/ATTACH]
                                Sorry about the large amount of posts - I have resolved the markov problem myself. I am wondering if it is possible for the speaker attributes table to create rows and set members in the columns on runtime. I'm reading old posts saying they are read only but just wanted to check if you knew a workaround. I'm trying to get actors withrandomly generated names to be assigned 'personalities' from several data tables but can't seem to get the speaker name to update in the UI, firstly.

                                Comment

                                Working...
                                X