Need help fixing text adventure response problem

Godot Version



I am completely new to Godot and trying to make my first game. I tried following a tutorial ( ‘Godot Retro Text Adventure’ by Jmbiv on YouTube) but I’m stuck at the part where when I input text the response doesn’t appear in the debug.
this is the code the tutorial is using and I am as well:

extends Control

const InputResponse = preload(“res://InputResponse.tscn”)

@onready var history_rows = $background/MarginContainer/Rows/GameInfo/HistoryRows

func on_Input_text_submitted(_new_text: String) → void:
var input_response = InputResponse.instantiate()

(I should also note that I have no former coding knowledge and that I’m a complete newbie at this :,) )

It seems your function on_Input_text_submitted ignores the parameter _new_text and only adds an empty instance of InputResponse to history_rows.

Perhaps something like input_response.set_text(_new_text) could fix that? Hard to determine without any further context.

I tried changeing

func on_Input_text_submitted(_new_text: String) → void:
func input_response.set_text(_new_text) → void:

but it just gets angry and stops working altogether, is there any context I could give to make it easier to help me?

Sure. Find the script attached to the scene InputResponse.tscn (most likely, but it can have any other name) and check what function or variable is responsible for setting up the text.

Anyway, the author of the mentioned tutorial is probably the best person to answer your questions. Have you tried to ask him?

I should probably have thought of that, I’ll try and see if I can find a way to contact them and ask if they would be able to figure out what I’m doing wrong- but tysm for trying to help me out anyway!