Announcement

Collapse
No announcement yet.

Dialogue Plugin

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

  • replied
    4.20 - Plugin works fine in editor - Crashes the game in Standalone as soon as it's used in game - What to do ?

    Leave a comment:


  • replied
    Originally posted by fabiomsilva View Post
    thank you, this is awesome! I was Almost able to make it work 100%. Everything works, no errors, but when i try to play, i cannot select or hover any replies using the mouse. I double checked and i did the simulate next clicked and hovered correctly for both branches, so im not sure what couldve failed here. On my reply widget everything is the same as well. If in project settings i turn on "use mouse for touch " it works(but the rest of the game doesnt, not to mention i dont want to play as a phone) ,so im not sure whats going on.

    Also, I couldn't get the gamepad to work with the replies either. I checked the documentation and everything seemed already set up as in the documents.(i also noticed "on key up" its not connected execution pin to sequence(is this intended).
    If you could do a video tutorial on how to set up the dialogue to be used with the gamepad would be amazing!

    thank you for all the help so far.
    Gamepad is already set up, it's some remnant code that's not connected, because it can be used to make fallout-4 style functionality where you always have 4 replies, and you select one with gamepad face buttons. But scrolling through replies with the D-pad works.

    I'm not sure what's causing issues in your project, can you upload it to google drive and send it to me? Or if for some reason you don't want to share your project, simply reproduce the problem in a clean project and send that instead. My email is on my marketplace seller's page (don't want to re-post it too often, afraid spambots might find it). Just send it to me and I'll have a quick look.
    Last edited by CodeSpartan; 11-08-2018, 06:32 AM.

    Leave a comment:


  • replied
    thank you, this is awesome! I was Almost able to make it work 100%. Everything works, no errors, but when i try to play, i cannot select or hover any replies using the mouse. I double checked and i did the simulate next clicked and hovered correctly for both branches, so im not sure what couldve failed here. On my reply widget everything is the same as well. If in project settings i turn on "use mouse for touch " it works(but the rest of the game doesnt, not to mention i dont want to play as a phone) ,so im not sure whats going on.

    Also, I couldn't get the gamepad to work with the replies either. I checked the documentation and everything seemed already set up as in the documents.(i also noticed "on key up" its not connected execution pin to sequence(is this intended).
    If you could do a video tutorial on how to set up the dialogue to be used with the gamepad would be amazing!

    thank you for all the help so far.

    Leave a comment:


  • replied
    I've decided to add the video as an alternative to text in the documentation, because seeing it being done must be easier to replicate for people new to blueprints.
    I've also updated the documentation with much more precise instructions.

    Here's the video (make sure to watch it in fullscreen in 1080p):
    Last edited by CodeSpartan; 11-07-2018, 04:46 AM.

    Leave a comment:


  • replied
    You're guessing correctly. Just locate all errors and change types accordingly.


    Originally posted by fabiomsilva View Post
    the blue output doesnt link to simulate click
    So just drag the blue spline and type in "simulate click" to recreate it.

    Let me know if you're still struggling with it, I'll record a video of me doing the whole process if necessary.
    Last edited by CodeSpartan; 11-07-2018, 03:32 AM.

    Leave a comment:


  • replied
    ok I guess its not "overriden demo reply" but, "myDialog reply"(im assuming you had 2 tutorials going on?) , but im still getting a lot of errors. When Im castint to "MyDemoReply_Widget" the blue output doesnt link to simulate click nor simulate hover targets(object reference is not compatible with demo reply widget object reference (also i am guessing i need to change all the castings from demoreply to "my demoreply)

    Leave a comment:


  • replied
    thanks for the reply CodeSpartan, sadly i'm still not able to fix the error. In the step "doubleclick on the MouseSelectReply method to go to its definition in the OverriddenDemoDialogueWidget.:: i cannot change "WidgetThatWantsSelection" to overriden demo reply"(i searched for it, looked into all nodes, that one doesnt show up in the list.

    Leave a comment:


  • replied
    How can the dialogue end with NPC?

    Leave a comment:


  • replied
    Originally posted by fabiomsilva View Post
    Also, is there anyway to have more than just the player speaker and another one?
    It can be done, but the way to do it really depends on your game. For example, if you want the camera to slide over to some other NPC, this can be done through the event system described in the second tutorial video.
    If you want to change the name of the NPC that you're displaying, this can be done in multiple ways. Again, event system can achieve that. Or you can add speaker field to every node. Or it can be a reference to an NPC and retrieve name, portrait, NPC position for camera from there. There are many ways to go about it and they all depend on the frequency of multiple speaker occurences and on your game behavior when the speaker changes.

    TL;DR: If you don't know C++, I suggest the event system (explained in the second tutorial video), because it's entirely in blueprints and easy to use.
    Last edited by CodeSpartan; 10-31-2018, 03:58 PM.

    Leave a comment:


  • replied
    Originally posted by fabiomsilva View Post
    No one knows how to fix this?

    My bad, I must have forgotten to update the documentation after I introduced the highlight functionality in the last update.

    To fix this, doubleclick on the MouseSelectReply method to go to its definition in the OverriddenDemoDialogueWidget.

    Then change its parameter type:


    Let me know if you encounter any other similar issues. Thanks for this report.
    Last edited by CodeSpartan; 10-31-2018, 03:57 PM.

    Leave a comment:


  • replied
    No one knows how to fix this?

    Leave a comment:


  • replied
    Hi, im trying to follow the documentation to duplicate the dialogue widget's but im getting this error.

    Also, is there anyway to have more than just the player speaker and another one? I wanted to have multiple npc's talking, but i only see options to add one npc name on each dialogue other than being able to put different names.

    Attached Files

    Leave a comment:


  • replied
    Originally posted by CodeSpartan View Post

    I see.

    Data assets are your game files. The only reason you can modify them at runtime in the editor is because the editor makes no distinction between whether you're doing it through a Bluetility or in PIE. But you won't be able to modify data assets on runtime in a cooked build. This is because they're your game files. It's like irrevocably modifying a mesh of a dinosaur into a bird because you've reached a certain checkpoint in game. But what happens if you load a prior savegame or you've started a new game? Your file will effectively be corrupt, because you'll see a bird. That's why it's not possible.

    Like I said, if you want to mark your nodes as read, you need to make an array of ints and add their indexes. This way you know you've visited the nodes.
    Ah, I was unaware of that. Thank you, I'll definitely keep that workaround in mind

    Leave a comment:


  • replied
    Originally posted by iSpam View Post

    I have two bools, one visible for me to check whether I want this to be said once, and another that is set to true in the RunEventsFor, that way the next time the IsConditionsMet is run, the function will return false.

    Code:
    bool UDialogueUserWidget::IsConditionsMetForNode_Implementation(FDialogueNode Node)
    {
    UE_LOG(LogTemp, Warning, TEXT("No repeat for node at %d is %s"), &Node, Node.noRepeat ? TEXT("True") : TEXT("False"));
    if (Node.noRepeat)
    {
    UE_LOG(LogTemp, Warning, TEXT("No repeat is true, returning false in UDialogueUserWidget::IsConditionsMet"));
    return false;
    }
    
    for (UDialogueConditions* Condition : Node.Conditions)
    {
    if (IsValid(Condition))
    {
    if (!Condition->IsConditionMet(GetOwningPlayer(), NPCActor))
    {
    return false;
    }
    }
    }
    return true;
    }
    
    void UDialogueUserWidget::RunEventsForNode_Implementation(FDialogueNode Node)
    {
    if (Node.sayOnce)
    {
    
    UE_LOG(LogTemp, Warning, TEXT("sayOnce true in UDialogueUserWidget::RunEventsForNode"));
    Node.noRepeat = true;
    }
    
    for (UDialogueEvents* Event : Node.Events)
    {
    if (IsValid(Event))
    {
    Event->RecieveEventTriggered(GetOwningPlayer(), NPCActor);
    }
    }
    }
    The line if statement in RunEventsFor is working as intended, but because the nodes are being passed in by value, the change isn't being propagated to the actual data asset.
    I have tried, for these two functions only, passing the node in by ref, but I'm still getting different nodes. I can't make the node a pointer parameter since FDialogueNode is a struct.
    void UDialogueUserWidget::RunEventsForNode_Implementation(UPARAM(ref) FDialogueNode& Node) is how I attempted to pass by reference, which I found from Rama

    I'm just wondering if you could think of a workaround that won't break the rest of your code.
    I see.

    Data assets are your game files. The only reason you can modify them at runtime in the editor is because the editor makes no distinction between whether you're doing it through a Bluetility or in PIE. But you won't be able to modify data assets on runtime in a cooked build. This is because they're your game files. It's like irrevocably modifying a mesh of a dinosaur into a bird because you've reached a certain checkpoint in game. But what happens if you load a prior savegame or you've started a new game? Your file will effectively be corrupt, because you'll see a bird. That's why it's not possible.

    Like I said, if you want to mark your nodes as read, you need to make an array of ints and add their indexes. This way you know you've visited the nodes.
    Last edited by CodeSpartan; 09-25-2018, 01:21 PM.

    Leave a comment:


  • replied
    Originally posted by CodeSpartan View Post

    If I understand you correctly, you want to have a bool on the node (in the data asset) and be able to change it at runtime? If that's the case, I may venture a guess that something is wrong with your architecture and you should do it differently.

    Are you trying to mark visited nodes as dirty? Because that's not how you should do it.
    I have two bools, one visible for me to check whether I want this to be said once, and another that is set to true in the RunEventsFor, that way the next time the IsConditionsMet is run, the function will return false.

    Code:
    bool UDialogueUserWidget::IsConditionsMetForNode_Implementation(FDialogueNode Node)
    {
        UE_LOG(LogTemp, Warning, TEXT("No repeat for node at %d is %s"), &Node, Node.noRepeat ? TEXT("True") : TEXT("False"));
        if (Node.noRepeat)
        {
            UE_LOG(LogTemp, Warning, TEXT("No repeat is true, returning false in UDialogueUserWidget::IsConditionsMet"));
            return false;
        }
    
        for (UDialogueConditions* Condition : Node.Conditions)
        {
            if (IsValid(Condition))
            {        
                if (!Condition->IsConditionMet(GetOwningPlayer(), NPCActor))
                {
                    return false;
                }
            }
        }
        return true;
    }
    
    void UDialogueUserWidget::RunEventsForNode_Implementation(FDialogueNode Node)
    {
        if (Node.sayOnce)
        {
    
            UE_LOG(LogTemp, Warning, TEXT("sayOnce true in UDialogueUserWidget::RunEventsForNode"));
            Node.noRepeat = true;
        }
    
        for (UDialogueEvents* Event : Node.Events)
        {
            if (IsValid(Event))
            {
                Event->RecieveEventTriggered(GetOwningPlayer(), NPCActor);
            }
        }
    }
    The line if statement in RunEventsFor is working as intended, but because the nodes are being passed in by value, the change isn't being propagated to the actual data asset.
    I have tried, for these two functions only, passing the node in by ref, but I'm still getting different nodes. I can't make the node a pointer parameter since FDialogueNode is a struct.
    void UDialogueUserWidget::RunEventsForNode_Implementation(UPARAM(ref) FDialogueNode& Node) is how I attempted to pass by reference, which I found from Rama

    I'm just wondering if you could think of a workaround that won't break the rest of your code.

    Leave a comment:

Working...
X