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

Status
Not open for further replies.
Level 6
Joined
Nov 14, 2007
Messages
155
For those who need a hero respawn trigger:

Variables used:
Hero_Respawn_Timer = Timer

  • Hero Respawn
    • Events
      • Unit - A unit owned by (Player) Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set Hero_Respawn_Timer = (Last started timer)
      • Countdown Timer - Start Hero_Respawn_Timer as a One-shot timer that will expire in (You can set this as integer by real conversion) seconds
      • Countdown Timer - Create a timer window for Hero_Respawn_Timer with title (Title for Respawn)
      • Wait (((Real((Level of (Dying unit)))) x 2.00) + 5.00) seconds
      • Hero - Instantly revive (Dying unit) at (Region), Hide revival graphics
      • Camera - Pan camera for (Owner of (Dying unit)) to (Region) over 0.00 seconds
      • Countdown Timer - Destroy (Last created timer window)
If you don't want any Timer window, don't add one


Rep is one click away... :thumbs_up:
 
Level 4
Joined
Sep 27, 2009
Messages
119
Well submitting a resource - or trigger in this case would belong in the Submissions forum, however if you are looking to improve this trigger then it is in the right place. As far as TSA - I'm pretty new here and thats the first time I've heard of that so I couldn't tell you.
 
Level 6
Joined
Nov 14, 2007
Messages
155
Well submitting a resource - or trigger in this case would belong in the Submissions forum, however if you are looking to improve this trigger then it is in the right place. As far as TSA - I'm pretty new here and thats the first time I've heard of that so I couldn't tell you.

oh sorry.. better head to the submissions... it went out my mind :eekani:
 
TSA - TriggerSleepAction in JASS for GUI TSA=WAIT... this will cause errors for your trigger if many heroes die, (trigger is not MUI) If you remove the timer window you can make this MUI by just using TriggeringUnit instead of dying unit... and also your system will bug because you use DyingUnit after a wait, basically only the triggering unit gets remembered after a wait...
 
Level 4
Joined
Sep 27, 2009
Messages
119
TSA - TriggerSleepAction in JASS for GUI TSA=WAIT... this will cause errors for your trigger if many heroes die, (trigger is not MUI) If you remove the timer window you can make this MUI by just using TriggeringUnit instead of dying unit... and also your system will bug because you use DyingUnit after a wait, basically only the triggering unit gets remembered after a wait...

Ah the good old wait - I've had a number of problems with it myself, guess I'm an unlucky guy.

For those who need a hero respawn trigger:

Variables used:
Hero_Respawn_Timer = Timer

  • Hero Respawn
    • Events
      • Unit - A unit owned by (Player) Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set Hero_Respawn_Timer = (Last started timer)
      • Countdown Timer - Start Hero_Respawn_Timer as a One-shot timer that will expire in (You can set this as integer by real conversion) seconds
      • Countdown Timer - Create a timer window for Hero_Respawn_Timer with title (Title for Respawn)
      • Wait (((Real((Level of (Dying unit)))) x 2.00) + 5.00) seconds
      • Hero - Instantly revive (Dying unit) at (Region), Hide revival graphics
      • Camera - Pan camera for (Owner of (Dying unit)) to (Region) over 0.00 seconds
      • Countdown Timer - Destroy (Last created timer window)
If you don't want any Timer window, don't add one


Rep is one click away... :thumbs_up:

Maybe try making your trigger like this without the wait.

  • Hero Respawn
    • Events
      • Unit - A unit owned by (Player) Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set Hero_Respawn_Timer = (Last started timer)
      • Countdown Timer - Start Hero_Respawn_Timer as a One-shot timer that will expire in (Wait (((Real((Level of (Dying unit)))) x 2.00) + 5.00) seconds) seconds
      • Countdown Timer - Create a timer window for Hero_Respawn_Timer with title (Title for Respawn)
      • If/Then/Else, Multiple Functions:
        • If - Conditions:
          • (Integer((Remaing time for (Last Started Timer)))) Equal to 0
        • Then - Actions:
          • Hero - Instantly revive (Dying unit) at (Region), Hide revival graphics
          • Camera - Pan camera for (Owner of (Dying unit)) to (Region) over 0.00 seconds
          • Countdown Timer - Destroy (Last created timer window)
        • Else - Actions:
          • Do nothing
 
Level 6
Joined
Nov 14, 2007
Messages
155
Ah the good old wait - I've had a number of problems with it myself, guess I'm an unlucky guy.



Maybe try making your trigger like this without the wait.

  • Hero Respawn
    • Events
      • Unit - A unit owned by (Player) Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set Hero_Respawn_Timer = (Last started timer)
      • Countdown Timer - Start Hero_Respawn_Timer as a One-shot timer that will expire in (Wait (((Real((Level of (Dying unit)))) x 2.00) + 5.00) seconds) seconds
      • Countdown Timer - Create a timer window for Hero_Respawn_Timer with title (Title for Respawn)
      • If/Then/Else, Multiple Functions:
        • If - Conditions:
          • (Integer((Remaing time for (Last Started Timer)))) Equal to 0
        • Then - Actions:
          • Hero - Instantly revive (Dying unit) at (Region), Hide revival graphics
          • Camera - Pan camera for (Owner of (Dying unit)) to (Region) over 0.00 seconds
          • Countdown Timer - Destroy (Last created timer window)
        • Else - Actions:
          • Do nothing



I know...
 
Status
Not open for further replies.
Top