So I was trying to make auto typing text work in a game I’m making, and while the auto typing text behavior is certainly functional… It has a major issue.
In my game, I want a sound to play whenever a character is typed like an old rpg, and while this behavior DOES have a condition that supposedly activates whenever it types a character; it’s not really how it works. Instead, it seems to active at the interval you set the characters to be typed, so if I set the characters to be typed every 0.5 seconds, the condition will activate every 0.5 seconds, regardless of weather a character was actually typed or not.
This leads to the issue that this condition cannot actually detect what character was typed. And this is an issue, as I want a sound to play whenever a character is typed, unless said character is a “space”. It also has an issue that the condition keeps activating even after the text has finished typing, and while that can be fixed by adding a second condition to not play the sound when all the text has finished typing, there are some other features I’d like in a behavior like this. In Rpg Maker for example, entering certain commands in brackets could do things like pause the text for a period, or change the tint of certain letters.
So if anyone knows of a better auto typing text behavior, I’d like to know! Thank you.
Hi, I quickly created this JS with GPT-4.1. It seems to work very well.
You just need to hide the BBText object (I used the name BBTEXT_DIALOGUE) and preload the sound, and when a key is pressed or a specific event happens, this JS is triggered. You can adjust the speed by increasing the milliseconds value in the code.
If so you could just move the sound effect to a subevent, and have it check the last character displayed is a space and only play the sound when it isn’t space.
You would use the “Compare two strings” condition, with one side as an expression to check the last character, and one side being " " to be a space.
This would be the expression to do so: SubStr(DialogueTree::ClippedLineText(),StrLength(DialogueTree::ClippedLineText())-1,1)
Here’s “Dialogue tree simple demo” example set up with what I mention above.
I definitely would not use Javascript to do something this simple as it’s one extra condition, and I’d make sure you’re using Yarn dialogue since it’s the best way (in-engine) to do large text heavy games.
Thank you for all this! But, I’m using a bitmap text, and, I have have no idea how to implement this… I’m not actually able to code and am pretty new to Gdevelop.
Just as shown in the screenshot. Make a subevent of your “scroll clipped text” event, add a “Compare two strings”, and put the expression I mentioned above on one side, and " " (quote space quote) on the other side, making the operator Not Equals.