[SOLVED] Yarn Dialogue pause/wait problem

Hello. I’m refining my dialogue system. I want to add pauses in it, so for example, I want there to be one second of delay between sentences (delay in both in text appearing typewriter style and in sound).

I use both Yarn and AutoTyping-behavior, since I personally find yarn very confusing to use outside of setting up basic dialogue.


I though I could pause the dialogue using commands that are now greyed out on the bottom. But it doesn’t work. So next I tried to use a command like this in yarn:

(it should work automatically I assume, based on what’s said here: The Dialogue Tree extension - GDevelop documentation)

But both tries lead to exactly the same outcome: the text stops scrolling completely when the command is reached, and next time I press Z (my “next” button), the same sentence is repeated, this time continuing to the end of the line.

So if I had:
“Hello! <<1000/pause>> How are you?”
the player will see while playing:
“Hello!”
“Hello! How are you?”
and there will be no pause at all

1 Like

Hello. I don’t think this will work because:

(1) the command isn’t formatted properly. It should be like this: << wait 1000 >>> with 1000 being the length of the wait in milliseconds.

(2) your text is set up as line text and not clipped line text. Yarn needs it to be the latter so that it processes the text letter-by-letter and encounters in-line commands as it chugs along.

(3) it’s unlikely that the Yarn wait command will work with text that’s animated with the typewriter extension and not Yarn (or, more accurately, the dialogue extension). With the classic set up, Yarn chomps through the text letter-by-letter and processes in-line commands as it gets to them, before carrying on with chomping through the rest of the line afterwards.

On here and on my channel, sometimes someone will say “My dialogue only shows the first letter!” and I say “Have you got the typewriter extension installed?”. If a user has the classis Yarn set-up (clipped line text, letters appearing one-by-one) and the typewriter extension installed at the same time, they will find that the two things clash with each other and lines won’t animate as expected. But let us know how you get on. Perhaps you can get the two things to get along.

Edit: I just realised that you created a custom command: pause. It should be formatted like this
<< pause >> or perhaps << pause myParameter >>, but not <<1000/pause>>. That won’t mean anything to Yarn. Try with just << pause >> and see if your disabled events work now, with text still set as line type.

1 Like

Oh wow it’s the tutorial guy himself! Thanks for helping. I watched the whole tutorial twice but I’m still having SO MUCH trouble :sob:

I Think you might be correct here. In that case, I should probably use the classic method.
But then I have even more things to fix.

I have it here now, in some, broken state.

1 . First of all, the pausing still doesn’t work. What was the correct way to format it again? Without using custom command (since I only tried it after the “automatic” didn’t work) [also I did not literally write " <<1000/pause>> " in the Yarn file, I either wrote “<<1000>>” or “<< pause >>” (without those spaces) - both had the same result.] Is the correct format:

Blah blah! << wait 1000 >>> Blah blah blah.
or
Blah blah! <<1000>> Blah blah blah.
or some other? And have I understood correctly that since this is not an CUSTOM command, I don’t need to create an event looking for it?

2 . This classic method causes my dialog to loop. When it ends, it starts again right away (and my character starts walking upwards by itself, maybe it’s some left over speed?)


Here are my events. (The boolean “painetaanKeyMuualta” is set to false by NOT pressing Z. The “pressedZ” boolean is true only for a short time after Z is pressed)

Oh I see you’ve had the same problem with existing momentum after dialogue. Could you share more details about how you solved it?

I am indeed ‘the tutorial guy’, or ‘Jason’ for short :laughing:

  1. It’s << wait 1000 >> (for one second). You are correct: you do not need an event for it because it’s a built-in Yarn command.

  2. The reason you get stuck in a loop with your dialogue is because you are using the same button to begin and end it. So when you press a button to end your dialogue, it’s setting off the launch dialogue event too. Using a Boolean toggle won’t fix that. I struggled with this last year and decided the least hassle was to use two different buttons. It is possible to fix, however, with the aid of a timer: if Z is pressed AND the timer has reached 1 second, launch dialogue. The timer would need to be reset when dialogue ends, but it would also need to be set at the beginning of the scene - or somewhere else - or it’ll never be created for the dialogue launch event to check it).
    Or just try using a different button for ending dialogue, or just have it end on its own after a set time using a timer check. That might also fix your character walking off on his own. Also, be sure to remove the typewriter extension because it will clash with the Yarn’s own typewriter stuff. It’s a case of ‘one or the other’, not both.

