Announcement

Collapse
No announcement yet.

Blueprint Dialogue System

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

  • started a topic [RELEASED] Blueprint Dialogue System

    Blueprint Dialogue System

    Hello Unreal community!

    Now on the marketplace: https://www.unrealengine.com/marketp...ialogue-system
    Marketplace version (for UE4 4.9-4.19): v1.4 (Changelog - [2016/11/19])
    Previous Updates:



    Documentation
    Video Tutorials


    Groggeroo's Blueprint Dialogue System

    Built using Blueprint/UMG and actor components, this dialogue system enables developers to quickly create dialogue content, empowered by a data-driven design with a myriad of inline text formatting/scripting tools and configurable interface options.

    Branching and non-branching styles of dialogue are supported; which to use is determined at run-time, according to the response options provided by the developer.

    With a data-driven design, content creators are free to choose to work in a spreadsheet editor, or directly in UE4's datatable row editor.

    The system can be used for basic text-only dialogue or for more complex conversations with non-linear dialogue; text formatting; inline images; variable text; audio playback; scripted event triggers; and custom interface layouts.
    Click image for larger version  Name:	DSMarketing_Overview.png Views:	1 Size:	97.9 KB ID:	1149463
    Click image for larger version  Name:	DSMarketing_Screenshots1.png Views:	1 Size:	306.6 KB ID:	1149464
    Click image for larger version  Name:	DSMarketing_Screenshots.png Views:	1 Size:	76.2 KB ID:	1152067




    CSV Editors
    My personal choice for editing the dialogue is with a free editor called CSVed.
    It takes a bit of getting used to, since it's different than standard spreadsheets, but I've found it to be well worth it when dealing with large columns and large tables.
    Attached Files
    Last edited by Grogger; 06-16-2018, 10:22 PM.

  • replied
    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.

    Leave a comment:


  • replied
    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




    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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?

    Leave a comment:


  • replied
    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).

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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?

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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");

    Leave a comment:


  • replied
    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!

    Leave a comment:


  • replied
    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

    Leave a comment:

Working...
X