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

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