• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Colored text in triggers?

Status
Not open for further replies.
Level 25
Joined
Mar 23, 2008
Messages
1,813
Yea i know how to get color on a message through triggers but the problem here is that:
  • Actions
    • Game - Display to (All players) the text: I want this-> ((Name of (Owner of (Dying unit)))<- to be in color, but thats not a text string, thats a converted player name to a string, and i cant write the color code there, to make it colored :/ + Has been killed)
Maybe hard to get what i mean, sry in that case :/
 
Level 4
Joined
Oct 11, 2008
Messages
90
I have the same problem. The owner of dying or killing unit can be any player from 1 to 12. That means 12 colours. So when you write "Display the name of (owner of dying unit) + has been killed" how do you write know which colour to use?
 
Level 4
Joined
Oct 11, 2008
Messages
90
There is a way to use 12 conditions:
If (owner of (killing unit) equal to Player 1 (Red) then ...<<use red colour>>..
If (owner of (killing unit) equal to Player 2 (Blue) then ...<<use blue colour>>..
...
but that works only if you want to return either the (owner of (killing unit)) or (owner of (dying unit))
if you want both, then it gets complicated. Isn't there an easyer way?
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
If i have a trigger like this:

-A unit dies

-dying unit is a hero

-Display the name of (owner of dying unit) + has been killed

how can i make this (owner of dying unit) to be written in color?

So if player one´s hero dies, his name will be written in red, player 2 blue and blabla.

I this this should be the best way....you can also use it for other massages...
first edit this variables (string) at map initialization

  • player colors
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set COLOR[1] = |CFFFF0303
      • Set COLOR[2] = |CFF0042FF
      • Set COLOR[3] = |CFF1CE6B9
      • Set COLOR[4] = |CFF540081
      • Set COLOR[5] = |CFFFFFC00
      • Set COLOR[6] = |CFFFE8A0E
      • Set COLOR[7] = |CFF20C000
      • Set COLOR[8] = |CFFE55BB0
      • Set COLOR[9] = |CFF959697
      • Set COLOR[10] = |CFF7FBFF1
      • Set COLOR[11] = |CFF106246
      • Set COLOR[12] = |CFF492A04
  • hero dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Game - Display to (All players) for 20.00 seconds the text: (COLOR[(Player number of (Owner of (Dying unit)))] + ((Name of (Owner of (Dying unit))) + has been killed))
Use this :fp:|r if you wanna stop the color
 
Status
Not open for further replies.
Top