How do I add choices that set variables in text boxes?

Can I add a menu that appears next to a text entry box with choices?

Here’s an example:

  1. A person in the game to say “Will you help me?”
  2. A menu will appear with these choices: “Yes” or “No”
  3. The up and down arrows can be used to select “Yes” or “No”, and the spacebar will be used to confirm the choice.
  4. A variable can be set for each answer. A variable called “ChoseToHelp” will be created ,with a value of “1” if the player says “Yes”, or “0” if the person says “No”.

Is GDevelop capable of doing that? Would that be extremely hard for the developers to add to the next version?

So far, I created a text box that says “Will you help me?” when my main character presses the spacebar while touching the collision box of a different character, and I forced the text to disappear when the collision boxes stop touching. What do I do next?

Is the “TextEntry” feature the only way of doing this? I don’t want people to have to type the answers every time.

I added three pictures to this post as examples of what I want to achieve.
example 1.png
example 2.jpg

Yes but won’t be easy.

Personally I would be using Text object instead…

I can give you only some suggestion that may or may not help you so I try to keep it short.

What I would try is to have 5-6 EMPTY text objects on the bottom of the screen to display choices and simply set their text depends on the content of the dialog:

If dialog = “Do you want to help me?”
Then set text object1 = “Yes” and set Text object2 = “No”.

Than I would have the selection box that is using a variable to keep track of which answer (text box) is selected and change it position on Y axis if the arrow keys are pressed.
If dialog = “Do you want to help me?” and space key is pressed and text object1 is selected then change dialog to “Great, I know I can count on you.” If text object2 is selected then set dialog to “Shame on you…:frowning:”. And update the text objects on the bottom to display new choices for the new dialog or nothing in case there is nothing to choose from…

I hope it helps somewhat…

Thanks for your advice, ddabrahim!

I finally achieved my goal a few hours ago.

  1. I added a second layer to my game that always includes one big textbox for dialogue, and four small textboxes with the possible conversation choices. The second layer follows the movement of the player, so I’ll never need to reposition the boxes.
  2. During a conversation, the main character’s movements are disabled, so the up and down arrows can be used to select a choice.
  3. The other character will remember the dialogue option I chose.

When I was working on this, I used a sickening amount of variables. I had to use so many variables that the code looks like a nasty mess! Using this for more than one conversation will be stressful because I will need many new variables for each conversation!

For example, I would have to set a variable called “conversation-1-with-John-completed = 1” to allow the second conversation to start. Without that variable to disable the first conversation, the first one would be repeated. A full game would require a new variable for every completed conversation, like “conversation-20-with-John-completed = 1”.

Well, instead of keep track the state of each individual conversation, could be better to keep track the quests of the player.
So, for example let say a character might ask the player to help hunt some wolfs, so instead of track the state of the actual conversation, you could add an inventory item “number of wolfs hunted” and so, manipulate the conversation based on this value.

If “number of wolf hunted” item doesn’t exist in player quest inventory, ask the player to hunt them down.
If the item exist but the number is less than 10, ask the player to hunt more.
If the item exist and the number >= 10, say thanks to the player and give some reward…
Finally, use an object variable for the NPC character to set the quest complete so it is no longer gong to offer the quest or the reward again…

Maybe it is going to be not much easier, but more organised than a bunch of variables.