Im making a text adventure game and have some code taht makes it show a message when the game starts but the message it shows isnt what i gave it and the message it shows doesnt even exist in my code. The code should work fine but doesnt how do i fix this?
code:
signal respone_generated(response_text)
var current_room = null
func initialize(starting_room):
change_room(starting_room)
func proscess_cmd(input: String) -> String:
var words = input.split(" ", false)
if words.size() == 0:
return "Error no words parsed"
var first_word = words[0].to_lower()
var second_word = " "
if words.size() > 1:
second_word = words[1].to_lower()
match first_word:
"go":
return go(second_word)
"help":
return help()
_:
return "unrecognized command"
func go(second_word: String):
if second_word == " ":
return "Go where? "
return "You go to %s" % second_word
func help() -> String:
return "Usable commands: go[location], help"
func change_room(new_room: Start_room):
current_room = new_room
emit_signal("respone_generated", "you go to " + new_room.room_name)
emit_signal("respone_generated", new_room.room_description)`~~~
[upl-image-preview url=https://godotforums.org/assets/files/2024-03-16/1710548492-600521-screenshot-2024-03-15-180625.png]