Help with autotype function

I hope this isn’t stupid and I’m using functions immensely wrong :sweat_smile: are there not supposed to be conditions or global variables used inside them? My function, an action, works fine, unless I use it with a condition. Then that condition seems to replace at least one of the conditions inside it.

I'm trying to use an idea idea I saw on here but can't seem to find at the moment, to "autotype" text (letter by letter, rpg dialogue style). There's a version in the GDevelop examples, but this is a bit less complex, and tweaked so you can skip the autotype if you want.

If there's no condition attached to the function, it's great. Does exactly what it's supposed to. If there is a condition, say, on a left mouse click, only one letter shows up for every mouse click. I can't tell for sure, but it SEEMS like it's replacing the timer condition inside the function. It does this even in an empty game with nothing but this action and any random condition. Here's the code inside the function

Edit: oh my gosh I'm an idiot. Nothing is replacing anything else, of course it's only going to be true while the condition is active and no other time. This still doesn't fix my problem, as I'm trying to create a rather complex dialogue system with variables and it's still bugging out, but that's one mystery solved.

Well, now I have an ALMOST working function. Which is better than what it was. Maybe someone smarter than me knows what I’m doing wrong lol? It works fine, typing letter by letter a given string- UNLESS there’s more than one of these commands. In which case it displays the first one fine, you can complete it with the spacebar if needed, etc. But any command after the first one only displays everything without the typing effect.

Here's my in-function code
And here's my events code, with 2 example sentences

You’re using a variables, they are not “scoped” to the function, but are living in the scene (well, you’re using global variables, so they live across the game). You probably need to reset them when you want to autotype a new text :slight_smile:

1 Like

Thanks, that helped :smile: Tweaked some things and now it works perfectly!