• 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.

[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
628
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,255
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