Hello all,
I'm working with a turn based combat system and would like to create a decent combat log that breaks down what happens on both the player's and AI's turn.
I already have a system that adds both basic lines of string together from each turn as one larger string that's displayed on the screen, but I feel like it could be done better.
The idea I have ruminating in my head is to create some sort of layout group that adds each turn's actions into the layout group. At the same time I wanted to change some parts of the log to reflect dynamic variables such as damage amount and which enemy is attacking, but I think that's done with a [Format String] action yet I'm wondering if those formatted parts can have their text color changed to further reflect what's going during those turns.
OR, would it be better to stick with a [Build String] action that I already have and just update that?
IE.
What I have just uses a [Build String] action.
Element 0 = <Attacker Name Variable>
Element 1 = attacks
Element 2 = <Target Name Variable>
Element 3 = for
Element 4 = <Damage Variable>
Element 5 = damage!
And then it just adds that string with a new line to the combat log text and displays it.
What I'm thinking is something like the following
Format String = "{0} attacks and deals {1} damage" (But to spice it up it would instead pull a string from an array with different ways to describe the combat yet still use the same kind of format)
{0} would be who's attacking but I'd like it to be blue for the player and red for the enemy
{1} would be the amount of damage being done, and it would change its color based on the type of damage being done.
But also needs to be added to the layout group as a new textmeshpro field/box/element, that way I can easily adjust spacing and whatnot.
If anyone could help me out I'd appreciate it, or maybe I'm over thinking things and someone knows how to do what I need much more efficiently. Either way, do have yourselves a good day!