Announcement

Collapse
No announcement yet.

Blueprint Dialogue System

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

    Originally posted by Grogger View Post
    3D Widgets should be perfectly possible with the current system, there are a few functions that would need to be overridden in the BPC_Dialogue component. I haven't attempted it myself yet, though I did build it with this possibility in mind (especially with the 'passive' dialogue I intend to use as chat-bubbles in my own game).
    Any chance you can add that to existing system in the next update? I'd rather use out of the box system and not try messing with the script myself (plus I am not a BP/UMG guru )

    Originally posted by Grogger View Post
    As for existing project integration, the dialogue system is non-intrusive for the most part. A dialogue 'ScriptInterpreter' actor needs to be spawned and maintained (variables copied across levels if desired), the dialogue components need to be placed on the actors who will have dialogue, and the Use system should be integrated or replaced with your own 'use/interact' system.
    That's pretty cool. I'd probably have to figure out how to adjust your Use/Interact system for my VR project. However, would I be able to use Use/Interact system you provide for non-VR project as-is ?
    Last edited by motorsep; 09-22-2016, 03:40 PM.

    Comment


      Originally posted by motorsep View Post
      Any chance you can add that to existing system in the next update? I'd rather use out of the box system and not try messing with the script myself (plus I am not a BP/UMG guru )
      It very well could be in the next update, but I don't have a timeline for when that might be at this point.

      Originally posted by motorsep View Post
      That's pretty cool. I don't have use/interact system yet (building the world and basic functionality for now). Would I be able to use what this system provides ?
      Sure! The Dialogue system has a character based interact system and a mouse interact system, take your pick or use 'em both

      Comment


        Originally posted by Grogger View Post
        The only thing that needs to be restored/preserved is the 'Variables' array in the ScriptInterpreter. You can choose to copy these somehow before unloading the current level and re-copying them to the new script interpreter when the level loads, OR you can store the script interpreter on the GameInstance to begin with (your BPC_Dialogue child classes will need to be updated to instead get the script interpreter from there)
        I really like the sound of that second suggestion, but I'm having difficulty with it. I updated my child classes, but now no dialogue will appear in-game. I get an error saying that UI_Dialogue is Accessing None whenever it tries to use the Script Interpreter. I figure this means I need to tell the UI to get the interpreter from my game instance instead, but I'm not sure how. I can't find where and when the UI is getting that information.

        I'll keep looking, I'm sure I'm missing it, but here's hoping you'll point it out to me. Thanks again!
        I'm an artist! Check out my work at https://cinebst.wixsite.com/cinebeastart and hit me up!

        You can e-mail me at cinebst@gmail.com.

        Comment


          Originally posted by Cinebeast View Post
          I really like the sound of that second suggestion, but I'm having difficulty with it. I updated my child classes, but now no dialogue will appear in-game. I get an error saying that UI_Dialogue is Accessing None whenever it tries to use the Script Interpreter. I figure this means I need to tell the UI to get the interpreter from my game instance instead, but I'm not sure how. I can't find where and when the UI is getting that information.

          I'll keep looking, I'm sure I'm missing it, but here's hoping you'll point it out to me. Thanks again!
          The BPC_Dialogue function "GetScriptInterpreter" should be overridden to get the script interpreter from wherever you're storing it.
          Note though that when you cross a level, the script interpreter actor will be destroyed and you'll need to restore the variables still, I forgot about that part in my previous post.

          Comment


            Originally posted by Grogger View Post
            The BPC_Dialogue function "GetScriptInterpreter" should be overridden to get the script interpreter from wherever you're storing it.
            Hmm... same error, I'm afraid. UI_Dialogue is still giving me Accessed None messages.
            I'm an artist! Check out my work at https://cinebst.wixsite.com/cinebeastart and hit me up!

            You can e-mail me at cinebst@gmail.com.

            Comment


              Originally posted by Cinebeast View Post
              Hmm... same error, I'm afraid. UI_Dialogue is still giving me Accessed None messages.
              Sorry for the delay, I didn't get a notification about your response.

              There are very few things that can be happening here (afaik). UI_Dialogue asks the BPC_Dialogue that spawns it where the script interpreter is using that getter, and the getter function could then simply return the spawned actor you're storing.

              Is it using the right BPC_Dialogue component, and has the script interpreter actor been spawned yet?

              Comment


                Originally posted by Grogger View Post
                Is it using the right BPC_Dialogue component, and has the script interpreter actor been spawned yet?
                How do I check for that? I can't find a reference to any dialogue components in the UI.
                I'm an artist! Check out my work at https://cinebst.wixsite.com/cinebeastart and hit me up!

                You can e-mail me at cinebst@gmail.com.

                Comment


                  Originally posted by Cinebeast View Post
                  How do I check for that? I can't find a reference to any dialogue components in the UI.
                  * In BPC_Dialogue DisplayUI function, you can put a breakpoint in there to see if the "Debug Filter" reports the right dialogue component
                  * In your GetScriptInterpreter function, you can put a breakpoint to see if it's returning a valid actor

                  Comment


                    Originally posted by Grogger View Post
                    * In your GetScriptInterpreter function, you can put a breakpoint to see if it's returning a valid actor
                    Okay, I think that's it. I added a print string in there and, while the Game Mode version of the Script Interpreter is printed, the Game Instance version is not.

                    As far as I can tell, though, they're identical.
                    I'm an artist! Check out my work at https://cinebst.wixsite.com/cinebeastart and hit me up!

                    You can e-mail me at cinebst@gmail.com.

                    Comment


                      Originally posted by Cinebeast View Post
                      Okay, I think that's it. I added a print string in there and, while the Game Mode version of the Script Interpreter is printed, the Game Instance version is not.

                      As far as I can tell, though, they're identical.
                      Hmm, it might be best to keep the game mode as the script host and copying it's "variables" array over on level load. You'll have to respawn the actor no matter which way you go, so at least then you'd already have it spawning properly?

                      Comment


                        Originally posted by Grogger View Post
                        Hmm, it might be best to keep the game mode as the script host and copying it's "variables" array over on level load. You'll have to respawn the actor no matter which way you go, so at least then you'd already have it spawning properly?
                        Okay, how would I do that?
                        I'm an artist! Check out my work at https://cinebst.wixsite.com/cinebeastart and hit me up!

                        You can e-mail me at cinebst@gmail.com.

                        Comment


                          Originally posted by Cinebeast View Post
                          Okay, how would I do that?
                          Before changing the level, copy the array called "Variables" from the GameMode's script interpreter to a variable in GameInstance. Game instance will keep it alive when you move to the next level.
                          Once you're done loading the level, your game mode should spawn another script interpreter. When it does that, copy the variables back from GameInstance to the ScriptInterpreter's "Variables" array.

                          Comment


                            Originally posted by Grogger View Post
                            Before changing the level, copy the array called "Variables" from the GameMode's script interpreter to a variable in GameInstance. Game instance will keep it alive when you move to the next level.
                            Once you're done loading the level, your game mode should spawn another script interpreter. When it does that, copy the variables back from GameInstance to the ScriptInterpreter's "Variables" array.
                            When you say "copy" I'm sorry to say I don't, uh, copy you.

                            Do you mean that I should make another array of variables in the Game Instance, one that is identical to the array in the Game Mode? I would need to manually update the former every time I add something to the latter, wouldn't I?

                            Sorry for being slow.
                            I'm an artist! Check out my work at https://cinebst.wixsite.com/cinebeastart and hit me up!

                            You can e-mail me at cinebst@gmail.com.

                            Comment


                              Originally posted by Cinebeast View Post
                              When you say "copy" I'm sorry to say I don't, uh, copy you.

                              Do you mean that I should make another array of variables in the Game Instance, one that is identical to the array in the Game Mode? I would need to manually update the former every time I add something to the latter, wouldn't I?

                              Sorry for being slow.
                              Oh my golly gosh no! Hahaha!

                              The variables array in the ScriptInterpreter is programmatically populated when you write things like "MyVariable = 1+2" in script (it creates a variable called MyVariable with a value of 3 in the 'global' namespace), so you should never be changing these values manually.

                              When the level is about to be changed, make a copy of that array in GameInstance (use the Set function on the array variable that you'll be creating). When the level is done changing, a new game mode will be created and it should spawn a scriptinterpreter. At that point, copy that array into the script's "variables" variable.

                              Hope that clears it up a bit haha.

                              Comment


                                Originally posted by Grogger View Post
                                When the level is about to be changed, make a copy of that array in GameInstance (use the Set function on the array variable that you'll be creating). When the level is done changing, a new game mode will be created and it should spawn a scriptinterpreter. At that point, copy that array into the script's "variables" variable.

                                Hope that clears it up a bit haha.
                                A bit. Let's see if I'm following you correctly.

                                When I go to open another level, I call an event on the Game Mode like this:

                                Click image for larger version

Name:	ue4_copy_mode_variables.png
Views:	1
Size:	76.3 KB
ID:	1116003

                                Which calls an event in the Game Instance, an event that sets an empty variable array to store the Script Interpreter information. How do I copy that information back into the Game Mode when the new level has loaded? The Game Mode won't be able to discriminate between when to get that information and when not to, since it's created anew with every level, right? So, I guess I'm still a little stuck.
                                I'm an artist! Check out my work at https://cinebst.wixsite.com/cinebeastart and hit me up!

                                You can e-mail me at cinebst@gmail.com.

                                Comment

                                Working...
                                X