- Edited
I am making a text adventure game, using Godot 3.4.2, and one thing I would like to do is have the game read long blocks of text from external text files, just to keep things neat and easy to edit. I have taken the 'load' function almost word-for-word from the documentation here in order to read from a text file in the game project's directory:
func help():
var help_text = File.new()
help_text.open("res://text/help.txt", File.READ)
var content = help_text.get_as_text()
help_text.close()
return content
This in fact seems to work fine, the text is displaying correctly in the game. However, I'm getting an error in the Debugger I can't seem to find any information on. This error is popping up even when the game isn't running, and is slowly filling up the window:
Cannot open TextFile 'res://text/help_text'.
Cannot load text file 'res://text/help_text'.
editor/plugins/script_editor_plugin.cpp:752 - Condition "!rel_text_file.is_valid()" is true. Continuing.
I'd like to figure out what is wrong and how to clear up this error. If there's a more proper way to pass text paragraphs into Godot than just using external .txt files, I'd appreciate any hints there, as well. Thanks!