(C#) Rich text tags in custom resource not working

Godot Version

4.1

Question

I am trying to make a dialogue system, and I made a custom resource with some information (character portrait, voice, font, and text in the form of a string) but when I put tags like \n in the string it gets treated as plain text, is there a different way I am supposed to do this?

You can change your text before assign it to your rich text label like this : text.replace(“\\n”, “\n”)
The tags “\n” is save in resource file as “\\n”

I can’t find out how to get this to work
this is what i’m doing
string TrueDialogue = action.dialogue.Replace(“\n”, “\n”);

and it does not appear to be working

Hi,
Godot forum messed up with slash and backslash, here is a screenshot of my code.
SharedScreenshot

and my textresource :
SharedScreenshot2

Okay, I changed it to
string TrueDialogue = action.dialogue.Replace(“\n”, “\n”);
GD.Print(TrueDialogue);
but it still prints the \n as plain text, I am using C# which is probably not the issue, but it could be.

and if it matters the sting I am using is "*Stay on the path /n*Test"

Ho ok, it don’t work because you use a slash and not a backslash. Use this :
SharedScreenshot3

Oh yeah that would make sense

honestly idk how I got that wrong, but I guess it’s similar to how I keep using assignments in if statements

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.