Announcement

Collapse
No announcement yet.

Blueprint Dialogue System

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

    Is there a way when a dialog choice is clicked I can make that actor drop/spawn or give an item to player?

    NVM got it to work with post actions
    Last edited by codeyhanson; 10-02-2019, 07:23 AM.

    Comment


      All my dialogue is being repeated twice in conversations. I'm using all the default setups and have done nothing other then fill out the data tables as instructed in the tutorials. I also just checked the demo content. It is doing it also.
      Last edited by Unshattered1134; 12-03-2019, 11:03 PM. Reason: Checked Demo Content

      Comment


        Is there an easy way to make the dialog UI on world space instead of screen space? I made an actor an I placed a widget inside it. On my Dialogue component, I have overridden the function DisplayUI. I see you update the widget by removing from the parent and creating a new one, but this does not seem to work with world space widgets. I don´t know if I should destroy the widget component and create a new one or if there a simple way to clear all fields and update the texts. Thanks in advance.

        Comment



          Originally posted by Unshattered1134 View Post
          All my dialogue is being repeated twice in conversations. I'm using all the default setups and have done nothing other then fill out the data tables as instructed in the tutorials. I also just checked the demo content. It is doing it also.
          Hi Unshattered,
          Which version of UE4 are you using? The demo and my other projects haven't shown this behaviour since 4.9 so far, and I unfortunately can't think of what could cause this from looking at the code. Is it displaying "Hello World Hello World" or "Hello Hello World World"?


          Originally posted by Livedtrid View Post
          Is there an easy way to make the dialog UI on world space instead of screen space? I made an actor an I placed a widget inside it. On my Dialogue component, I have overridden the function DisplayUI. I see you update the widget by removing from the parent and creating a new one, but this does not seem to work with world space widgets. I don´t know if I should destroy the widget component and create a new one or if there a simple way to clear all fields and update the texts. Thanks in advance.
          There isn't a built in way to do this, but in the "DisplayUI" function in the BPC_Dialogue is where we create the widget. You can replace this and have it either activate an existing 3d widget component or somehow spawn a new one.

          Comment


            How do we set the portrait? There is something wrong or not working correctly with this struct. In the datatable I can see the portrait field listed, but it doesn't show up down below to be edited. I see in the documents that this isn't supported in 4.9 but I'm using 4.23..have they never fixed this? If so, you should just edit that part out or change it to say "since 4.9 it's not supported'. To me it reads like it's only not supported in 4.9

            Click image for larger version  Name:	portrait.png Views:	0 Size:	33.3 KB ID:	1702755
            Last edited by crossmr; 12-29-2019, 09:41 PM.

            Comment


              Originally posted by crossmr View Post
              How do we set the portrait? There is something wrong or not working correctly with this struct. In the datatable I can see the portrait field listed, but it doesn't show up down below to be edited. I see in the documents that this isn't supported in 4.9 but I'm using 4.23..have they never fixed this? If so, you should just edit that part out or change it to say "since 4.9 it's not supported'. To me it reads like it's only not supported in 4.9
              Hi crossmr,

              Oh yep, looks like UE4 still doesn't support setting object references in data tables. To set portraits you still need to use CSVs (eg. excel sheet or google sheets exported to csv and imported as a datatable from UE4). I've Removed the 4.9 version mention from the documentation, thanks for letting me know

              EDIT: I should mention that you can also set the portrait from the "SetPortrait();" script function if you have the portrait in your asset table (which will require a csv).
              Last edited by Grogger; 12-30-2019, 08:17 PM.

              Comment


                Is there someway to get the dialog to pause so I can pop up a widget and enter a value? After a player makes a choice, I need it to pop up a widget and take a text input (or I'm going to use arrows to let them scroll, we'll see) but basically I need the dialog to pause while that's done. When they close it I want the dialog to continue.

                Comment


                  I'm finding the documentation/examples around conditions to be somewhat..unhelpful. The documentation just has vague explanations without much detail and the example doesn't seem to have any real conditions in it. Just one row has a condition of "FALSE" and that's it. Is there a working example that shows how to pull a variable from somewhere to check something as a condition? You gave an example earlier of something like this working:
                  Click image for larger version

Name:	variable.png
Views:	33
Size:	18.5 KB
ID:	1707432
                  But with no real context as to how to call it.

                  After a bunch of trial and error it seems like I should set an initial branch of some kind of "randbranch" selector that will go through all the greetings and then pick one based on conditions. But then I found out further issues. For example if I set that on the post action, it never runs. I have to set it on the pre-action of the item they choose (story/system). I set up a function to print all the keys from the variables to verify it and they won't run. I can't find anywhere to run it on "exit" at all, since my exit just closes out the dialog. Pre-action of exit, post action of greeting, nothing. there seems to be no way to clearly run it there.
                  Click image for larger version

