0 votes

I've been writing a custom dialogue engine with Godot. The way it works is it reads a text file, and then loads the dialogue from it. Godot's text files work fine when I create one from the editor, but the second I close it and come back, it forgets that the resource is a text file.

I end up getting this error:

scene/resources/resourceformattext.cpp:804 - res://Test.tres:1 - Parse Error: Expected '['
Failed to load resource 'res://Conversations/Test.tres'.
Failed loading resource: res://Conversations/Test.tres. Make sure resources have been imported by opening the project in the editor at least once.

I've looked at the files of other types, and it looks like it has a text format such as:

[gd_resource type="[Type goes here]" format=2]

[resource]

I've tried adding this to some text files to see if it will do anything, but nothing happens.

One last thing. I know you can use .txt files and they work the same way, but it doesn't seem like they are supported by Godot very well. They don't show up in the file system dock, and they don't have the text editor like Godot has support for with the built in text file type.

I don't know if all of this is a bug, but it definitely feels like I'm missing something.

Thank you in advance for your time!

Godot version 3.4.2
in Engine by (40 points)

1 Answer

0 votes

I might be totally wrong, but I think it might be a case of needing to escape special characters such as quotes ( " ) using a backlash " \ "

by (1,342 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.