Announcement

Collapse
No announcement yet.

Blueprint Dialogue System

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

  • replied
    Originally posted by XilenceX View Post
    I'm currently writing a guide for the writers on my project. So they write in a style, that I can parse into a DataTable for this plugin via Python.

    A simple example would be:
    "{Start}
    Player(Neutral): Hey
    NPCName(Anger_B): What do you want?"
    This is a simple example, it could also be 10 lines of dialogue going back and forth between the player and the NPC.

    {Start} is the branch name.
    The text following that is the dialogue associated with that branch name.

    Is it somehow possible to switch from one speaker to the next within the same branch? That would be perfect!

    If that's not possible, the best solution would be to make the Python script create a new branch for each speaker's line, right?
    So something like:
    "{Start_1}
    Player(Neutral): Hey
    {Start_2}
    NPCName(Anger_B): What do you want?"

    Technically that's no problem, I'm just worried that the generated DataTable would become very cluttered and may even cause performance problems to read in-game.
    This way, for some NPCs the DataTable could have hundreds, or even thousands of lines in our RPG project...

    Hey there! That's a neat idea, I like it. A branch in this system is essentially 1 page/prompt of dialogue, so we couldn't split up one branch into multiple users in this case (the page break operator >> breaks 1 branch into multiple pages but it doesn't have an opportunity to change users).

    For designer convenience sake, you can maybe generate 'sub-branches' for each new speaker. So for example:

    {Start}
    Player(Neutral): Hey <-- Script generates Branch "Start__1"
    NPCName(Anger_B): What do you want? <-- Script generates Branch "Start__2"

    I wouldn't expect this to be a performance issue at any rate, tables use a map internally iirc, so a binary search is not going to have a problem with searching a million entries once in a while.

    Leave a comment:


  • replied
    I'm currently writing a guide for the writers on my project. So they write in a style, that I can parse into a DataTable for this plugin via Python.

    A simple example would be:
    "{Start}
    Player(Neutral): Hey
    NPCName(Anger_B): What do you want?"
    This is a simple example, it could also be 10 lines of dialogue going back and forth between the player and the NPC.

    {Start} is the branch name.
    The text following that is the dialogue associated with that branch name.

    Is it somehow possible to switch from one speaker to the next within the same branch? That would be perfect!

    If that's not possible, the best solution would be to make the Python script create a new branch for each speaker's line, right?
    So something like:
    "{Start_1}
    Player(Neutral): Hey
    {Start_2}
    NPCName(Anger_B): What do you want?"

    Technically that's no problem, I'm just worried that the generated DataTable would become very cluttered and may even cause performance problems to read in-game.
    This way, for some NPCs the DataTable could have hundreds, or even thousands of lines in our RPG project...

    Leave a comment:


  • replied
    Originally posted by Grogger View Post

    If your cylinder has a BPC_Dialogue component, you should be get the component from the actor and call it's use function directly.
    Ah thank you so much

    Leave a comment:


  • replied
    Originally posted by Trauts123 View Post

    Thanks for the reply! I don't think I am setting it up right for the on BeginPlay? Can you tell what I am doing wrong sorry? (The BPC Dialogue is just placed on a random cylinder and it does work if I manually activate it with the character) Thank you! Click image for larger version

Name:	BeginPlay.png
Views:	62
Size:	75.9 KB
ID:	1822061
    If your cylinder has a BPC_Dialogue component, you should be get the component from the actor and call it's use function directly.

    Leave a comment:


  • replied
    Originally posted by Grogger View Post

    Hey there, glad you're enjoying it

    To trigger manually, you can either call the "Use" or the "SetState" function on the BPC_DialogueComponent. So on Level start (maybe BeginPlay in your level blueprint), you can use the reference of the actor hosting the dialogue component in your project, and get the component to call one of those functions.
    Thanks for the reply! I don't think I am setting it up right for the on BeginPlay? Can you tell what I am doing wrong sorry? (The BPC Dialogue is just placed on a random cylinder and it does work if I manually activate it with the character) Thank you! Click image for larger version

Name:	BeginPlay.png
Views:	62
Size:	75.9 KB
ID:	1822061

    Leave a comment:


  • replied
    Originally posted by Trauts123 View Post
    Hello Grogger the Dialogue System is amazing thank you! Just wanted to ask though which blueprints in the system should I look at if say I wanted to change how the dialogue triggers for example if I wanted it to trigger when the level starts or when player walks to a certain point?

    Thank you so much

    *EDIT* Okay got it all working for just stepping onto a trigger so just what about with a level start?
    Hey there, glad you're enjoying it

    To trigger manually, you can either call the "Use" or the "SetState" function on the BPC_DialogueComponent. So on Level start (maybe BeginPlay in your level blueprint), you can use the reference of the actor hosting the dialogue component in your project, and get the component to call one of those functions.

    Leave a comment:


  • replied
    Hello Grogger the Dialogue System is amazing thank you! Just wanted to ask though which blueprints in the system should I look at if say I wanted to change how the dialogue triggers for example if I wanted it to trigger when the level starts or when player walks to a certain point?

    Thank you so much

    *EDIT* Okay got it all working for just stepping onto a trigger so just what about with a level start?
    Last edited by Trauts123; 10-12-2020, 03:15 AM.

    Leave a comment:


  • replied
    Ah so i did actually have this set up correctly! I think it wasn't working cause my GetScriptInterpreter's target was getting set to BPIDialogueDatatableHost instead of my BPC_Dialogue component, so i just manually hooked that up to target and it started working. Thanks!

    Leave a comment:


  • replied
    Originally posted by Shakunga View Post
    Hey Grogger I'm in love with the custom script functions and am finding them to be super useful in contexts other than just when dialogue is playing. Like doing camera moves/animations/sounds etc. when I activate a simple button through the Usable system. But I'm having a hard time figuring out how exactly to get the HandleScriptFunction to execute in just a normal child blueprint of BPC_UseActionHandler. I'm assuming it's pretty simple, right? I just don't know which function to call and how to hook it up properly. Is it one of these two?
    Glad to hear it!

    Aye the ExecuteScript node is what is used internally to run commands in the dialogue. This should find its way to the HandleScriptFunction if there is valid function syntax found in the ScriptString. The custom handler is going to be your BPC_Dialogue that implements the HandleScriptFunction.

    Leave a comment:


  • replied
    Hey Grogger I'm in love with the custom script functions and am finding them to be super useful in contexts other than just when dialogue is playing. Like doing camera moves/animations/sounds etc. when I activate a simple button through the Usable system. But I'm having a hard time figuring out how exactly to get the HandleScriptFunction to execute in just a normal child blueprint of BPC_UseActionHandler. I'm assuming it's pretty simple, right? I just don't know which function to call and how to hook it up properly. Is it one of these two?

    Attached Files

    Leave a comment:


  • replied
    Sorry for bothering you Grogger , I was wondering if you knew how one would go on about playing an audioclip everytime a character or word is 'written' on the screen, similar to something like Animal Crossing does (for example everytime a character is written on screen, a 'typewriter' short clip plays), I guess I would have to reference the Typewriter speed and all, but not sure how I'd start on something like this.

    Thank you.

    Leave a comment:


  • replied
    Originally posted by dmac921 View Post
    Where exactly is the code that places "Press E To Interact" on the screen? I have spent hours looking. I have to remove this text completely and I can't find it. It isn't in a UMG widget as it should have been.

    HAHAHAHAH OMG I stuck that in there during the tutorial. I could,'t find it because I put it on MY blueprint ROTFLMAO.
    Haha, it happens to the best of us.
    "Find in Blueprints" should be helpful in the future, it should be able to search for things like print strings.

    Leave a comment:


  • replied
    Where exactly is the code that places "Press E To Interact" on the screen? I have spent hours looking. I have to remove this text completely and I can't find it. It isn't in a UMG widget as it should have been.

    HAHAHAHAH OMG I stuck that in there during the tutorial. I could,'t find it because I put it on MY blueprint ROTFLMAO.
    Last edited by dmac921; 06-26-2020, 04:05 PM.

    Leave a comment:


  • replied
    Originally posted by Grogger View Post

    So the UI_Dialogue is respawned for every new state, but the BPC_Dialogue is aware if one is already opened when "SetState" is called.
    So in your child class for BPC_Dialogue, override the SetState function. If the variable ActiveUI is not valid, then this is the first time the dialogue opens, otherwise it's continuing the conversation.
    I use this for fading in the start of conversations, and fade out on end of conversations (if the branch name is __exit__, I'll fade out before finalizing the exit on SetState in the BPC).

    Hey Grogger, I'm having the same issue. I sort of understand the explanation you're giving for the solution, but I'm not exactly sure what to change in the blueprints exactly to fix this. Can you maybe explain it a little more detailed? Here's what I have set up based on your explanation so far. But I don't know what to set up once the UI has been created already (aka after the first line)

    Click image for larger version

Name:	BP set state.JPG
Views:	110
Size:	435.5 KB
ID:	1770837‚Äč

    Leave a comment:


  • replied
    Originally posted by Grogger View Post

    Hey there,

    IIRC, this is because the default implementation has a TextItem that grows as the characters are displayed, and the wrap box brings it all to the next line when it grows. You can alter your text item class to instead hold a hidden (not collapsed) label so that the widget will have its full size and the wrap box will know ahead of time where it should go.
    Thank you! That solved it for us.

    Since that went so well, we were wondering if you could help us solve another problem.

    We'de like to have the justification and alignment of the text be centered so that it can appear in the center of the vertical box widget. This is helpful as were trying to put it in a comic book style text bubble where the text is often oriented in the middle. We've tried updating the justifications and alignment of the TextItem and TextContainer but it still prints from the left edge. Any thoughts on how we could solve this?

    Leave a comment:

Working...
X