Page 1 of 1

Overlapping text when inserting Player Display name

Posted: Fri Aug 18, 2023 6:29 pm
by LilGames
Hi. I found the discussions elsewhere in this forum about how to show display names, however I am experiencing a bug:

Example conversation text set in the DB/inspector:

It's ... uh ... my ... my name is [lua(Actor["Player"].Display_Name)]. This text is now overlapping!

The result when playing the game is:
uds_overlap-bug.png
uds_overlap-bug.png (24.55 KiB) Viewed 253 times
When I view the text field via the inspector at that time (WHILE playing) it looks like this:
It's ... uh ... my ... my name is Wretched Human . This text is now overlapping!

See the space after "Human" that got inserted? If I copy-paste that text from the inspector, into NotePad, there seems to be a "new line" or carriage return in there:

It's ... uh ... my ... my name is Wretched Human
. This text is now overlapping!


My text field is a TMPro textfield and yes, Rich Text is enabled.
Help! ;)

Re: Overlapping text when inserting Player Display name

Posted: Fri Aug 18, 2023 8:20 pm
by Tony Li
Hi,

Check the TextMeshProUGUI's Overflow property. It should be set to Overflow.

If your text has a carriage return (<CR>) character but not a line feed (<LF>), TextMesh Pro will start typing at the beginning of the line but it won't move down one line.

Re: Overlapping text when inserting Player Display name

Posted: Fri Aug 18, 2023 10:44 pm
by LilGames
Overflow is already on and multi-line text appears normally if I don't use that special lua code tag.

I'm trying to find the scripts where the text gets converted and assigned but having a hard time figuring out where to look. :D

Re: Overlapping text when inserting Player Display name

Posted: Fri Aug 18, 2023 10:53 pm
by Tony Li
Hi,

I don't think the [lua(code)] tag is adding the line feed. It's much more likely that there's a line feed hiding in your Player actor's Display Name field.

BTW, if the player is the conversation's actor, you can use [var=Actor] instead of [lua(Actor["Player"].Display_Name)]. It will probably still have the same problem, though, since I suspect the problem is in the Display Name field's value.

Re: Overlapping text when inserting Player Display name

Posted: Fri Aug 18, 2023 11:33 pm
by LilGames
You are probably correct. I checked and could see no extra characters in the display name, but I clicked Delete a couple times anyways and now everything displays correctly!

Also thanks for the simplification tip.

Re: Overlapping text when inserting Player Display name

Posted: Sat Aug 19, 2023 8:34 am
by Tony Li
Glad to help!