How to make gdevelop regonize the Arabic letters and words when the player input them through keyboard

Hello, I am new to Gdevelop, and I wish for someone to help me with an issue I have with building an educational game. In this game the player has to input on the keyboard a specific Arabic word in order to shoot the bullets towards their English equivalent. The problem that I face here is how to make that happen, namely, how to make the game recognize inputting that Arabic word and then fire the bullet towards that enemy, which is the corresponded English word.

1 Like

:wave: Hi and welcome here! :slight_smile:
Do you mean that you tried, and it worked with English words but didn’t work with Arabic words? GDevelop should accept any alphabet.
Can you be more specific about which part is the issue?

Ok, when I choose “key pressed” (text expression) and put an Arabic word as an example between brackets and launch the game, and start inputting the word on the keyboard in order to make the bullet fire, but nothing happens. The same thing is true with Arabic letters and English words, but it only works with English letters.

This makes more sense now. The “key pressed” condition does not look for custom words. It wouldn’t matter if you’re using Arabic or English for that condition.

It looks for a single key on the keyboard. “Key pressed” means “The user is pressing the X key” (Where X is a single key string, like “a”, or “Return” or “Num1” (meaning the number 1 key on the top row of the keyboard). You will not be able to use it to check for full words or anything similar.

So, are there any solutions to make the game recognize the player inputting an Arabic word and be able to fire the bullets towards the enemy, noting that I don’t want the Arabic word to appear on the screen, but just the player when input the word on the keyborad the bullets are fired

Again, GDevelop should accept any alphabet, so you shouldn’t focus on that.
But, I would suggest to start building your project in single language only, and implement the bi-language afterwards.
Open the text input example to see how user input works and how to compare the input with a stored value.

Then you’ll need to have a dictionary file with the correct answers, load that file in a variable structure, and check the input value against the dictionary.
You have a lot of work ahead of you. :sweat_smile: The bullet firing part is a detail.

Excuse me if I am bothering you again, and i want to thank you where I took your advice which really worked and started using the text input in addition to the entry text where if a specific Arabic word that I want is typed in the input text, the laser shoots towards the enemy. But the problem I face is that when the player types a wrong word or letters in the input text. So what I want is a way to get the player’s wrong input automatically deleted from the input text without pressing the backspace button or other buttons on the keyboard, which allows the player to immediately reinput the right word again which lead the laser to be fired .

Note that iam just testing this feature right now, so i dont use any stored values or variables where i add the word i want by my self using the new text entry memory.

You can set the content of the input to whatever you want, including “” (empty text).
So, you can clear what the player wrote when a certain number of letters has been reached or when the Return key is pressed, for instance.

can you provide me with an example, because I searched a lot and I couldn’t find what I am looking for, which how to return the text empty when player type the wrong word.

compare the entry with the right answer, if it’s the same, fire a laser, if it’s different, set the text input to empty “”.

1 Like