• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How can I check who is the owner of a unit?

Status
Not open for further replies.
Level 2
Joined
May 21, 2012
Messages
31
I have 2 teams. If a hero dies, I need him revived at his team's graveyard.

  • Death
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to True
        • Then - Actions
          • Game - Display to (All players) for 10.00 seconds the text: ((Proper name of (Triggering unit)) + has been killed and will respawn in 30 seconds!)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
              • Wait 30.00 game-time seconds
              • Hero - Instantly revive (Dying unit) at (Center of (Playable map area)), Show revival graphics
            • Else - Actions
        • Else - Actions
This is what I have so far. The "If" before wait 30 seconds is what I need. If unit is owned by players 1,2,3,4 or 5 then revive at force 1's graveyard. If owned by 6,7,8,9 or 10 then revive at force 2's graveyard. You get what I mean?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
There are many, many ways of doing this.

Lets say Team 1 uses Players from 1 to 5. And Player 2 uses players from 6 to 10. When the hero enters playable map area, if the player number of the owner of the unit is less than or equal to 5, add it to "Team1 PlayerGroup" else, add it to "Team2 PlayerGroup".

To revive, if owner of dying unit is in "Team1 PlayerGroup" revive at Team1 Region, else, revive at Team2 region.

Btw. your trigger leaks point (Center of (Region))
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Hero Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) belongs to an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Hero - Instantly revive (Triggering unit) at Graveyard Team 1, Show revival graphics
        • Else - Actions
          • Hero - Instantly revive (Triggering unit) at Graveyard Team 2, Show revival graphics
 
Level 2
Joined
May 21, 2012
Messages
31
Btw. your trigger leaks point (Center of (Region))

Yeah, I haven't finished that part.

@mortar

<3 again you help me with things that are way too easy. :ogre_hurrhurr: I need to learn to pay more attention to simple things.

(edit:eek:h boy need to spread some rep)
 
Status
Not open for further replies.
Top