If you follow my tutorial exactly and don’t try to customise it as you go, it will work. Get the basics working first, and then change it to how you’d like afterwards. That will help you to understand Yarn a little better and it will probably be easier than trying to fix your events (I’m sorry but I don’t have time to work through your events to try to figure out why they aren’t working correctly). It’s a good idea to save a version of your game with the basic dialogue system set up and working, so you can always go back to it if something doesn’t work out.

  1. Existing momentum fix. I came up with a hacky way of doing this because it wasn’t possible to remove applied forces to my platformer character, so I hid them instead. I noticed the action ‘Stop (remove all forces)’ in your events. I think this must be a new action because I asked about this on the forum, back when I had the issue with my player character moving a little bit when dialogue ended if he happened to be moving when dialogue was launched. At the time there was no way of removing the forces which is why I came up with a hacky way of hiding them instead. I might experiment with the ‘Stop’ action in my own game and see if I can remove the need for my existing fix events entirely. It wouldn’t be easy for me to explain how I did it because it applies to several specific things I have set up in my game, but I said the following in my original post about it: “when dialogue ends a variable becomes true, which is used to launch my ‘jitter fix’ event: I set the player character’s animation to idle, wait 0.1 seconds, then set the variable back to false.” I think the reason your character moves after dialogue is a different issue to the one my fix would help with, assuming it’s continuous movement and not a quick flicker of movement. (see answer 2, above).
1 Like

Hi. Thanks for your attention!

I went through the tutorial again. It works just like in the video. But 3 problems which are not addressed in it persist.

  1. The pause system still doesn’t work. Nothing repeats anymore, but there is no pause. Very frustrating :frowning:

  2. I’m not sure how to add dialogue sound effects now. You know, beeping when text appears? I also need it to stop during the pauses. But I admit that I haven’t yet searched much for solutions.

  3. How to get rid of the post-dialog step. It’s not a continuous movement. It’s a quick flicker or a flash. Might be more than a single frame, but not much longer. It’s very quick. The “stop” action does nothing to my knowledge. I’m assuming the movement provided as an behavior doesn’t count as “forces” and because of that, it doesn’t work. I’ll try to make my own “jitter fix”

TLDR Update 3: Made a lot of progress. Issue 3 is solved. Issue 2 seems pretty much solved but I don’t know fully before the pausing works. Issue 1 persists. It seems like the dialogue IS PAUSING, but for a very short time. It also seems like the wait amount doesn’t effect the pause length. :sob: :face_with_spiral_eyes:

Update 2: I have made some progress with the dialogue sound. I think I can propably pull it off myself, but I don’t really know before getting the pauses to work. I checked out your " Yarn variables and conditional statements" tutorial. I have my command set up in the exact same way (I think) but but there seems to be only a very very short pause. Not anything as noticeable as in your video.

Update 1: While issues 1 and 2 persist, I made my own “jitter fix” and it “works”. The character still moves (maybe 1 pixel) after the dialogue but the animation doesn’t flicker. It’s tolerable now and I guess you haven’t found a fix for the movement either? You just hid the animation change so it looks better just like me?

Hi Valo, Sorry I can’t offer ongoing support, and this will have to be my last comment before I move on. You will find lots of posts about sound and other features by searching in the forum, and the Wiki is also a good place to learn GDevelop. GDevelop 5 documentation - GDevelop documentation
The official GDevelop YouTube channel also has lots of tutorials about general GDevelop use.

