Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to log FText?

I'm having some issues with FText not displaying on my HUD. So, I'm trying to print the contents with UE_LOG. The only thing is nothing prints out. I don't believe I'm converting my FText to FString or FName correctly.

Here's what I have currently:

 DialogueNodes *temp = dialogues2.Find(id2);
 const FString logData = temp->DialogueFragment.ToString();
 FName logDataF = FName(*logData);
 UE_LOG(LogTemp, Warning, TEXT("DialogueFragment: %s"), *logDataF.ToString());
Product Version: UE 4.11
more ▼

asked Jul 27 '16 at 02:44 AM in C++ Programming

avatar image

138 8 17 25

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You don't need to convert FString to FName to print it with UE_LOG.

Conversion from FText to FString is simple as that:

 FText SomeText = FText::FromString("Something");
 FString SomeString = SomeText.ToString();
 UE_LOG(LogTemp, Log, TEXT("SomeString: %s"), *SomeString);

There's no magic here afaik. I'd rather guess that the issue is either with the way you fill your FText variable or with the way you're trying to display it.

more ▼

answered Jul 27 '16 at 07:42 AM

avatar image

1.2k 20 23 40

avatar image zerophase Jul 27 '16 at 09:14 AM

Odd, I changed a blueprintable function from return type FName to FText, and it wasn't getting called. Turns out I had to delete the binding to my HUD in blueprints, and recreate it with all of the same functions.

avatar image Atheist91 Jul 27 '16 at 12:00 PM

Good that it works. :p

avatar image darkgaze Jan 30 '18 at 11:26 AM

I think everybody uses this great article on logging https://wiki.unrealengine.com/Logs,_Printing_Messages_To_Yourself_During_Runtime

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question