• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Team resurrection trigger?

Status
Not open for further replies.
Level 1
Joined
Jun 18, 2014
Messages
3
Hi folks!
How can I make a trigger to make all heroes resurrect together at a certain point, so when everybody died?
Of course, it must happen when the last hero alive dies.
Thank you!
 
Level 1
Joined
Jun 18, 2014
Messages
3
Put the heroes of each team into a unit group each.
Hero_Group_1
Hero_Group_2

When a unit dies you check which group it belongs to.
Then you check if any of the units in that group are alive.
If not, then you resurrect them all at your location.

Thanks for the reply, but the resurrection must be automatic. (like: all heroes on the map are died, revive all died heroes at X location)

I would go with a counter.

1. Set your Counter to number of heroes in the team.
2. When a hero dies you decrement the Counter by 1.
3. If the Counter reaches 0, then revive all heroes and reset the counter again.

Gonna try this!
 
Last edited by a moderator:
I'd actually go with a combination of the proposed methods. I'd place the dying hero in a Unit Group and count how many there are, but first I would check whether the owning player is a User and Is Playing (Controller and Slot status comparisons respectively, under Conditions). If the number of the units in the group is equal to number of active players in the team, pick every unit in the group, remove them from it and resurrect them.

This doesn't imply that my method is better than the suggested ones, this is merely how I'd do it.
 
I'd actually go with a combination of the proposed methods. I'd place the dying hero in a Unit Group and count how many there are, but first I would check whether the owning player is a User and Is Playing (Controller and Slot status comparisons, under Conditions). If the number of the units in the group is equal to number of active players in the team, pick every unit in the group, remove them from it and resurrect them.

This doesn't imply that my method is better than the suggested ones, this is merely how I'd do it.

Come to think of it. IcemanBo's and my suggestion was kinda the same. But an integer count is probably the better choice. which death time and all.

And yeah Pharaoh_
More conditions are needed to ensure the correct units are counted.
 
Come to think of it. IcemanBo's and my suggestion was kinda the same. But an integer count is probably the better choice. which death time and all.

And yeah Pharaoh_
More conditions are needed to ensure the correct units are counted.

As I said, it's not necessarily better. It's just that counting units serves the same purpose as increasing an integer variable.
 
Level 13
Joined
Jul 16, 2012
Messages
679
so if icemanbo and solu said

Triggers
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- So Intialize your Counter.. --------
      • For each (Integer Temp_X) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(Temp_X)) slot status) Equal to Is playing
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Temp_X Less than or equal to 6
                • Then - Actions
                  • Set Counter_A = (Counter_A + 1)
                • Else - Actions
                  • Set Counter_B = (Counter_B + 1)
            • Else - Actions
      • Set C_A = Counter_A
      • Set C_B = Counter_B
      • Custom script: set udg_Loop = 0.03125
      • Trigger - Add to Untitled Trigger 003 <gen> the event (Time - Every Loop seconds of game time)
      • Custom script: call DestroyTrigger( GetTriggeringTrigger())
  • Untitled Trigger 002
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Triggering unit)) slot status) Equal to Is playing
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Counter_A Equal to C_A
          • Counter_B Equal to C_B
        • Then - Actions
          • Trigger - Turn on Untitled Trigger 003 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player number of (Owner of (Triggering unit))) Less than or equal to 6
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Counter_A Less than 1
            • Then - Actions
              • Set Counter_A = 1
            • Else - Actions
              • Set Counter_A = (Counter_A - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Triggering unit) is in Group_A) Equal to True
                • Then - Actions
                • Else - Actions
                  • Unit Group - Add (Triggering unit) to Group_A
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Counter_B Less than 1
            • Then - Actions
              • Set Counter_B = 1
            • Else - Actions
              • Set Counter_B = (Counter_B - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Triggering unit) is in Group_B) Equal to True
                • Then - Actions
                • Else - Actions
                  • Unit Group - Add (Triggering unit) to Group_B
  • Untitled Trigger 003
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Counter_A Equal to 0
          • Counter_B Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Counter_A Less than or equal to 1
            • Then - Actions
              • Set Counter_A = C_A
              • Unit Group - Pick every unit in Group_A and do (Actions)
                • Loop - Actions
                  • Set TempUnit_A = (Picked unit)
                  • Set TempPoint_A = (Center of (Playable map area))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Owner of TempUnit_A) slot status) Equal to Is playing
                    • Then - Actions
                      • Hero - Instantly revive TempUnit_A at TempPoint_A, Show revival graphics
                    • Else - Actions
                  • Unit Group - Remove TempUnit_A from Group_A
                  • Custom script: call RemoveLocation( udg_TempPoint_A)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Counter_B Less than or equal to 1
            • Then - Actions
              • Set Counter_B = C_B
              • Unit Group - Pick every unit in Group_B and do (Actions)
                • Loop - Actions
                  • Set TempUnit_B = (Picked unit)
                  • Set TempPoint_B = (Center of (Playable map area))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Owner of TempUnit_B) slot status) Equal to Is playing
                    • Then - Actions
                      • Hero - Instantly revive TempUnit_B at TempPoint_B, Show revival graphics
                    • Else - Actions
                  • Unit Group - Remove TempUnit_B from Group_B
                  • Custom script: call RemoveLocation( udg_TempPoint_B)
            • Else - Actions
EDIT 2:

So here Ricirich91,

Description:
When the the last hero alive, all allied hero will be revive

So, if all hero dies, dont worry, it will be revive that :)
 
Last edited:
@AKA.GywGod133

  • Temp_X Equal to 1
  • Temp_X Equal to 2
  • Temp_X Equal to 3
  • Temp_X Equal to 4
  • Temp_X Equal to 5
  • Temp_X Equal to 6
-->
  • (Temp_X < 7)
...^Same method with:
  • (Owner of (Triggering unit)) Equal to Player 1 (Red)
  • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
  • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
  • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
  • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
  • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
This condition:
  • (Counter_A Equal to 0)
should be this:
  • (Counter_A Equal to 1)
Because you decrease the counter only after the check.

Then you directly can do the revive actions instead of running a new trigger.

RevivePoint could be static. ReviveGroup is also always the same, so you can set it once and then only remve hero from it when the player leaves game.
 
Level 13
Joined
Jul 16, 2012
Messages
679
@AKA.GywGod133

  • Temp_X Equal to 1
  • Temp_X Equal to 2
  • Temp_X Equal to 3
  • Temp_X Equal to 4
  • Temp_X Equal to 5
  • Temp_X Equal to 6
-->
  • (Temp_X < 7)
...^Same method with:
  • (Owner of (Triggering unit)) Equal to Player 1 (Red)
  • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
  • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
  • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
  • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
  • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
@IcemanBo
(Temp_X < 7) same in 2nd

its better if you do this but, if the user for ex
the Neutral Player is Player 4 but you set (Temp_X < 7) this

maybe its not good :/

but you said its better

In Counter_A and B (Fixed)

In ReviveGroup A and B (Fixed)
You said, if the one player leave, remove the hero in group so I added

@Ricirich91
I update my post
 
Status
Not open for further replies.
Top