Dialogue system not working when adding more than one function

1 favourites
  • 14 posts
From the Asset Store
Customize the animation of character when item changed
  • I have a dialogue system that works as I want it to, but only when it triggers a single line of text. If I try adding a second line to show up afterwards, separately, it breaks.

    I hit space once to start the dialogue, a second time to move to the other dialogue (it still works here), and the third time I hit space to destroy it and finish, it breaks. It seems to only break at the end of the dialogue however. So with 4 options, the first 3 work fine.

    When it works (1 dialogue):

    Character is locked in place

    Dialogue box is destroyed after a button press

    When it doesn't work (2+ dialogue):

    Character can move freely with the dialogue box still open

    Dialogue box does not destroy unless the character moves around away from the trigger

    Screenshot attached. Thank you for any help!

  • Is dialogue a global variable right? You set it to 1 after the first call, is it getting checked somewhere? Show all your uses of that variable, that is where I would look first.

    yours

    winkr7

  • Is dialogue a global variable right? You set it to 1 after the first call, is it getting checked somewhere? Show all your uses of that variable, that is where I would look first.

    yours

    winkr7

    The global dialogue variable you're talking about is there to prevent the characters from using their walking animations during a dialogue moment, and isn't connected to the dialogue event sheets outside of that. Removing that doesn't seem to fix the issue either way. Here is what that variable is referring to:

  • Is it possible you are creating multiple dialogues and only seeing the top of the stack? The debugger might show that kind of thing? That is what I would check for next.

    yours

    winkr7

  • Is it possible you are creating multiple dialogues and only seeing the top of the stack? The debugger might show that kind of thing? That is what I would check for next.

    yours

    winkr7

    Hm I checked that and didn't see anything extra, just the single dialogueTrigger

  • After trying to find an answer for a while, I've come to the conclusion it's 100% the dialogueTrigger failing to work if more than one function is called above it. I'm still not sure why it's acting up like this, though.

  • This is backwards:

    I followed the same tutorial and had the same problem. Those two events need to swap places.

  • This is backwards:

    I followed the same tutorial and had the same problem. Those two events need to swap places.

    Hm I switched them and there's still the same issue. Everything works perfectly until the very last line of dialogue.

  • > This is backwards:

    >

    >

    >

    >

    >

    >

    > I followed the same tutorial and had the same problem. Those two events need to swap places.

    Hm I switched them and there's still the same issue. Everything works perfectly until the very last line of dialogue.

    Actually, after switching them it now loops back to the start of the first dialogue unless I wait for it to finish completely. After waiting for it to finish and then moving on, the second dialogue plays. If I don't wait for that to finish it loops back to dialogue one again.

    If I DO wait for dialogue two to finish as well, THEN try to exit, it loops through dialogue two and never goes back to one.

    PS ignore the difference in buttons with space and E, I just switched the buttons between screenshots.

    Here's what I'm working with for the dialogue:

  • I wonder if disabling the player movement in the function (and thus disabling it multiple times) is causing an issue.

    I just checked my project and I disabled player movement in the "talk to the NPC" event block and it works fine.

  • Also, you're pressing space to both advance the dialogue AND to trigger the interaction, that's probably what's causing the loop.

  • Also, you're pressing space to both advance the dialogue AND to trigger the interaction, that's probably what's causing the loop.

    Wow yep, that's exactly what it was! Thank you! It works fine if I use two different buttons.

    But now I'm wondering how I can get around that, as I'd like a single interact button instead of needing to switch. To keep things intuitive. I'll figure out a little thing to keep E from being used as an interact button while in dialogue.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Got it! Just added the global variable system condition I made for preventing movement to this as well. Posting it here in case somebody comes searching. Thanks everyone!

  • ZachR, thank you so much for posting your solution!!! We are using similar dialogue functions and I could not for the life of me figure out how to solve the same problem. You are amazing.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)