I’ve been trying to figure out this dialogue for a long time but, for some reason, it really isn’t working. Does anyone know what I can do to fix my dialogue code? I just have one line of dialogue that I want to run in a text box.
I don’t think this is the problem but you have the same scene variable set to 0 twice in the last group of actions. Also I can’t see where you introduce the timer “textscroll” earlier in the scene, but if you’re just introducing it there it’s in a bad spot. Sorry I really can’t see what the problem is but thought I’d mention the variable typo at least. But I’m sure someone will answer with the solution soon.
Oh, I didn’t even notice that, haha. Thank you for pointing it out!
Hello @Martha,
reading this part of code:
I can desume that the “textscroll” timer is not started the first time. Try to start it on the start of dialog.
My tutorial below might help, if you’re still stuck. But jumpingj’s probably solved it for you: you need to start the timer somewhere earlier, before the condition that references it. That’s why some older Yarn tutorials don’t work anymore, because of how timers are handled in GDevelop more recently.
Heey, use this:
Thank you all for the suggestions and help! I figured out another way to make it work, but now I can only perform the actions once and I can’t restart the dialogue once it’s completely finished…I tried moving the scene timer’s around a bit, but I only messed it up more.
Looks like you need to reset your dialogueState to 0.
Actions don’t run unless all of their conditions are met, as simple as that.
Oh, I see. Thank you for letting me know. I added it underneath the “Delete timer ‘scrollText’ from memory”, but now it just keeps replaying the same dialogue. (At least it replays now, haha.) I just don’t know a way to get out of it without messing up the code…
The variable change that you added is conditioned by “dialogue is NOT running”, so if it starts over, I guess it means you’ve reached the end of that dialogue/branch.
But perhaps you have other actions elsewhere interfering with that.
Yeah, I did some tweaking and I was able to fix it by just making the start and end of the dialogue two separate buttons. I would’ve liked to have the same button both start and end the dialogue, but it worked out after all was said and done. Thank you for your help!
I have a one-button dialogue system. I use a boolean variable: “amITalking”. It gets set to True during dialogue (your ‘Start dialogue from branch’ actions) and set to False when the dialogue ends (the actions where you hide your dialogue objects).
When I press X to talk to someone, the variable has to be False to start dialogue. It gets changed to True when dialogue is running. It is still True until I press X to end the dialogue, when it gets changed to False again. That way, you’ll never get trapped in an endless dialogue loop that you can’t get out of.
To start dialogue you press X and the variable must be False
Dialogue begins. Variable changes to True.
To end dialogue you press X and the variable must be True
Dialogue IU is hidden. Variable changes to False.
Although one button is used for both starting and ending dialogue, the variable acts as a kind of lock to make sure only one set of actions is triggered.
I have been trying to create a turn-based RPG. Most of the game is functioning as expected except for the dialogue. I don’t know what I am doing wrong. Every time I fix a problem two new problems pop up. Should I have dialogue on different scenes or layers? Should I have the dialogue show up when a key is pressed, when the character is clicked, or when you collide with other characters. Any help would be greatly appreciated.
Hello,
in the first block there is an error:
the change scene action is called immediatly so you can’t see the animation.
I suggest you to start the animation and create a new block: when animation is terminated, call scene.
About the dialog, is not necessary to create new functions: I suggest you to read this documentation The Dialogue Tree extension - GDevelop documentation and study the examples:
Thanks,
J