Name:	variable2.png
Views:	27
Size:	28.5 KB
ID:	1707433
                  I basically have to do it like this, which is fine if you have a couple options, but if I have 10 options on the initial dialog, it needs to be set in 10 different entries.
                  Nothing else causes it to actually run and register. Why isn't post-action running on my hub?
                  Last edited by crossmr; 01-12-2020, 02:38 AM.

                  Comment



                    Originally posted by crossmr View Post
                    Is there someway to get the dialog to pause so I can pop up a widget and enter a value? After a player makes a choice, I need it to pop up a widget and take a text input (or I'm going to use arrows to let them scroll, we'll see) but basically I need the dialog to pause while that's done. When they close it I want the dialog to continue.
                    There is no built in way to store dialogue state and resume after some kind of event and there are many ways to go about this (partially why I didn't implement it). One simple way to go about it would be to separate the 'resumed' dialogue in another branch, and when the dialogue pausing, it can update the 'initial branch' to be the resuming branch. Of course you can code your own systems using custom dialogue script functions and script variables as well.


                    Originally posted by crossmr View Post
                    I'm finding the documentation/examples around conditions to be somewhat..unhelpful. The documentation just has vague explanations without much detail and the example doesn't seem to have any real conditions in it. Just one row has a condition of "FALSE" and that's it. Is there a working example that shows how to pull a variable from somewhere to check something as a condition? You gave an example earlier of something like this working:
                    Click image for larger version

Name:	variable.png
Views:	33
Size:	18.5 KB
ID:	1707432
                    But with no real context as to how to call it.

                    After a bunch of trial and error it seems like I should set an initial branch of some kind of "randbranch" selector that will go through all the greetings and then pick one based on conditions. But then I found out further issues. For example if I set that on the post action, it never runs. I have to set it on the pre-action of the item they choose (story/system). I set up a function to print all the keys from the variables to verify it and they won't run. I can't find anywhere to run it on "exit" at all, since my exit just closes out the dialog. Pre-action of exit, post action of greeting, nothing. there seems to be no way to clearly run it there.
                    Click image for larger version

Name:	variable2.png
Views:	27
Size:	28.5 KB
ID:	1707433
                    I basically have to do it like this, which is fine if you have a couple options, but if I have 10 options on the initial dialog, it needs to be set in 10 different entries.
                    Nothing else causes it to actually run and register. Why isn't post-action running on my hub?
                    The condition column is called automatically whenever a branch is considered for display. If the script in that column returns true (be it a binary comparison, a variable with a boolean in it, or a hard coded true/false), the branch is eligible to display. It sounds like you were using this correctly in the second part.

                    The post-action should always run once the branch line is complete and there shouldn't be an exception to this. That being said, we don't make much use of hubs in our game so it maybe an issue that I simply haven't encountered yet. We're in the middle of a heavy crunch period at the moment, so I won't be able to take a look at this just now.

                    I'm not sure if this works for what you're trying to achieve, but you can have a silent initial branch that sets the visit variable and then moves on to your hub branch. Silent non-hub branches can most definitely run pre and post actions.

                    Comment


                      Originally posted by Grogger View Post


                      There is no built in way to store dialogue state and resume after some kind of event and there are many ways to go about this (partially why I didn't implement it). One simple way to go about it would be to separate the 'resumed' dialogue in another branch, and when the dialogue pausing, it can update the 'initial branch' to be the resuming branch. Of course you can code your own systems using custom dialogue script functions and script variables as well.




                      The condition column is called automatically whenever a branch is considered for display. If the script in that column returns true (be it a binary comparison, a variable with a boolean in it, or a hard coded true/false), the branch is eligible to display. It sounds like you were using this correctly in the second part.

                      The post-action should always run once the branch line is complete and there shouldn't be an exception to this. That being said, we don't make much use of hubs in our game so it maybe an issue that I simply haven't encountered yet. We're in the middle of a heavy crunch period at the moment, so I won't be able to take a look at this just now.

                      I'm not sure if this works for what you're trying to achieve, but you can have a silent initial branch that sets the visit variable and then moves on to your hub branch. Silent non-hub branches can most definitely run pre and post actions.
                      I ended up attaching a small widget with a couple of scroll arrows that allows them to choose the amount. it displays under the portrait when they need to do it beside the text. At least for now that works fine.

                      As to the second issue, I'll try moving it to the silent branch and see what happens. It definitely didn't seem to be working correctly based on your earlier example or how I was reading the way that it should have worked.

                      Comment


                        I'm still seeing some inconsistency in behaviour.

                        You can see in the screenshot, two basically identical lines of dialog. The text is slightly different, but otherwise they're called and setup the same. StartExit works fine and makes the function call without issue. Exit is displayed as a choice in the dialog, but never runs the function call. They play a sound file so I know it's never being run (among other stuff). They're also both calling the same function so there is no chance there is an issue with the function itself. I also added a print statement in the dialog component and the print never runs.

                        As A test I changed the Created branch to "StartExit" and when selected by the player, the function runs, but of course that's the wrong line of dialog for that situation. I tried making a new row in case there was some weird hidden character or something in it, but that didn't help. wtf..

                        Edit: In a stroke of genius, I've determined that you can't use a branch name called "Exit", is this some kind of protected name? If so, this should be documented somewhere. If it is, then it needs to be in large bold flashing letters because I missed that.


                        Click image for larger version  Name:	dialog.png Views:	0 Size:	89.5 KB ID:	1710744
                        Last edited by crossmr; 01-19-2020, 09:51 PM.

                        Comment


                          Originally posted by crossmr View Post
                          ...
                          Edit: In a stroke of genius, I've determined that you can't use a branch name called "Exit", is this some kind of protected name? If so, this should be documented somewhere. If it is, then it needs to be in large bold flashing letters because I missed that.
                          Oh wow, I didn't know that! The branch I'm parsing for internally is "__exit__". It sounds like somewhere within the parsing the '_' characters are removed or ignored. I'll add this to the documentation, thanks for letting us know what was happening!

                          Comment


                            Originally posted by Grogger View Post

                            Oh wow, I didn't know that! The branch I'm parsing for internally is "__exit__". It sounds like somewhere within the parsing the '_' characters are removed or ignored. I'll add this to the documentation, thanks for letting us know what was happening!
                            Yes, this probably also explains the issue I was having in the other dialog that I was setting up as well as I had an Exit branch there for ending the conversation. I'll update all my dialog sets and check to see if the problems I was having are cleared up

                            Comment

                            Working...
                            X