Announcement

Collapse
No announcement yet.

Blueprint Dialogue System

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

  • replied
    I'm starting to get into the system and it looks promising. There is a small issue I've come across, however. In 4.11 the Datatables that reference assets have 'Object' Type in their structs(DT_DialogueAssets_Main and DT_DialogueSpeakerAttributes_Main). Is that intended? because it makes it impossible to actually choose and place an asset into the Data table row from the editor. What is the expected pipeline? Always *.csv and import?

    Leave a comment:


  • replied
    Originally posted by mfasman95 View Post
    Hello,

    First, I just wanted to say that this system is great and we have had a lot of success working with it. It has enabled some cool stuff, including using the BPC use scanner to allow us to create use actions on items in our level entirely unrelated to dialogue. Overall, this has been a great system to use.

    We are running into a bug though, and I am not sure what is causing it. Currently, we have a system set up that triggers dialogue when you enter a collision zone. So, for example, you put a box trigger into a level and use a dialogue object when you cross the trigger. However, once you end the dialogue the character continues walking in the direction they had been walking in, until you press and release the movement key again. My understanding is that for some reason, input is being halted from the mouse and keyboard, causing the game to not register the key up event triggering. Have you seen anything like this, or do you have any idea where input might be blocked during the use of dialogue?
    Hi mfasman95, thanks for the kind words

    I haven't encountered this myself (I have additional checks outside of the dialogue system), but I have encountered issues with the input mode since 4.11. The system sets the input mode "UI Only" when a dialogue is opened and closed if the component is set to Keyboard & Mouse, and "UI and Game" mode if set to gamepad. If you want to override this, you can set the components to not handle input modes or cursor at all (set it to "unmanaged").

    Without my code in fron of me, I believe I handle it by monitoring when a dialogue is opened and closed in the player controller (using the interface BPI_DialogueAware) and using SetIgnoreMoveInput (https://docs.unrealengine.com/latest...put/index.html) on opened, and ResetIgnoreInputFlags (https://docs.unrealengine.com/latest...ags/index.html) on close

    Leave a comment:


  • replied
    Hello,

    First, I just wanted to say that this system is great and we have had a lot of success working with it. It has enabled some cool stuff, including using the BPC use scanner to allow us to create use actions on items in our level entirely unrelated to dialogue. Overall, this has been a great system to use.

    We are running into a bug though, and I am not sure what is causing it. Currently, we have a system set up that triggers dialogue when you enter a collision zone. So, for example, you put a box trigger into a level and use a dialogue object when you cross the trigger. However, once you end the dialogue the character continues walking in the direction they had been walking in, until you press and release the movement key again. My understanding is that for some reason, input is being halted from the mouse and keyboard, causing the game to not register the key up event triggering. Have you seen anything like this, or do you have any idea where input might be blocked during the use of dialogue?

    Leave a comment:


  • replied
    Originally posted by Grogger View Post
    Hi there,

    If you aren't using data tables but you still want to use this system, you'll want to look at overriding the GetDialogueItem, GetDialogueRownNames, GetAsset, and GetSpeakerAttributes functions in your BPC_Dialogue child class. You'll need to convert your data into DialogueTableItem structures in those functions for the UI to know what to show/respond. If your system works by branching (even dynamically), I'd imagine it should convert fairly easily to the DialogueTableItem structure.

    Hope that helps!
    Cheers
    Aha ! That looks like what I was looking for ! I will dive into these BP's/functions one of the next days. The conversion should be pretty simple, as long as you use UE standard variables in the struct (as I suspect).

    Thanks for the info !

    Cheers,

    Geert

    Leave a comment:


  • replied
    Originally posted by gm0124816 View Post
    Hi Grogger,

    Bought and used it for some testing and is easy to learn and looks awesome. Nice work !

    However, I do not use data tables, but a real database (via TCP sockets) and an external program (in Java) to create dialogues. I never know upfront what the next "line of speech" will be (and who will say this line) as it is triggered by dozens of params and not even in UE. The only thing locally packed (in UE) will be the images as I suppose no other way around is available (correct me if I'm wrong).

    Do I have to do this via the scripting as well (and have a closer look at the above mentioned links you provided), or is a (BP) struct and events for this available (should be faster, no interpretation needed) ?

    Thanks for your insights !

    Cheers,

    Geert
    Hi there,

    If you aren't using data tables but you still want to use this system, you'll want to look at overriding the GetDialogueItem, GetDialogueRownNames, GetAsset, and GetSpeakerAttributes functions in your BPC_Dialogue child class. You'll need to convert your data into DialogueTableItem structures in those functions for the UI to know what to show/respond. If your system works by branching (even dynamically), I'd imagine it should convert fairly easily to the DialogueTableItem structure.

    Hope that helps!
    Cheers

    Leave a comment:


  • replied
    Originally posted by Grogger View Post
    Hi Ednoc, I'm glad you're enjoying the system so far!

    Yep, it was built with scripting in mind. There's a built in Blueprint-Only script interpreter that you might have noticed, and this is hooked into the dialogue system so you can achieve what you're asking.

    What will help you with your example is the Hub and Silent traits, Script Variables, and Conditions.

    For example:

    A has two dialogue options: 1) Hi, go talk to B; 2) Great, you've talked to B!

    We want (1) to run when the player hasn't spoken to B, so in the Condition column we will check to see if a variable is set: !isvalid(hasTalkedToB) || !hasTalkedToB
    If the conditions fail, the dialogue doesn't run, so in this case we only want the player to say "Hi, go talk to B" if the variable hasTalkedToB doesn't exist (isvalid returns false if it doesn't exist), or the variable is false.

    We want (2) to run when the player HAS spoken to B, so the Condition column would be isvalid(hasTalkedToB) && hasTalkedToB

    The next thing we need is a new dialogue row to act as the hub and selects the right dialogue to say. A dialogue entry with the Silent and Hub traits in the trait column (eg. Silent; Hub will automatically select the next valid branch from the Branch column (eg. branches TalkToB; HasTalkedToB to process. The first dialogue to pass the 'conditions' test will execute.

    The last part of the example is actually talking to B and setting the variable when the player talks to NPC B. The PostAction column is a good place to set new variables or call functions, and we would set hasTalkedToB=true in that column. Once set, the player would talk to NPC A again, this NPC's current branch would be the HUB branch we made, then the HUB would try to see if TalkToB branch is valid, the condition would fail

    The following sections in the documentation should help you out with advanced functionality:

    Conditions, Use Conditions, Functions, Custom Functions, Scripting



    I realize this is a long winded example, but I hope it helps!
    Hi Grogger,

    Bought and used it for some testing and is easy to learn and looks awesome. Nice work !

    However, I do not use data tables, but a real database (via TCP sockets) and an external program (in Java) to create dialogues. I never know upfront what the next "line of speech" will be (and who will say this line) as it is triggered by dozens of params and not even in UE. The only thing locally packed (in UE) will be the images as I suppose no other way around is available (correct me if I'm wrong).

    Do I have to do this via the scripting as well (and have a closer look at the above mentioned links you provided), or is a (BP) struct and events for this available (should be faster, no interpretation needed) ?

    Thanks for your insights !

    Cheers,

    Geert

    Leave a comment:


  • replied
    Hey all, I just wanted to note that the system has been tested with 4.12 and the current version is compatible for upgrading

    Leave a comment:


  • replied
    Originally posted by Ednoc View Post
    Hello Mr Grogger,

    I just purchased your dialog system and... It's awesome ! Even with few knowledges of mine, I'm able to do some simple tasks easily...

    But now, I want to do a lot more. Your first tuto on youtube was quite helpfull but insufficient. I know it's a lot of work, but you know, when you want to learn, you're always exigent... So ! I just see this topic and I wanted to ask you something...

    Did your dialog system programmed for more advanced taks like events ?

    For example : I have to talk to "A" guy who tell me to talk to "B". Once I talked to "B", and return to "A", "A" has new lines. is that already in the code or do I have to had some C++... Or is it simple to add it with some blueprint, maybe ?

    I apologize one milion time for all my mistakes.


    Thanks by advance, and for all your work. It's fantastic, keep going !
    Hi Ednoc, I'm glad you're enjoying the system so far!

    Yep, it was built with scripting in mind. There's a built in Blueprint-Only script interpreter that you might have noticed, and this is hooked into the dialogue system so you can achieve what you're asking.

    What will help you with your example is the Hub and Silent traits, Script Variables, and Conditions.

    For example:

    A has two dialogue options: 1) Hi, go talk to B; 2) Great, you've talked to B!

    We want (1) to run when the player hasn't spoken to B, so in the Condition column we will check to see if a variable is set: !isvalid(hasTalkedToB) || !hasTalkedToB
    If the conditions fail, the dialogue doesn't run, so in this case we only want the player to say "Hi, go talk to B" if the variable hasTalkedToB doesn't exist (isvalid returns false if it doesn't exist), or the variable is false.

    We want (2) to run when the player HAS spoken to B, so the Condition column would be isvalid(hasTalkedToB) && hasTalkedToB

    The next thing we need is a new dialogue row to act as the hub and selects the right dialogue to say. A dialogue entry with the Silent and Hub traits in the trait column (eg. Silent; Hub will automatically select the next valid branch from the Branch column (eg. branches TalkToB; HasTalkedToB to process. The first dialogue to pass the 'conditions' test will execute.

    The last part of the example is actually talking to B and setting the variable when the player talks to NPC B. The PostAction column is a good place to set new variables or call functions, and we would set hasTalkedToB=true in that column. Once set, the player would talk to NPC A again, this NPC's current branch would be the HUB branch we made, then the HUB would try to see if TalkToB branch is valid, the condition would fail

    The following sections in the documentation should help you out with advanced functionality:

    Conditions, Use Conditions, Functions, Custom Functions, Scripting



    I realize this is a long winded example, but I hope it helps!

    Leave a comment:


  • replied
    Hello Mr Grogger,

    I just purchased your dialog system and... It's awesome ! Even with few knowledges of mine, I'm able to do some simple tasks easily...

    But now, I want to do a lot more. Your first tuto on youtube was quite helpfull but insufficient. I know it's a lot of work, but you know, when you want to learn, you're always exigent... So ! I just see this topic and I wanted to ask you something...

    Did your dialog system programmed for more advanced taks like events ?

    For example : I have to talk to "A" guy who tell me to talk to "B". Once I talked to "B", and return to "A", "A" has new lines. is that already in the code or do I have to had some C++... Or is it simple to add it with some blueprint, maybe ?

    I apologize one milion time for all my mistakes.


    Thanks by advance, and for all your work. It's fantastic, keep going !

    Leave a comment:


  • replied
    Originally posted by Cinebeast View Post
    Sorry for not responding sooner. Yes, this helped! I've set up a system that works reliably well now.
    Great! Glad to hear it

    Leave a comment:


  • replied
    Originally posted by Grogger View Post
    Hope this helps
    Sorry for not responding sooner. Yes, this helped! I've set up a system that works reliably well now.

    Leave a comment:


  • replied
    Originally posted by Cinebeast View Post
    Hello again! Excuse me, I have a question.

    Let's say I put a dialogue component on an NPC and the player talks to that NPC, starting the dialogue. Is there a way to check for that in the NPC's blueprint? Suppose my NPC is walking around and I want him to stop and turn to the player when engaged in conversation -- how would I go about doing that?

    I could probably manage it through the dialogue's scripting using blueprint interfaces, but it would be simpler if I could do it from inside the NPC instead.

    For the tenth/hundredth time, thank you for this. Buying it was a lifesaving move for my project, and things have been going very smoothly.

    Hi Cinebeast, I'm glad to hear things are working smoothly!


    To answer your question, there are a few ways I can think of to do this.
    1. One way to do this is by checking if the ActiveUI variable on the BPC_Dialogue is valid. If it is valid, then that specific dialogue component is active.
    or
    2. For a global solution that can tell if any dialogue is opened, you can add the BPI_DialogueAware interface on your PlayerController.
    This interface adds two functions: DialogueOpened and DialogueClosed (These functions will automatically be called by the dialogue component, so there's no need to call yourself)
    When the dialogue is opened, the DialogueOpened event is called, and you can keep a reference however you want to keep track of it. DialogueClosed is, of course, called when the dialogue is finally exited.

    Hope this helps

    Leave a comment:


  • replied
    Hello again! Excuse me, I have a question.

    Let's say I put a dialogue component on an NPC and the player talks to that NPC, starting the dialogue. Is there a way to check for that in the NPC's blueprint? Suppose my NPC is walking around and I want him to stop and turn to the player when engaged in conversation -- how would I go about doing that?

    I could probably manage it through the dialogue's scripting using blueprint interfaces, but it would be simpler if I could do it from inside the NPC instead.

    For the tenth/hundredth time, thank you for this. Buying it was a lifesaving move for my project, and things have been going very smoothly.

    Leave a comment:


  • replied
    Originally posted by Grogger View Post
    Glad to hear it, because I only had guesses for that one; the setup seemed right to me.
    For the sake of anybody else that might have the same confusion as I did when trying to achieve this, here's what I did:
    • Instead of spawning the BP Script Interpreter Actor in the Game Mode's BeginPlay event, I created a custom event on the FirstPersonCharacter BP (which is triggered by the submit button being clicked on the widget - see video below if you want to see what I mean), which sets the "PlayerName" variable, then spawns the BP Script Interpreter Actor, and creates a variable referencing it:
      Click image for larger version

Name:	CharacterBP.PNG
Views:	1
Size:	152.8 KB
ID:	1104308
    • On the child of BPC Dialogue, override the GetScriptInterpreter function so it uses the new BP Script Interpreter reference variable
    • In BP_ScriptInterpreter, on the BeginPlay event (after it's spawned by the FirstPersonCharacter BP), set the variable created on the Variables array to be the value of the PlayerName variable:
      Click image for larger version

Name:	BP_ScriptInterpreter.PNG
Views:	1
Size:	75.2 KB
ID:	1104309


    Here's a very simple demonstration of what it looks like (not very pretty, but just testing features at the moment):
    https://youtu.be/H4Z2gbtcJxE

    Hope this helps!

    Cheers

    Fallen.

    Leave a comment:


  • replied
    Originally posted by FallenVagrant View Post
    EDIT: Don't worry about it; I worked it out myself
    Glad to hear it, because I only had guesses for that one; the setup seemed right to me.

    Leave a comment:

Working...
X