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

[Trigger] Hero Revival Trigger

Status
Not open for further replies.
Level 15
Joined
Sep 3, 2006
Messages
1,738
Okay, so I have a trigger to revive heroes after they die in their respective base. The only problem is that it only revives Player 1 (Red)'s hero. Also, if a hero dies while Player 1 (Red)'s hero is dead, when Player 1 (Red)'s hero revives, so will the other dead hero.

  • Revive Hero
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Unit Group - Add (Triggering unit) to RevivableHeroes
      • Set TempReal = (((Real((Hero level of (Triggering unit)))) x Hero_Revive_Time_Factor) + 5.00)
      • Countdown Timer - Start ReviveTimers[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in TempReal seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title (Name of (Owner of (Triggering unit)))
      • Countdown Timer - Show (Last created timer window) for (Owner of (Triggering unit))
      • Set RevivableTimersWindows[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
  • Revive Hero Timer
    • Events
      • Time - ReviveTimers[1] expires
      • Time - ReviveTimers[2] expires
      • Time - ReviveTimers[3] expires
      • Time - ReviveTimers[4] expires
      • Time - ReviveTimers[5] expires
      • Time - ReviveTimers[6] expires
      • Time - ReviveTimers[7] expires
      • Time - ReviveTimers[8] expires
      • Time - ReviveTimers[11] expires
      • Time - ReviveTimers[12] expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in RevivableHeroes and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for ReviveTimers[(Player number of (Owner of (Picked unit)))]) Less than 1.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is in PlayersHuman) Equal to True
                • Then - Actions
                  • Hero - Instantly revive (Picked unit) at (Center of HumanRevive <gen>), Show revival graphics
                  • Countdown Timer - Destroy RevivableTimersWindows[(Player number of (Owner of (Picked unit)))]
                  • Unit Group - Remove (Picked unit) from RevivableHeroes
                • Else - Actions
                  • Hero - Instantly revive (Picked unit) at (Center of OrcRevive <gen>), Show revival graphics
                  • Countdown Timer - Destroy RevivableTimersWindows[(Player number of (Owner of (Picked unit)))]
                  • Unit Group - Remove (Picked unit) from RevivableHeroes
            • Else - Actions
 
Last edited:
Level 5
Joined
Jan 15, 2007
Messages
199
First, for the events in the first trigger, make it Unit - A Unit Dies

Second, use Triggering Unit instead of Dying unit for the first trigger

Third, are you sure the other players are in the Force 'PlayerHuman'?

And, remove the unit from the group after you revive them.
 
Level 15
Joined
Sep 3, 2006
Messages
1,738
Okay, the same problem still occurs. Here's what I have in the trigger now:

  • Revive Hero
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Unit Group - Add (Triggering unit) to RevivableHeroes
      • Set TempReal = (((Real((Hero level of (Triggering unit)))) x Hero_Revive_Time_Factor) + 5.00)
      • Countdown Timer - Start ReviveTimers[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in TempReal seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title (Name of (Owner of (Triggering unit)))
      • Countdown Timer - Show (Last created timer window) for (Owner of (Triggering unit))
      • Set RevivableTimersWindows[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
  • Revive Hero Timer
    • Events
      • Time - ReviveTimers[1] expires
      • Time - ReviveTimers[2] expires
      • Time - ReviveTimers[3] expires
      • Time - ReviveTimers[4] expires
      • Time - ReviveTimers[5] expires
      • Time - ReviveTimers[6] expires
      • Time - ReviveTimers[7] expires
      • Time - ReviveTimers[8] expires
      • Time - ReviveTimers[11] expires
      • Time - ReviveTimers[12] expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in RevivableHeroes and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for ReviveTimers[(Player number of (Owner of (Picked unit)))]) Less than 1.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is in PlayersHuman) Equal to True
                • Then - Actions
                  • Hero - Instantly revive (Picked unit) at (Center of HumanRevive <gen>), Show revival graphics
                  • Countdown Timer - Destroy RevivableTimersWindows[(Player number of (Owner of (Picked unit)))]
                  • Unit Group - Remove (Picked unit) from RevivableHeroes
                • Else - Actions
                  • Hero - Instantly revive (Picked unit) at (Center of OrcRevive <gen>), Show revival graphics
                  • Countdown Timer - Destroy RevivableTimersWindows[(Player number of (Owner of (Picked unit)))]
                  • Unit Group - Remove (Picked unit) from RevivableHeroes
            • Else - Actions
And for the Unit Group thing:

  • Player Setup
    • Events
    • Conditions
    • Actions
      • Player Group - Add Player 1 (Red) to PlayersHuman
      • Player Group - Add Player 3 (Teal) to PlayersHuman
      • Player Group - Add Player 5 (Yellow) to PlayersHuman
      • Player Group - Add Player 7 (Green) to PlayersHuman
      • Player Group - Add Player 11 (Dark Green) to PlayersHuman
      • Player Group - Add Player 2 (Blue) to PlayersOrc
      • Player Group - Add Player 4 (Purple) to PlayersOrc
      • Player Group - Add Player 6 (Orange) to PlayersOrc
      • Player Group - Add Player 8 (Pink) to PlayersOrc
      • Player Group - Add Player 12 (Brown) to PlayersOrc
Which is run on Initialization.

  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Turn Gives bounty On for (Picked player)
      • Quest - Create a Required quest titled Credits with the description Ma-Chao. Chaos.Dud..., using icon path ReplaceableTextures\WorldEditUI\Editor-ItemSet.blp
      • Quest - Create a Optional quest titled Games Modes with the description Games Modes and wha..., using icon path ReplaceableTextures\CommandButtons\BTNAcorn.blp
      • Quest - Create a Optional quest titled Commands with the description Games Commands and ..., using icon path ReplaceableTextures\CommandButtons\BTNBox.blp
      • Set End_Game_If_All_Gone = False
      • Set Hero_Revive_Time_Factor = 3.00
      • Set Player_Starting_Gold = 700
      • Set Repick_Cost_Ammount = -150
      • Set Sort_Board_By_Kills = False
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add Player_Starting_Gold to (Picked player) Current gold
      • Game - Set the time of day to 8.00
      • Trigger - Run Player Colors <gen> (ignoring conditions)
      • Trigger - Run Player Setup <gen> (ignoring conditions)
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
Why don't you use a different timer for every hero and revive them when their timer expires? Well, it would still be a little long and ineffective in gui, but better than this.
By the way (Dying unit) is always slower than (Triggering Unit). Triggering unit is always faster than any of its counterparts.
 
Level 3
Joined
Jun 23, 2007
Messages
32
the timer window you create is different from the one dota uses..

the one in dota goes underneath the multiboard, and only displays interegers.

does anyone know what this is called ???
 
Status
Not open for further replies.
Top