Announcement

Collapse
No announcement yet.

Dialogue Plugin

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

  • replied
    Originally posted by iSpam View Post
    Seems a lot simpler than I had expected. Should be I just need to add an FText variable in the FDialogueNode struct, then in BP in the reply widget is where I get the break DialogueNode that has the variables, which I assume is really all I need?

    I was looking in your source and found the TextCommitted() in DialogueNodeWidget.cpp as well as the OnNodeTextCommitted() in DialogueViewportWidget.cpp. 99% I don't need to touch the dialogueviewportwidget code as I assume that strictly for the text on the node, and about 90% certain I don't need to touch the dialoguenodewidget.

    Problem is adding a variable FText isn't showing up in the widgets or bp. Checked the break node and it's not there either. Simply copy/pasted the Text variable and changed the name.

    Also, would it be possible for you guys to add blueprint style comments to your dialogue viewport? Just makes things easy to organize and shows relevant details at a glance, but I can just as easily use unconnected nodes.
    In Dialogue.h on above line 62, add:
    Code:
        UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue Node")
        FText AlternativeText;
    In DialoguePluginEditorSettingsDetails.h, below line 15, add:
    Code:
        void TextAlternativeCommited(const FText& InText, ETextCommit::Type InCommitType, UDialogue* Dialogue, int32 id);
    In DialoguePluginEditorSettingsDetails.cpp, below line 68, add:
    Code:
            CurrentNodeCategory.AddCustomRow(LOCTEXT("AltTextLabel", "AltTextLabel"))
            .WholeRowContent()
            [
                SNew(STextBlock).Font(IDetailLayoutBuilder::GetDetailFont())
                .Text(LOCTEXT("AlternativeText", "Alternative Text"))
            ];
    
            CurrentNodeCategory.AddCustomRow(LOCTEXT("AltTextValue", "AltTextValue"))
            .WholeRowContent()
            [
                SNew(SBox)
                .HeightOverride(100)
                [
                    SNew(SMultiLineEditableTextBox).Text(CurrentNode.AlternativeText)
                    .AutoWrapText(true)
                    .OnTextCommitted(this, &FDialoguePluginEditorSettingsDetails::TextAlternativeCommited, Dialogue, Dialogue->CurrentNodeId)
                    .ModiferKeyForNewLine(EModifierKey::Shift)
                ]
            ];
    Then in the same file, at the end of the file (but above the #undef macro), add:
    Code:
    void FDialoguePluginEditorSettingsDetails::TextAlternativeCommited(const FText& NewText, ETextCommit::Type CommitInfo, UDialogue* Dialogue, int32 id)
    {
        int32 index;
        FDialogueNode CurrentNode = Dialogue->GetNodeById(id, index);
    
        // we don't commit text if it hasn't changed
        if (Dialogue->Data[index].AlternativeText.EqualTo(NewText))
        {
            return;
        }
    
        const FScopedTransaction Transaction(LOCTEXT("AltTextCommited", "Edited Node Alternative Text"));
        Dialogue->Modify();
    
        Dialogue->Data[index].AlternativeText = NewText;
    }
    Now compile, open the project and check if an additional text window has appeared like this:


    If it has, check that it functions correctly, and check if the Ctrl+Z works correctly.

    Leave a comment:


  • replied
    Seems a lot simpler than I had expected. Should be I just need to add an FText variable in the FDialogueNode struct, then in BP in the reply widget is where I get the break DialogueNode that has the variables, which I assume is really all I need?

    I was looking in your source and found the TextCommitted() in DialogueNodeWidget.cpp as well as the OnNodeTextCommitted() in DialogueViewportWidget.cpp. 99% I don't need to touch the dialogueviewportwidget code as I assume that strictly for the text on the node, and about 90% certain I don't need to touch the dialoguenodewidget.

    Problem is adding a variable FText isn't showing up in the widgets or bp. Checked the break node and it's not there either. Simply copy/pasted the Text variable and changed the name.

    Also, would it be possible for you guys to add blueprint style comments to your dialogue viewport? Just makes things easy to organize and shows relevant details at a glance, but I can just as easily use unconnected nodes.

    Leave a comment:


  • replied
    Guys seriously, you just need to manage few nodes to get the finish the voice audio then go to the next nodes.. Don't bother him with that

    Leave a comment:


  • replied
    Let me know if you need assistance with creating a second text field and displaying it inside nodes.

    Leave a comment:


  • replied
    Originally posted by CodeSpartan View Post
    If I understood you correctly, then what you want to do is simply create an event with a Text field, and the logic of the event would open a separate widget and put the Text parameter into the widget. Unless I misunderstood, of course. I didn't quite get what you mean by "separate widget with actual dialogue".
    For the seperate widget I meant that I use a widget component on npc's to display their nodes of the dialogue directly above them. I probably should have thought of that myself, though I think I'm going to first try to add another text field in the nodes themselves, one which will display an overview of what the reply will be, and then another field that will be the spoken words. The spoken words I may create another widget for the player to make their spoken dialogue appear above their own head.
    I worded what I meant kind of weird. Thanks for the idea though, perfect contingency

    Leave a comment:


  • replied
    Originally posted by iSpam View Post
    No problem, thanks for the quick fix and notes. Did you get that from Zh Khang Shao?
    Don't know who it is.


    Originally posted by iSpam View Post
    your move to make condition and event objects was genius
    Can't take credit for it. This was suggested to me by Michael Brune from Underflow Studios.


    Originally posted by iSpam View Post
    I will ask though, off the top of your head can you think of a way to link the text in the dialogue nodes to another text. As an example, the option would say something like "accept" and then send a linked text to a separate widget with actual dialogue.
    If I understood you correctly, then what you want to do is simply create an event with a Text field, and the logic of the event would open a separate widget and put the Text parameter into the widget. Unless I misunderstood, of course. I didn't quite get what you mean by "separate widget with actual dialogue".
    Last edited by CodeSpartan; 08-09-2018, 07:40 AM.

    Leave a comment:


  • replied
    No problem, thanks for the quick fix and notes. Did you get that from Zh Khang Shao? I ran into his post while trying to figure it out. Bit over my head, but seems brilliant. I'll also say that your move to make condition and event objects was genius, really opens up possibilities.
    I will ask though, off the top of your head can you think of a way to link the text in the dialogue nodes to another text. As an example, the option would say something like "accept" and then send a linked text to a separate widget with actual dialogue. Already know to link to other widgets/ widget components so that's not a problem.
    I haven't delved into your data asset code for the dialogues and nodes myself, but if I do before you reply I'll edit this message.

    Leave a comment:


  • replied
    Originally posted by iSpam View Post
    So I'm trying to use Get Game Mode in the Dialogue Conditions bp, and my cast to my game mode is failing because "no world was found", which I'm finding nothing on google about. I did find this link https://forums.unrealengine.com/deve...-event-graphs= where in the 5th post they describe how to get world from uobject children. So I dug into your files and found this,

    Code:
    // It is assigned in DialogueUserWidget.cpp just before calling IsConditionMet()
    UPROPERTY(Transient)
    UWorld * World;
    
    virtual UWorld* GetWorld() const
    {
    return World;
    }
    But looking in the DialogueUserWidget.cpp I'm not seeing world being assigned, unless it's coming from elsewhere and you're referring to the order of execution.

    Basically I just need a way to get the game mode through the conditions, and probably from events as well, but I haven't checked there.
    Thanks for reporting it. I forgot to make World available inside conditions. I made it work for events (get game mode would work there), but forgot to do the same thing for conditions.

    I'll upload a fix right now, and it'll probably get published tomorrow or the day after. In case you want to patch it yourself, here's the diff.
    Last edited by CodeSpartan; 08-05-2018, 09:41 PM.

    Leave a comment:


  • replied
    So I'm trying to use Get Game Mode in the Dialogue Conditions bp, and my cast to my game mode is failing because "no world was found", which I'm finding nothing on google about. I did find this link https://forums.unrealengine.com/deve...-event-graphs= where in the 5th post they describe how to get world from uobject children. So I dug into your files and found this,

    Code:
        // It is assigned in DialogueUserWidget.cpp just before calling IsConditionMet()
        UPROPERTY(Transient)
        UWorld * World;
    
        virtual UWorld* GetWorld() const
        {
            return World;
        }
    But looking in the DialogueUserWidget.cpp I'm not seeing world being assigned, unless it's coming from elsewhere and you're referring to the order of execution.

    Basically I just need a way to get the game mode through the conditions, and probably from events as well, but I haven't checked there.

    Leave a comment:


  • replied
    Originally posted by Mithra82 View Post
    Hi CodeSpartan, before all 4 of us buy your plugin, we have 2 questions.

    a, For our lip sync system to work, for every section spoken, we need to send an event which contains the string info, as our lips sync system needs to analyze the text itself.

    b, do you plan for the future, to create a way to create an interface for creating multiple language variations of the text?

    Thank you for your time
    The first thing can be done my slightly modifying the UMG widget. When a text line is displayed, simply call your lip-sync method with the same text as parameter. I'll show you exactly where this can be done if your programmers can't find it. It's a small widget, there's not much stuff in it. Just shoot me an email if you need assistance with this.

    The second - the plugin is configured to work with Unreal's native localization system, which does everything you might need.

    Leave a comment:


  • replied
    Hi CodeSpartan, before all 4 of us buy your plugin, we have 2 questions.

    a, For our lip sync system to work, for every section spoken, we need to send an event which contains the string info, as our lips sync system needs to analyze the text itself.

    b, do you plan for the future, to create a way to create an interface for creating multiple language variations of the text?

    Thank you for your time

    Leave a comment:


  • replied
    Of course, different game would different method for scripting events and story

    Still... it was quite easy and efficient in one of my projects to use Dialogue Plugin as "screenplay plugin".
    One of the biggest advantages is that I can easily analyze such graph from code. And use this info to pre-load assets soft referenced in "upcoming" nodes, read the path leading to specific node aka "specific moment in story" (one of things needed for automated testing).

    Such generic node editor could be truly useful for many games. I even considered describing usage of such tool for implementing quest/story/events. Probably I will... in spare moment...

    That's why I'm happy that you addedd copy-paste functionality. Thanks!
    Now I'm hopping for a Node Search

    Leave a comment:


  • replied
    Originally posted by Cheshire Dev View Post
    You could use this plugin as convenient base for quest system.
    Most of this code (and the most useful one) is the generic node editor. It's super easy to remove dialogue data and logic.
    - Data for this editor is defined as UDataAsset, simply addd your properties in C++.
    - Add your custom logic for quest system in C++ or blueprints.

    Yes, writing it on your own still does requires C++ skills.
    There's no need for a quest system to be node based. I considered making a quest system at some point, even put its general architecture on paper, and it wasn't going to be node based. In RPGs such as Pillars of Eternity it's not node based either.

    It's just my opinion, of course (except about PoE, which is a fact).
    Last edited by CodeSpartan; 07-27-2018, 09:35 AM.

    Leave a comment:


  • replied
    You could use this plugin as convenient base for quest system.
    Most of this code (and the most useful one) is the generic node editor. It's super easy to remove dialogue data and logic.
    - Data for this editor is defined as UDataAsset, simply addd your properties in C++.
    - Add your custom logic for quest system in C++ or blueprints.

    Yes, writing it on your own still does requires C++ skills.

    Leave a comment:


  • replied
    I love this plugin, great job CodeSpartan.

    Does anyone have a quest plugin/system that would work well with this on MAC as well? Unfortunately the solution I was planning on using (https://www.unrealengine.com/marketp...uest-extension) does not work on MAC. I've been working with that author for a while to try to get it up and running but for some odd reason, the stubborn thing will not show up on a MAC.
    Last edited by EmpireLion; 07-26-2018, 07:43 PM.

    Leave a comment:

Working...
X