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!

    Maybe a long shot, but it could be trying to access it when it's unavailable for whatever reason. KidsCanCode has a small tut and he says to check if the file exists before starting it:
    https://kidscancode.org/godot_recipes/basics/file_io/

    Obviously is does exist, but you never know.

    Otherwise, on your link they suggest using resource loader instead.

    Try using a CSV file. I've gotten those to work. This is better as it can be used sort of like a database, so you can store text from different screens or levels. When you import a CSV file, you just have to turn off translation, and then add it to the custom export for the pck file.

    Nickel For anyone else experiencing this error, for me, simply restarting Godot cleared it. Adding new functions that read from text files will create similar errors, which apparently disappear for good on restarting and loading the project in again. Perhaps not the most satisfying conclusion, but at least it doesn't seem to be an ongoing problem!

    Also note, you have to add "*.txt" in the pck export setting in order to play the game when you export it.