• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Showing player names in team color in special messages.

Status
Not open for further replies.
Level 12
Joined
Nov 5, 2007
Messages
730
When showing special messages,theres an option to show player name.

For example

(Player name of(owner of(Triggering Unit)) + Has killed (Player name of(owner of(Killed Unit))

comes out like

Player 1 Has killed Player 2

I want to know if its possible to show the player names in their team color without adding color codes to strings.

It should be like this:

Player 1 Has killed Player 2

Any help will be appreciated.
 
Level 5
Joined
May 21, 2006
Messages
174
You need to have color codes.
But you can set them in a string array if you want to:
Set PlayerColor[1] = Color Here
Set PlayerColor[2] = Color Here
...
And then call the variable instead of typing the color codes all the time.
 
Level 5
Joined
May 21, 2006
Messages
174
This is a simple, yet effective way, of doing it...

Setup:
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set PlayerColor[1] = (|CFFFF0000 + ((Name of Player 1 (Red)) + |r))
      • Set PlayerColor[2] = (|CFF0000FF + ((Name of Player 2 (Blue)) + |r))
Show Text:
  • Show Text
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • (Owner of (Killing unit)) Equal to Player 2 (Blue)
    • Actions
      • Game - Display to (All players) for 15.00 seconds the text: (PlayerColor[1] + ( got pawned by + (PlayerColor[2] + !!!)))
 
PatruX, you just fragged me :p Your trigger is very effective and simple, while mine, yeah, see for yourself(It's really 12 times larger(all the player):[size="1]The text that you have entered is too long (140602 characters). Please shorten it to 80000 characters long.[/size]):
  • Message
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set KillingUnit = (Killing unit)
      • Set DyingUnit = (Dying unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of KillingUnit) Equal to Player 1 (Red)
        • Then - Actions
          • Game - Display to (All players) the text: (((|c00FF0000 + (Name of (Owner of KillingUnit))) + |r) + has killed:)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of DyingUnit) Equal to Player 1 (Red)
            • Then - Actions
              • Game - Display to (All players) the text: ((|c00FF0000 + (Name of (Owner of DyingUnit))) + |r)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of DyingUnit) Equal to Player 2 (Blue)
                • Then - Actions
                  • Game - Display to (All players) the text: ((|c000042FF + (Name of (Owner of DyingUnit))) + |r)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of DyingUnit) Equal to Player 3 (Teal)
                    • Then - Actions
                      • Game - Display to (All players) the text: ((|c001CE6B9 + (Name of (Owner of DyingUnit))) + |r)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of DyingUnit) Equal to Player 4 (Purple)
                        • Then - Actions
                          • Game - Display to (All players) the text: ((|c005300A6 + (Name of (Owner of DyingUnit))) + |r)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Owner of DyingUnit) Equal to Player 5 (Yellow)
                            • Then - Actions
                              • Game - Display to (All players) the text: ((|c00FFFF00 + (Name of (Owner of DyingUnit))) + |r)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Owner of DyingUnit) Equal to Player 6 (Orange)
                                • Then - Actions
                                  • Game - Display to (All players) the text: ((|c00FF9900 + (Name of (Owner of DyingUnit))) + |r)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Owner of DyingUnit) Equal to Player 7 (Green)
                                    • Then - Actions
                                      • Game - Display to (All players) the text: ((|c0020C000 + (Name of (Owner of DyingUnit))) + |r)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Owner of DyingUnit) Equal to Player 8 (Pink)
                                        • Then - Actions
                                          • Game - Display to (All players) the text: ((|c00ED92CB + (Name of (Owner of DyingUnit))) + |r)
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Owner of DyingUnit) Equal to Player 9 (Gray)
                                            • Then - Actions
                                              • Game - Display to (All players) the text: ((|c00C0C0C0 + (Name of (Owner of DyingUnit))) + |r)
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • (Owner of DyingUnit) Equal to Player 10 (Light Blue)
                                                • Then - Actions
                                                  • Game - Display to (All players) the text: ((|c007EBFF1 + (Name of (Owner of DyingUnit))) + |r)
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • (Owner of DyingUnit) Equal to Player 11 (Dark Green)
                                                    • Then - Actions
                                                      • Game - Display to (All players) the text: ((|c00008000 + (Name of (Owner of DyingUnit))) + |r)
                                                    • Else - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • (Owner of DyingUnit) Equal to Player 12 (Brown)
                                                        • Then - Actions
                                                          • Game - Display to (All players) the text: ((|c00934900 + (Name of (Owner of DyingUnit))) + |r)
                                                        • Else - Actions
        • Else - Actions
 
Status
Not open for further replies.
Top