There’s nothing different about using sound with dialogue than using it for anything else in GDevelop. You could trigger a sound with a button press, when dialogue begins and ends, and even use a custom Yarn command to trigger sounds when certain parts of the dialogue are reached. I haven’t tried any of these things myself yet.

Yarn is tricky. It was one of the things I learned early on when I first began using GDevelop, which I think might be your case too. It was not the easiest place to start, but it did make sense with some practise, like most things. I’ve only been using GDevelop since last April, and I am far from being an expert. My main tip is to start easy. Get the basics up and running before trying to customise or change things.

Pausing (Wait): I don’t know why this doesn’t work for you. It works for me, using the classic set-up from my original tutorial. I tested Wait again this morning to make sure. Remember, in Yarn, that 1000 is one second, 2000 is two seconds, 500 is half a second etc. Sometimes seconds (1, 2.5 etc.) are used in GDevelop and sometimes milliseconds (1000, 2500 etc.) are used, so it can be a little confusing at times. I mention the Wait feature in my video, Yarn variables and conditional statements, 19:41, where I cover it briefly, but I don’t do anything different there to what I mentioned to you on this forum.

More about sound. I haven’t got much experience with using sound in GDevelop yet, but I use a coin collection sound effect in my Yarn variables and conditional statements video (07:40) which I made using the built-in sound effects generator.

‘Jitter’. I had a quick look at the ‘stop, remove forces thing’ and unfortunately this doesn’t seem to be an action that removes things like deacceleration from a platformer character. It’s to do with other types of forces in GDevelop that I haven’t used. There is no way currently to remove momentum from a platformer character and make them suddenly stop, and I expect the same applies to a top-down character. So I will continue to use my ‘fix’ to hide the little bit of movement that happens when dialogue and other things end (when platformer behaviour is enabled once more). This below event gets activated by my ‘dialogue is not running’ and ‘inventory gets closed’ and ‘quest log gets closed’ events:


Notes: (1) I target a group instead of a single platformer character because I have two versions of my character that I want to target. (2) My character has a blink, which I turn off during the fix to stop his eyes displaying weirdly. (3) Anywhere in my game that I want to use this fix, I use an action that sets jitterFix to true. The jitter fix event then runs and the variable gets set back to false near the end of it, ready to be used again. (4) It feels a bit hacky and I wouldn’t do a tutorial on it for that reason.

Best of luck with your game.

Edit: It seems you made an additional post about the jitter issue and made progress with it there, so I needn’t have spent time writing about this again today. Please remember to update comments where you ask for help if you have managed to solve the problem. As a side note: unfortunately, setting the current speed of the character before disabling platform behaviour doesn’t remove all of the jitter for me, hence my work-around, but I’m glad it’s worked for you with your top-down game.

1 Like

Thank you for your time. I understand. Sorry if I wasted your time with the jitter thing. I made the another thread before I made this one and just happened to get a reply last night. I didn’t want you to waste your time on solved problems, so I tried to give you an update here, specifying which problems persist and which ones are solved. But perhaps I wasn’t clear enough and I apologize. I appreciate every piece of advice you have given me.

1 Like

You’re welcome Valo. I’m sorry for being a bit grumpy today. Tough day. I hope I was able to help a little bit. And you’ve helped me too: because of your other thread about the jitter thing, I now have the urge to have another try at fixing it instead of hiding it with a weird event. It seems that might be a possibility after all because of what Silver Streak said.

1 Like

You were a huge help. I respect the apology but you were already completely forgiven : ) ! I hope you are okay regardless of your current hardships. Stay stonggg maaan, you are doing god’s work here!!

1 Like

I think the problem is now solved? Maybe. The solution is extremely strange.

I opened the “Dialogue tree with yarn online” game example from:
https://wiki.gdevelop.io/gdevelop5/all-features/dialogue-tree/

in that example, the “wait 1000” commands work. I started to remove seemingly unneeded events in the context of dialogue and pausing it, one by one, and testing if the command stops working at some point. Eventually, it did, and I found out which event was responsible for it. It was this one:


