Announcement

Collapse
No announcement yet.

Blueprint Dialogue System

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

    Unfortunately, PostActions don't resolve my issue. If the player was moving before Use was called, they'll be moving again when the dialogue is over. I figured a PostAction might help, if I were to reset their movement during that PostAction. I've tried a frenzy of things, including even calling a Function in the PlayerCharacter after the Exit function in BPC_Dialogue to re-enable input after disabling it right before Use. No matter what I've tried, the player will continue to move. I've tried disabling and re-enabling input, consuming the movement vector, Set Ignore Move Input, Set Control Rotation, none of these have worked.

    Thankfully, after doing another search through this thread, I found this post:
    https://forums.unrealengine.com/unreal-engine/marketplace/40306-blueprint-dialogue-system?p=1000906#post1000906
    Due to the fact that it's been asked several times in this thread, is there any chance that you could add that to the FAQ?

    Feature request for future versions (if they happen? ): support for hex codes for colors would be nice.

    For vibrating text, is there a better way to apply this per character (for I guess "angry" text) rather than just copy-pasting it a bunch?

    And finally, to go back to the branching thing; so there's no way to have a generalized Yes/No response that would return to the parent branch with the results? I couldn't find one in the demo.

    Still love the system, but because it's so flexible it can be a bit overwhelming at points! Sorry to pester you with questions

    Edit: I might not be understanding branches accurately, actually. I had assumed that branches would automatically be run, so if you needed multiple lines of text it would go into its own branch. So, if I'm not understanding branches, and responses do return to the parent, just feel free to give me a smack upside the head and let me know.
    Last edited by ZServ; 03-06-2019, 04:57 AM.

    Comment


      Originally posted by ZServ View Post
      Unfortunately, PostActions don't resolve my issue. If the player was moving before Use was called, they'll be moving again when the dialogue is over. I figured a PostAction might help, if I were to reset their movement during that PostAction. I've tried a frenzy of things, including even calling a Function in the PlayerCharacter after the Exit function in BPC_Dialogue to re-enable input after disabling it right before Use. No matter what I've tried, the player will continue to move. I've tried disabling and re-enabling input, consuming the movement vector, Set Ignore Move Input, Set Control Rotation, none of these have worked.

      Thankfully, after doing another search through this thread, I found this post:
      https://forums.unrealengine.com/unreal-engine/marketplace/40306-blueprint-dialogue-system?p=1000906#post1000906
      Due to the fact that it's been asked several times in this thread, is there any chance that you could add that to the FAQ?

      Feature request for future versions (if they happen? ): support for hex codes for colors would be nice.

      For vibrating text, is there a better way to apply this per character (for I guess "angry" text) rather than just copy-pasting it a bunch?

      And finally, to go back to the branching thing; so there's no way to have a generalized Yes/No response that would return to the parent branch with the results? I couldn't find one in the demo.

      Still love the system, but because it's so flexible it can be a bit overwhelming at points! Sorry to pester you with questions

      Edit: I might not be understanding branches accurately, actually. I had assumed that branches would automatically be run, so if you needed multiple lines of text it would go into its own branch. So, if I'm not understanding branches, and responses do return to the parent, just feel free to give me a smack upside the head and let me know.

      Sorry no there isn't a more convenient way to add per-character vibration settings. It has been quite a few years since I've last visited that feature, but I imagine it could be edited or a new one added, if you're feeling adventurous. I don't have the code in front of me, but I believe text formatting is handled in the UI_Dialogue file.


      For the Generalized yes/no, you could have two generic branches who's branch flow is dynamic if you use the SetBranch(_next_branch_here_) function as a post action. You could set a temporary variable for the next branch somewhere in the dialogue you're coming from (eg. as a pre or post action, set a variable genericYesNo@nextBranch = "MyNextBranch").


      A branch by default is one 'page' of dialogue (click to continue to the next branch). When the branch is done (player clicks or immediately if Silent trait is present), it will choose from one of the branches in the "Branch" column. How it chooses depends on conditionals (is it a valid branch) and current branch traits (eg. RandBranch).
      To have multiple 'pages' per branch, you can use the New Page operator ( >> )

      Comment


        This project currently throws 53 warnings when compiling all blueprints in 4.22.3. A log file is attached.
        It appears to be default values that have changed and you are using deprecated functions:

        Set Text (String)
        Set Input Mode UI Only
        Set Input Mode Game And UI
        Get bSupportsKeyboardFocus
        Attached Files

        Comment


          Hey guys, hoping someone can be a bit more detailed on how to call post actions after a dialogue is finished. I've written a custom function, and attempted to add it to the handle script section, but apparently am missing a step somewhere and the documentation, even with the example, is super brief. Thanks!

          Comment


            Originally posted by silversand224 View Post
            Hey guys, hoping someone can be a bit more detailed on how to call post actions after a dialogue is finished. I've written a custom function, and attempted to add it to the handle script section, but apparently am missing a step somewhere and the documentation, even with the example, is super brief. Thanks!
            Hi silversand224,

            Calling the function in the PostAction column follows the same syntax as other places where script can be executed: functionName(argument1, argument2, argument3,...);

            So for example if you want a function to print out some text called PrintMyText, you would:
            1) override the HandleScriptFunction in your BPC_Dialogue component as in the example
            2) add a switch-case on the function name
            3) add a pin for PrintMyText to the switch-case
            4) Implement the behaviour for that pin (eg. PrintString on Argument[0] - we expect 1 argument for this function, the text to print)
            5) In your PostAction script use it by calling the function: PrintMyText("Hello World");

            Comment


              Hey Grogger!

              I´m having some trouble to use your BDS.
              I´ve tried hard to use it, but no glue where's the fix.
              Like I mentioned on th review, I tried following the documentation and video. But on my 3D sidescroller project, I'm getting some errors.


              Firstly, the "Press E to interact" wasn't showing. I fixed it turning the pure cast to impure on the BPC Dialogue component.

              After that, I got some errors due to the collision. Fixed that adding a box collision for this purpose, and worked well.

              Now, the dialog starts, but without any text. I tried to look at your documentation, but can't figure out how to solve. I know that's something with Script Interpreter, it's spawning in the game mode (like your video teached). The only difference is that on your video, the SpawActor node have a bool to spawn even ifthe actor collides with something. In 4.22, besides, there's a combo box, where I'm choosing the option to spawn the object and ignore the collision (always spawn).

              Any tips on how can I proceed? Also, why I get errors when my BPC Dialogue component have a pure cast?
              Last edited by yoraanny; 09-10-2019, 05:16 PM.

              Comment


                Hey Grogger, I've got the system working pretty well for the mobile visual novel my team is working on. I can keep track of choices made by utilizing PostAction calls.

                However, Is there a way, using the current system, to change the "branches" based on a past choice?
                (as a random example, if I chose to open the door, the next dialogue is, "Thank you." But if not, the next dialogue would be, "How rude.")

                Originally posted by Grogger View Post
                The system has several generalized mechanisms for this. First there's the branch conditions column that will help select which branch should be used at this time (based on your own custom script variables - eg. goblinKing@hasStartedQuest == true || GetPlayerLevel() > 5), and then there's the UseConditions which help inform the system whether an actor should be interactive at this time.
                So would this need to be put in the condition section for the dialogue table row? How do I make a function that returns a boolean value?

                For instance if I put Chose("ChoiceName",2); in the conditions, how would I make the Chose function?

                Edit: It worked! I just used Handle Script Function to make the function and returned the boolean as a string. It now only chooses a branch if the condition is met!
                Last edited by Mewbits; 09-10-2019, 09:51 PM.

                Comment


                  Originally posted by Mewbits View Post
                  Edit: It worked! ...
                  Nice! Glad to hear it worked out


                  Originally posted by yoraanny View Post
                  Hey Grogger!

                  I´m having some trouble to use your BDS.
                  I´ve tried hard to use it, but no glue where's the fix.
                  Like I mentioned on th review, I tried following the documentation and video. But on my 3D sidescroller project, I'm getting some errors.


                  Firstly, the "Press E to interact" wasn't showing. I fixed it turning the pure cast to impure on the BPC Dialogue component.

                  After that, I got some errors due to the collision. Fixed that adding a box collision for this purpose, and worked well.

                  Now, the dialog starts, but without any text. I tried to look at your documentation, but can't figure out how to solve. I know that's something with Script Interpreter, it's spawning in the game mode (like your video teached). The only difference is that on your video, the SpawActor node have a bool to spawn even ifthe actor collides with something. In 4.22, besides, there's a combo box, where I'm choosing the option to spawn the object and ignore the collision (always spawn).

                  Any tips on how can I proceed? Also, why I get errors when my BPC Dialogue component have a pure cast?
                  Hey there!

                  For the script interpreter error, is the error "Accessed None ‘ScriptInterpreter’" or something along those lines? If it is, then that means the UI can't find the ScriptInterpreter you've spawned.
                  In your BPC_Dialogue, be sure to override the GetScriptInterpreter function to return the one you've spawned in the game state.

                  If it still doesn't work we'll need more info (you could use a breakpoint on that function using F9 to see if it is properly being called and to see if the script interpreter is valid when it is called)

                  For the Pure Cast you're talking about, I'm not aware of this issue. What is the error you're getting and in which file?

                  Comment


                    Originally posted by Grogger View Post

                    Hey there!

                    For the script interpreter error, is the error "Accessed None ‘ScriptInterpreter’" or something along those lines? If it is, then that means the UI can't find the ScriptInterpreter you've spawned.
                    In your BPC_Dialogue, be sure to override the GetScriptInterpreter function to return the one you've spawned in the game state.

                    If it still doesn't work we'll need more info (you could use a breakpoint on that function using F9 to see if it is properly being called and to see if the script interpreter is valid when it is called)

                    For the Pure Cast you're talking about, I'm not aware of this issue. What is the error you're getting and in which file?


                    Yep! The error is "Accessed None ‘ScriptInterpreter’" (see print 1).

                    In my BPC-DialogueChild (I made a child from yours), it's like you teached on the video: I've overrided the GetScriptInterpreter function, using the Script Interpreter variable (print 2) that I've made on the game mode.

                    But on my project, the system only works when the cast node is inpure. When it's a pure cast, i get some "Acess none trying ro read property K2Node_DynamicCast..." errors (print 3).

                    Also, I've put my character and game mode BPs here. Fun fact: in a new 3D sidescroller project, everything works fine.

                    For HQ images, here's a download link: https://we.tl/t-eM5jBxVTLX



                    COOL EDIT!

                    Hey, Grogger, big update!
                    I've made it, now it's working.
                    When I spawn the Script Interpreter from my character blueprint, it works fine!
                    For some reason, spawning from game mode isn't working, and this is weird, since I haven't did anything there.

                    Question: it's safe to spawn the script interpreter from my character BP?
                    Last edited by yoraanny; 09-11-2019, 12:50 PM.

                    Comment


                      Originally posted by yoraanny View Post
                      ...
                      I've made it, now it's working.
                      ...
                      Question: it's safe to spawn the script interpreter from my character BP?
                      Nice! Super glad it's working!

                      You can put it on the character, but only if you don't store variables there or if your player class is never destroyed (eg. when the player dies or something). You'll want the script interpreter to live on for the entirety of the game so that your script variables aren't lost when you're player dies. The game instance is good if you want it to live on beyond level transitions, and otherwise the game state or game mode are good.

                      Are you sure your game mode is the one being spawned? Under Maps & Modes in the project settings, it should say your game mode class in there. If you haven't yet, look into blueprint breakpoints and debugging blueprints scripts to find out what's going on there.

                      Comment


                        Hello there
                        The conditions field doesn't work in UE4.23. I set IntroBot@VisitCount = 1; as a PostAction in the first dialogue, in the second dialogue i check the condition IntroBot@VisitCount == 1.
                        The second dialogue "WinGame" is not entered, not even on consecutive interactions. Fixing this is urgent since it basically makes the dialogue system unusable.

                        Best regards, Albin
                        Attached Files
                        Last edited by Manspear; 09-23-2019, 09:51 AM.

                        Comment


                          Originally posted by Manspear View Post
                          Hello there
                          The conditions field doesn't work in UE4.23. I set IntroBot@VisitCount = 1; as a PostAction in the first dialogue, in the second dialogue i check the condition IntroBot@VisitCount == 1.
                          The second dialogue "WinGame" is not entered, not even on consecutive interactions. Fixing this is urgent since it basically makes the dialogue system unusable.

                          Best regards, Albin
                          Hi Albin,

                          Try placing it in the PreAction column. The post action may be too late to process variables for the next branch selection (it's been too long since I've coded this to remember and I'm not at home at the moment to verify).

                          Comment


                            The main thing I'm stuck with is how to access a bool from outside of the dialogue stuff. Here's my situation. - I talk to a speaker, and after directing me somewhere he becomes unusuable i.e I can no longer talk to them (I do this with the SetActive(bEnabled==False)). Once I have done what he asked I want to set him to usable again in order to continue dialogue.

                            How do I set him to enabled again from a separate blueprint?

                            Comment


                              Originally posted by the_tubby1 View Post
                              The main thing I'm stuck with is how to access a bool from outside of the dialogue stuff. Here's my situation. - I talk to a speaker, and after directing me somewhere he becomes unusuable i.e I can no longer talk to them (I do this with the SetActive(bEnabled==False)). Once I have done what he asked I want to set him to usable again in order to continue dialogue.

                              How do I set him to enabled again from a separate blueprint?
                              You'd need to find your character's BPC_Dialogue component in Blueprints and set its "IsActiveDialogueTopic" to true. You can also use the ScriptInterpreter's "ExecuteScript" blueprint function and pass in the BPC_Dialogue component as the handler to handle the event with for more complex script handling.

                              Comment


                                Originally posted by Grogger View Post
                                Try placing it in the PreAction column. The post action may be too late to process variables for the next branch selection.
                                That worked. It also worked in the postaction when I spoke to the NPC a second time. Yesterday nothing worked though... Did I maybe forget to save the datatable between playtests then?
                                Just happy that it works honestly, your dialogue system seems pretty robust and scaleable so I'm happy to use it now

                                Best regards, Albin




                                Comment

                                Working...
                                X