• 🏆 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!

Looking for help with Player Kill Announcement trigger

Status
Not open for further replies.
Level 1
Joined
Aug 4, 2018
Messages
2
Hi, I want a trigger that displays player kills, example.

Player 1 kills Player 2, I would like it to say



"Player 1 killed Player 2" using Player 1 and 2's player names and have Player 1 be red, and 2 be blue.


I currently have it set up as


Events-> Unit - A unit Dies

Conditions -> ((Triggering Unit) is a Hero) Equal to True
(Owner of (Dying Unit)) Equal to Player 2 (Blue)
(Owner of (Killing Unit)) Equal to Player 1 (Red)

Actions -> Game - Display to (All players) the text: (Name of Player 1 (Red))
Game - Display to (All players) the text: has killed
Game - Display to (All players) the text: (Name of Player 2 (Blue))



With this trigger, when Red kills blue it comes up as


"Reds Name"
has killed
"Blues Name"


I was wondering if anybody can help me make a trigger that displays all of this on one line? Maybe through the use of Variables? Though I'm not the most experienced when it comes to that so I'd need some help.
 

Attachments

  • Screenshot_11.png
    Screenshot_11.png
    9.7 KB · Views: 34
Level 11
Joined
Aug 6, 2009
Messages
697
You use "Concatenate Strings" to combine multiple strings together into one sentence. It's located near the top when selecting the string parameter for the function "Game - Text Message..."
An image of Concatenate Strings without any parameters.
f5668a50d421e940aa78ed5bb860a58a.png
This shows that you can use Concatenate Strings inside Concatenate Strings.
b1b8b2cebd3f931a7f2f68470dde0cd5.png
 
Level 1
Joined
Aug 4, 2018
Messages
2
Ah Thank you Assassins-Creed, It worked to get it all and then some on one line :csmile:

I wasn't getting player colors with the names but I messed around a bit and figured it out I think,
for anyone else who wants to see how, here it is


Unless there is a simpler way that I'm oblivious too.
Thank you once again
 
Status
Not open for further replies.
Top