• 🏆 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] who selected - problem

Status
Not open for further replies.
Level 3
Joined
Mar 27, 2009
Messages
30
I've got a new, quite simple map, in wich 12 players will try to select a unit, as fast as possible. The problem i have is that i can't find a way to get the player who selected the unit first into a variable. The only thing i manage to get is player 16, and it makes me mad... JASS or gui doesn't matter, as long as there's a solution to it.

  • frogHit
    • Events
      • Unit - Frog 0003 <gen> Is selected
    • Conditions
    • Actions
      • Unit - Cause (Triggering unit) to damage (Triggering unit), dealing 100.00 damage of attack type Chaos and damage type Divine
      • Unit - Create 1 dummy frogHit for Neutral Passive at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to frogHit
      • Unit - Move realFrog instantly to (Random point in (Current camera bounds))
      • Game - Display to (All players) for 3.00 seconds the text: (Frog hp: + (String((Life of realFrog))))
      • Wait 2.50 seconds
      • Unit Group - Pick every unit in frogHit and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
realFrog / frog 0003 = the unit who will be selected

As you might see, the frog will be damaged if it's selected and when someone kills it, that player wins. The thing is that atm i don't know who won.

thank you
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
There is quite a basic solution, actually. If you browse through your events you'll see that there is an event for Player - Selection Event. If you use this event then you can also use the Event response - Triggering player to reference the player that selected the unit, and then use conditions to narrow down what types of units you are specifying.

Try using Event response - Triggering player in the trigger you currently have and see if that references the appropriate player. I think that only the player-unit event allows reference to the triggering player though.
 
Status
Not open for further replies.
Top