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

Hero Revive Trigger(With a Timer)

Status
Not open for further replies.
Level 1
Joined
May 24, 2009
Messages
2
Well my problem is I made a trigger to revive a hero after 15 seconds and to provide a timer in the top right corner when it is reviving...

  • Hero Revive
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Countdown Timer - Start Timer as a One-shot timer that will expire in 15.00 seconds
      • Countdown Timer - Create a timer window for Timer with title (Name of (Owner of (Dying unit)))
      • Set TimerWIN = (Last created timer window)
      • Countdown Timer - Hide TimerWIN for (Owner of (Dying unit))
      • Wait 15.00 seconds
      • Custom script: call TimerDialogDisplayBJ( false, udg_TimerWIN)
      • Custom script: call DestroyTimerDialogBJ( udg_TimerWIN)
      • Set Point = (Random point in (Playable map area))
      • Hero - Instantly revive (Dying unit) at (Random point in (Playable map area)), Show revival graphics
      • Camera - Pan camera for (Picked player) to (Position of (Reviving Hero)) over 0.00 seconds
      • Custom script: call RemoveLocation(udg_Point)
This is my trigger but for some reason it only shows a timer when a certain player dies. . .
 
Level 6
Joined
Aug 19, 2006
Messages
187
your problem is the 15 second wait. if another unit dies within the 15 seconds it will become the "new" dying unit and will be revived and not the first unit. you must create a global unit variable and name it tempunit or something like that.


  • Hero Revive
  • Events
  • Unit - A unit Dies
  • Conditions
  • ((Dying unit) is A Hero) Equal to True
  • Actions
  • Custom script: local unit tempunit
  • set tempunit = (Dying Unit)
  • Countdown Timer - Start Timer as a One-shot timer that will expire in 15.00 seconds
  • Countdown Timer - Create a timer window for Timer with title (Name of (Owner of (tempunit)))
  • Set TimerWIN = (Last created timer window)
  • Countdown Timer - Hide TimerWIN for (Owner of (tempunit))
  • Wait 15.00 seconds
  • Custom script: call TimerDialogDisplayBJ( false, udg_TimerWIN)
  • Custom script: call DestroyTimerDialogBJ( udg_TimerWIN)
  • Set Point = (Random point in (Playable map area))
  • Hero - Instantly revive tempunit at udg_Point, Show revival graphics
  • Camera - Pan camera for (Picked player) to (Position of (tempunit)) over 0.00 seconds
  • Custom script: call RemoveLocation(udg_Point)
  • Custom script: set tempunit = null
there are also some other things that could be improved but this should at least solve your problem
 
Status
Not open for further replies.
Top