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

[Solved] Revive heroes problem

Status
Not open for further replies.
Level 4
Joined
Sep 11, 2018
Messages
74
This doesn't seem to work. Any idea why?
  • Resurrect
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • For each (Integer number[5]) from 1 to 2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to protagonist[number[5]]
            • Then - Actions
              • Set templocations[1] = (Center of herorevive1 <gen>)
              • Wait 10.00 seconds
              • Hero - Instantly revive protagonist[number[5]] at templocations[1], Show revival graphics
              • Custom script: call RemoveLocation(udg_templocations[1])
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to villain[number[5]]
            • Then - Actions
              • Set templocations[2] = (Center of herorevive2 <gen>)
              • Wait 10.00 seconds
              • Hero - Instantly revive villain[number[5]] at templocations[2], Show revival graphics
              • Custom script: call RemoveLocation(udg_templocations[2])
            • Else - Actions
 
Level 11
Joined
Jul 4, 2016
Messages
627
If you still want to use waits for whatever reason, you need to put the wait and all the actions after the wait into a separate trigger then run that trigger in the loop.
 
Level 4
Joined
Sep 11, 2018
Messages
74
It works. The wait just placed wrongly. Thanks anyway.
  • Resurrect
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Wait 10.00 seconds
      • For each (Integer number[5]) from 1 to 2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to protagonist[number[5]]
            • Then - Actions
              • Set templocations[1] = (Center of herorevive1 <gen>)
              • Hero - Instantly revive protagonist[number[5]] at templocations[1], Show revival graphics
              • Custom script: call RemoveLocation(udg_templocations[1])
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to villain[number[5]]
            • Then - Actions
              • Set templocations[2] = (Center of herorevive2 <gen>)
              • Hero - Instantly revive villain[number[5]] at templocations[2], Show revival graphics
              • Custom script: call RemoveLocation(udg_templocations[2])
            • Else - Actions
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Wait is inappropriate for this. It is based on real time and not game time. So for example if the hero were to die and then a player suffers lag, then the hero might revive during the lag dialog and result in bugged vision.

This is why one should rather use a timer. Timers work by game time.
 
Status
Not open for further replies.
Top