[SOLVED] BBCode text // variable text parts color

Hi,

is it somehow possible to change the color of a variable part of BBCode text object?
For example if I have a battle log (one single BBCode object) and player gets damage the part of the damage information (Enemy damage Variable) will be shown in red.

Something like this does not work:

“Player hit with " + [color=#ff0f0f] VariableString(enemy.1.attack-damage) [/color] + " damage”

or in my case as dynamic structure variable:

“Player hit with " + [color=#ff0f0f] VariableString(enemy_stats[VariableString(current_enemy)][“damage”]) [/color] + " damage”

Thanks!

Best regards

Okay I’ve found the solution! :smile:

Just have put the quotation marks to the BBCode effect codes.

Like this:

“Player hit with " + “[color=#ff0f0f]” + VariableString(enemy.1.attack-damage) + “[/color]”+ " damage”

or in my case as dynamic structure variable:

“Player hit with " + “[color=#ff0f0f]” + VariableString(enemy_stats[VariableString(current_enemy)][“damage”]) + “[/color]” + " damage”

Thanks for your reflexion. It can help us.
Otherwise and generally, always thinking to put an " when manipulating string of characters