[Trigger] Hero killed by player.

Ishida

New Member
Reaction score
1
[Trigger] Color in text

Thanks to KaerfNomekop my original problem was solved, but i'd like to know how to use colors based on the player in the text

So it would look like
Player1(Bob) was killed by Player2(Ishida)!
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Trigger:
  • Hero Killed
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True (Triggering unit is the unit that died)
      • ((Killing unit) is A Hero) Equal to True
    • Actions
      • Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( has been killed by + ((Name of (Owner of (Killing unit))) + !)))

Use the Concatenate Strings function. It lets you put two strings together, and the strings you input can also be Concatenate Strings, thus letting you add as many different string parts as you like.
 

Ishida

New Member
Reaction score
1
Thanks for this, i will try to put this together.

EDIT: I could only get String 1 and String 2.. also... Name of (Owner of (Triggering unit ) ) <--- can't find this anywhere
EDIT2: Figured it out. Thanks
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
To do that you need to add colour codes before and after the text. I believe this list is accurate.
|cffff0303Player 1|r
|cff0042ffPlayer 2|r
|cff1ce6b9Player 3|r
|cff540081Player 4|r
|cfffffc01Player 5|r
|cfffeba0ePlayer 6|r
|cff20c000Player 7|r
|cffe55bb0Player 8|r
|cff959697Player 9|r
|cff7ebff1Player 10|r
|cff106246Player 11|r
|cff4e2a04Player 12|r

You should make string variables at the start of the game to store the player names in colours, like so:
Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Player 1 (Red) slot status) Equal to Is playing
    • Then - Actions
      • Set ColouredPlayerName[1] = (|cffff0303 + ((Name of Player 1 (Red)) + |r))
    • Else - Actions

And repeat this action for all players. Then, if you wanted to use colours in the player names, you would change the text action to this:
Trigger:
  • Game - Display to (All players) the text: (ColouredPlayerName[(Player number of (Owner of (Triggering unit)))] + ( has been killed by + (ColouredPlayerName[(Player number of (Owner of (Killing unit)))] + !)))
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top