Text Input Box for Adventure Games

B

barely entertained

Guest
image.png Hi just a quick question from a game maker newbie. I already checked the forums to find an answer to my question but couldn't find one so here it goes;
I want to implement a textbox at the end of dialogues for my adventure game. The conversations are traditional with choice-answers the player makes and at the end of each conversation the player can type something into a textbox or end the conversation.
(a game that comes to mind which uses this design is HARVESTER. i included images to make myself more clear)

hope someone here can help me with that :)
 

Attachments

You can use the built-in function get_string to show a pop-up window that allows you to input any string.

Code:
// AT THE END OF THE CONVERSATION
my_answer = get_string("Type your answer", " ");
However, I would recommend using the get_string_async function, which is more reliable.

Code:
///AT THE END OF THE CONVERSATION
my_answer = get_string_async("Type your answer", " ");


// ASYNC DIALOG EVENT
var answ_id = ds_map_find_value(async_load, "id");
if (answ_id == my_answer) {
   if (ds_map_find_value(async_load, "status") == true) {
      if (ds_map_find_value(async_load, "result")) != "" {
         global.answer = ds_map_find_value(async_load, "result");
         }
      }
   }

Another method is to create your own textbox but It is way more complicated.
 
Top