I don’t understand how this custom command and the wait command are connected. Both are commands but it shouldn’t matter (I think).

So I tried to take that command and pasted it in my project. I don’t even have avatars or any need tfor any custom commands right now. I just took it as it is, and put a random object (boxes sprite) on the place of avatars object, like this:

And now it works. I seem to be able to use pauses of different lengths too. If I had to guess, this is a glitch. I really have no idea why this accrues, but maybe Yarn needs you to use some kinds of custom command in the event in order to use automatic ones (the wait command).

That is indeed strange. Built in Yarn commands and custom commands are separate and shouldn’t affect each other. I didn’t have to do a workaround back when I used Wait for that video about variables. It is possible, though, that a new glitch has appeared since then. However, I loaded my shopkeeper project just now and Wait works as intended without extra events, avatars or fixes, so it seems Yarn is still fine with the latest version of GDevelop. It updated a couple of days ago, I seem to remember. I always get nervous when GDevelop updates, worrying that something in my project will break! :upside_down_face: But that’s just me.

image

A 5 second wait worked fine just now when I added a new one. Be sure to use lowercase ‘w’, or Yarn will think it is a custom command and will just ignore it unless you set up an event that does something with ‘Wait’.

1 Like

Hmm… I’m using the most recent update too:
“This version of GDevelop is: 5.2.169”

I currently write the command without space before and after the <> symbols. Like: <<wait 1000>>
That’s how it was written in the official example but I guess both work.

Do “extra events” include any type of “command << X >> is called” conditions? Does the wait work for you even without any kind of “command is called” events before or after it?

(don’t feel pressured to spend more time on this if you don’t care :slight_smile: just ignore me)

Wait seems to work, as you have rightly suggested, with or without spaces to the left of ‘wait’ and to the right of the time value.

I’m don’t think I completely understand the second question, but Wait works as shown in my screenshot. It doesn’t need anything else to work because it’s a built in Yarn command. All you need to supply it is a time value. If it’s not working for you still, or only works when you do an unconventional workaround, there must be something in your events that’s affecting it, but I can only guess what that might be. Wait has worked for me since I used it the first time when I did that video last year, using the simple set-up from my first tutorial. I don’t tend to use it now because the dialogue in my game appears in fully formed lines, not the classic typewriter thing (as you can imagine, I’m a bit fed up with letters slowly appearing, after doing all those tutorials about it! :laughing:

1 Like

What I meant to ask in my second question is that if you don’t have any “command << X >> is called” conditions in your events, will the wait-command still work :)? Conditions like…

Command <<“Pause”>> is called
.
Your most recent screenshot doesn’t tell me what kind of EVENTS you used in GDevelop.
.
So, if you removed ALL conditions that reference yarn commands from your WHOLE PROJECT, would the wait command you used in Yarn still work for you:
image
All these GDevelop conditions in this picture reference commands in some way, so they need to be removed before my theory can be tested.

It looks like you’ve found a bug with Yarn or GDevelop. If I disable my nameTag custom command, wait no longer works, even if the command I have disabled isn’t even used anywhere. You were right. Well done for spotting it.

So it seems you have to have one custom command of some kind to get the built-in Yarn wait to work, even though they are completely unrelated to each other. The command doesn’t even need to be used, but you need an event set up for it. I never noticed before because I have always had one custom command in my tutorial projects. Therefore, I have no idea how long this has been a thing. Could be a year or more.

Edit: I did a bit more digging. Even if I have just this (below), wait will work, with no actions in the nameTag event. But if I disable this useless event, wait stops working.

Even this will work (below) and I don’t use ‘whoCares’ anywhere. It’s not typed anywhere in my dialogue and it’s not configured to do anything in this pointless event.

At least it’s an easy workaround: you just make one dummy Command event that does nothing and wait will work like it’s supposed to.

Would you like to report the bug or would you like me to?

1 Like

I knew it!!! Thanks for confirming my suspicions. No wonder this was such a headache for me. I’ll report it!

1 Like