Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Adventure Creator, how to change colour of text per character

A topic by mikdog created 9 days ago Views: 24 Replies: 4
Viewing posts 1 to 5

Hello! I like the wave and jiggle effects of Super Text Mesh! I'm trying to get STM to work with Adventure Creator. I've got it working mostly using the supplied script here, but one issue I'm having is that all characters use the same text colour that's set in the STM SubtitlesUI prefab. Each character's dialogue should have their own colour text, and in dialogue boxes, it should be that any <c=whatever> should overwrite that colour, but by default, it would help if each character had their own default colour text as set in Adventure Creator's Player or NPC components.

I asked Chris (who made Adventure Creator), and he said the STM colour should be set to the following. Any idea how I can do that please?

superText.color = speech.GetColour ();

He also said "I don't have Super Text Mesh so I wouldn't know what the correct syntax is, but that asset's developer should be able to advise." Which is why I'm asking here. Thanks!

Developer

Hello,


The Adventure Creator plugin was developed by a friend of mine if I'm remembering correctly, so I'm also unfamiliar with it! (And it hasn't been updated in a long time... I think!)

But going by that code, that should be correct for setting a baseline colour for a SuperTextMesh object... Are you able to edit the script attached to the "STM SubtitlesUI" prefab that you mentioned and add that code to it? Look for wherever that code is setting "superText.text", and you should put the line of code you shared on the line before that, so the colour is set before the text is set. My thinking is as follows: the script has to be getting the dialogue from somewhere, so that would be the right place to also grab and set the colour data.


I'll be able to take a look at the code myself later, (things have been really busy for me, sorry!) but this should be a pretty easy feature to be able to add yourself!

Yhoo, thanks so much for the fast reply!

Yep, that worked! I replied just now but the error was simple - I wasn't reading the console correctly - it was just that superText should have had a small t.
Now it works as intended, thanks!

Still need to explore this more, but stoked to have this working.

Fyi here's the edited script:

https://pastebin.com/hGfC9pQx

Developer

Thank you so much for sharing! I need to update the package properly but this will be great to have publicly for the time being. I'm glad it works!