Who? What? How?
Download Start Code

Last page I showed you how to get my example project working and a basic description of how the example script works.
Lets try and make a quick modification of it.


func _ready():
	print_text("What is your name?\n")
	
	var user_name = await input()
	print_text(user_name + "\n")
	
	print_text("Why hello there, " + user_name + "\n")
	

All that we do here is request a name, wait for that name, and print it back out.
Note that if we try to send a new input to this it won't do anything after our first. This is because I removed the while true loop.
I like to print input as soon as we take it as well, because I feel like it improves cohesion.

Lets consider something a bit more complicated...


func _ready():
	print_text("Please enter number 1: ")
	var num_1_txt = await input()
	print_text(num_1_txt + "\n")
	var num_1 = int(num_1_txt)
	
	print_text("Please enter number 2: ")
	var num_2_txt = await input()
	print_text(num_2_txt + "\n")
	var num_2 = int(num_2_txt)
	
	var sum = num_1 + num_2

	print_text(num_1_txt + " + " + num_2_txt + " = " + str(sum) + "\n")
	

We gather input two seprate inputs, turn them into intigers (numbers) and add them togther, before turning that sum back into a string (text) to print it.

Here is one last example.


func _ready():
	print_text("Say Beep. Do it.\n")
	var user_input = await input()
	print_text(user_input + "\n")
	
	if user_input.to_lower() == "beep":
		print_text("Beep is the best word ever!\n")
	else:
		print_text("I gave you one job! Try again!\n")
	

Here we request that the user inputs Beep.
The value that the user inputs is compaired, checking if it is equal to Beep. (We convert it to lowercase first so that it isn't case sensitive
Depending on the inputs state, we output a diffrent string of text.

This is certianly not enough to make an entire game, but it is a start.
Play around with this. When you need to do something else look it up.
Maybe find a good tutorial.