Announcement

Collapse
No announcement yet.

Blueprint Dialogue System

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

  • replied

    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.

    Leave a comment:


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

    Leave a comment:


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

    Leave a comment:


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

Working...
X