Page 1 of 2

Change colour of accumulated text

Posted: Mon Apr 24, 2023 10:15 am
by blop
Hi Tony

I was searching through previous posts to find tips on how to change the colour of accumulated text, to direct a players eye to new text and responses, and came across this post:

https://www.pixelcrushers.com/phpbb/vie ... f=3&t=5978

So I applied that but strangely enough it only seems to apply to the very first line of dialogue in my conversation. I'm using the Scrolling Dialogue UI and I'm having difficulty spotting the source of the issue, although I'm sure it's probably something small I've missed :lol:

One additional thing, in the script it changes the colour of the text, but say you have different colours for actor names which you wanted to retain, how would you go about that? Changing the alpha of the text colour? Apologies if that is a bit outside the realm of Dialogue System specific questions.

Thanks

Re: Change colour of accumulated text

Posted: Mon Apr 24, 2023 10:40 am
by Tony Li
Hi,

Does the example scene work correctly in your project? You should see that it colors all accumulated text gray.

If you want to retain the colors of actors' names, you'll need to modify the GrayAccumulatedText script to not remove the <color> tags around actor names.

Re: Change colour of accumulated text

Posted: Mon Apr 24, 2023 12:49 pm
by blop
Yeah the example scene is working as intended and I'm using the same script from that example in my dialogue UI.

Re: Change colour of accumulated text

Posted: Mon Apr 24, 2023 2:27 pm
by Tony Li
If you want to get to the bottom of the issue where only the first line is grayed out, please reproduce the issue. Play through three lines so that the first line is gray, the second line isn't gray, and the third line is the regular subtitle color.

Then pause the game, inspect the Subtitle Text GameObject, and copy-paste the text into a reply here.

Re: Change colour of accumulated text

Posted: Mon Apr 24, 2023 3:44 pm
by blop
Figured out the issue in doing what you advised, on the Dialogue Actor component I had the Set Subtitle Color and Apply Color To Prepended Name options ticked, so that I could do some formatting for specific actors. Just as a test I commented out the if statement in the script to see if it would work without removing the 'color' tags and it did, so I guess from here I'll need to remove some further tags in the if statement.

Thanks for the advice here Tony, much appreciated.

Re: Change colour of accumulated text

Posted: Mon Apr 24, 2023 4:07 pm
by Tony Li
Glad to help!

Re: Change colour of accumulated text

Posted: Mon May 22, 2023 11:30 pm
by colorbar
blop wrote: Mon Apr 24, 2023 3:44 pm Figured out the issue in doing what you advised, on the Dialogue Actor component I had the Set Subtitle Color and Apply Color To Prepended Name options ticked, so that I could do some formatting for specific actors. Just as a test I commented out the if statement in the script to see if it would work without removing the 'color' tags and it did, so I guess from here I'll need to remove some further tags in the if statement.

Thanks for the advice here Tony, much appreciated.
For someone who isn't exactly an expert on coding, could anyone show an example of what the code would look like after this change? I'm also colouring prepended names in the dialogue actor component, but would like everything to be grey after the player moves on to the next line.

Re: Change colour of accumulated text

Posted: Tue May 23, 2023 8:13 am
by Tony Li
Hi,

The code linked above (in this post) should handle that. If not, let me know what it's currently doing in your project and how you'd like it to work differently.

Re: Change colour of accumulated text

Posted: Tue May 23, 2023 5:35 pm
by colorbar
Tony Li wrote: Tue May 23, 2023 8:13 am Hi,

The code linked above (in this post) should handle that. If not, let me know what it's currently doing in your project and how you'd like it to work differently.
Hi, I'm using a version of the Scrolling Dialogue UI and put that script (from the other thread) into the Subtitle Text Game object.

The first line of dialogue is grayed out as expected, the second line (a player response) is the colour that is set for the player's name. Then the third line is the NPC again which is how I mean for it to look until it turns gray.

Sorry for the blurring of the NPC's name, I don't know the rules on content here and don't want to get banned.

Image https://pasteboard.co/ONUO8d05HxHO.png

Am I able to pick the colours for each character's name, but have white text for the rest and then once the player has moved from that line to the next, it turns gray?

Re: Change colour of accumulated text

Posted: Tue May 23, 2023 8:19 pm
by Tony Li
Hi,

Try putting the script on the top-level dialogue UI GameObject.