Putting color to Game text messages.

McLovin

New Member
Reaction score
1
Hi!

When making a trigger displaying a text message to all players including one players name, how do I make it so that his name in the message has the same color as his units? For example when someone picked a Hero, and there's a message stating that Player 1 picked Hero1, I want the text "Player 1" to be red. And if player two picks one it should be blue etc.

I want the same for messages like: Player 1 (Hero1) killed Player 2 (Hero2)

.. where the Player 1 part is in red and the Player 2 part in blue.

Now I think I figured out one way to do it but it would include lots and lots of If/Then/Else combinations and I thought there might be an easier way.

Any suggestions? =)

Regards!

McLovin
 

Flare

Stops copies me!
Reaction score
662
Set the color strings in an array at Map Init (you can use Gradient Mixer for getting the color codes, it's in useful tools thread). i.e.

ColorString[1] = (Red colour code)

Then, when you display the message, add ColorString[Player number of killing/dying unit owner] + name of killing unit + |r (to end the color code)

Or, take a look at the DotA template at WE tutorials (there's a link at left of page), that should have the system for player-coloured kill messages
 

ZiggyMcjoney

Data editor?! AAAHHHHH!
Reaction score
95
Code:
Events
 Map initialization

Actions 
 Set PlayerColours[1] = |CFFFF0303
 Set PlayerColours[2] = |CFF0042FF
//etc. for every other player colour.

Thats a string array variable.

Then, when they pick their hero, the string should be:

PlayerColours[Player number of (Owner of (Triggering unit))] + Player + String(Player number of (Owner of (Triggering unit))) + |r has just done something!
 

McLovin

New Member
Reaction score
1
Thanks alot, I'll have a look at it!

Btw, do I have to create the variable in advance or is it being created in the trigger you mentioned? Or is it just being edited in the trigger?

Regards!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top