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

[Trigger] Player Names

Status
Not open for further replies.
Level 11
Joined
Mar 30, 2008
Messages
666
Player Names [Resolved]

Hey!
I have a little problem with a trigger.
  • First Bloods
    • Events
      • Unit - A unit owned by Player 7 (Green) Dies
      • Unit - A unit owned by Player 8 (Pink) Dies
      • Unit - A unit owned by Player 9 (Gray) Dies
      • Unit - A unit owned by Player 10 (Light Blue) Dies
      • Unit - A unit owned by Player 11 (Dark Green) Dies
    • Conditions
      • ((Killing unit) is A Hero) Equal to True
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Trigger - Turn off First Bloods <gen>
      • Trigger - Turn off (This trigger)
      • Player - Add 200 to (Owner of (Killing unit)) Current gold
      • Quest - Display to (All players) the Hint message: ((|cff00ccffFirst Blood|r - + PlayerNames[(Player number of (Owner of (Dying unit)))]) + ( has been killed by + (PlayerNames[(Player number of (Owner of (Killing unit)))] + for an additional 200 Gold.)))
      • Sound - Play firstblood <gen>
      • Trigger - Turn on FHK <gen>
      • Player - Add 5 to (Owner of (Killing unit)) Current lumber
Variable = PlayerNames String Array (1)

And when I try it in-game it looks like.

First Blood- _____ has been killed by _______ for an additional 200 Gold.
The Player Name not appears.
Does somebody know?
Thanks,
cHeRoL
 
Last edited:
Level 6
Joined
Aug 22, 2008
Messages
123
What he is trying to show you is:

The array does not contain the proper datas, that means you were setting it up wrong.
You may not need that array when using "Player name of (Owner of (Triggering unit/killing unit))" as Playernames. That array would only make sense if you changed the player names and want to use their previous names:wink:

The initialisation of that array would be correctly done this way (free hand):

Code:
For each Integer A from 1 to 12 do multiple...
    Actions
        set array[Integer A]= Name of (Player (Integer A))
 
Level 11
Joined
Mar 30, 2008
Messages
666
Player Names (Resolved)

Ok,I see.
I changed it to
  • Quest - Display to (All players) the Hint message: ((|cff00ccffFirst Blood|r - + (Name of (Owner of (Dying unit)))) + ( has been killed by + ((Name of (Owner of (Killing unit))) + for an additional 200 Gold.)))
and it works nice.
 
Last edited:
Status
Not open for further replies.
Top