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

Respawn

Status
Not open for further replies.
Level 5
Joined
Jul 15, 2012
Messages
101
  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Countdown Timer - Create a timer window for (Last started timer) with title Respawn:
      • Countdown Timer - Start (Last started timer) as a One-shot timer that will expire in (Real(((Hero level of (Triggering unit)) x (3 + 10)))) seconds
      • Wait ((Real((Hero level of (Triggering unit)))) x (3.00 + 10.00)) seconds
      • Countdown Timer - Destroy (Last created timer window)
      • Hero - Instantly revive (Triggering unit) at (Center of Region<gen>), Show revival graphics
If this is fine for you. Easy to change seconds.
 
Level 5
Joined
Jul 15, 2012
Messages
101
Btw, it should be like that:

  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Countdown Timer - Create a timer window for (Last started timer) with title Respawn:
      • Countdown Timer - Start (Last started timer) as a One-shot timer that will expire in (10.00 + (3.00 x (Real((Hero level of (Triggering unit)))))) seconds
      • Wait (10.00 + (3.00 x (Real((Hero level of (Triggering unit)))))) seconds
      • Countdown Timer - Destroy (Last created timer window)
      • Hero - Instantly revive (Triggering unit) at (Center of Region <gen>), Show revival graphics
because if hero lvl is 1 = 1x(3+10) = 0:13 ; hero lvl is 10 = 10x(3+10) = 2:10
and now it's 10+(3xherolvl)=13 ; 10+(3x10)=40
 
Level 4
Joined
Jan 12, 2014
Messages
64
  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Countdown Timer - Create a timer window for (Last started timer) with title Respawn:
      • Countdown Timer - Start (Last started timer) as a One-shot timer that will expire in (Real(((Hero level of (Triggering unit)) x (3 + 10)))) seconds
      • Wait ((Real((Hero level of (Triggering unit)))) x (3.00 + 10.00)) seconds
      • Countdown Timer - Destroy (Last created timer window)
      • Hero - Instantly revive (Triggering unit) at (Center of Region<gen>), Show revival graphics
If this is fine for you. Easy to change seconds.

This trigger got some problem , when 2 or 3 hero die after each other don't destroy countdown timer ! , for this problem what can i do?
 

ILH

ILH

Model Reviewer
Level 26
Joined
May 8, 2012
Messages
1,233
This trigger got some problem , when 2 or 3 hero die after each other don't destroy countdown timer ! , for this problem what can i do?

It's not MUI.
  • Revive
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set writeindex = (writeindex + 1)
      • Countdown Timer - Start timer[writeindex] as a One-shot timer that will expire in 10.00 seconds
      • Countdown Timer - Create a timer window for timer[writeindex] with title (Name of (Owner of (Triggering unit)))
      • Set respawninghero[writeindex] = (Triggering unit)
      • Set timer[writeindex] = (Last started timer)
      • Wait 10.00 seconds
      • Set readindex = (readindex + 1)
      • Countdown Timer - Destroy timerwindow[readindex]
      • Hero - Instantly revive respawninghero[readindex] at (Center of (Playable map area)), Show revival graphics
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • readindex Equal to writeindex
        • Then - Actions
          • Set readindex = 0
          • Set writeindex = 0
        • Else - Actions
i store them up into variable, then use them later, it's more practical.
if there's problem, i'll fix them tommorow
 
Level 5
Joined
Jul 15, 2012
Messages
101
Btw, will this ->
  • Countdown Timer - Start (Last started timer) as a One-shot timer that will expire in X seconds
show to all players? I don't think it's good for his map if it is multiplayer.
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
As far as I know that will show for ALL players but if incase it wont, you can show it by picking all players (suggested to store All player into a variable trigger) then in the loop, place this:

  • Countdown Timer - Show (Last created timer window) for (Picked Player)
lastly, I do know that you shoulddestroy it with this to avoid memory leaks:
  • Custom script: call DestroyForce(udg_>>>Variable of the AllPlayer<<<)
But just store the Last Created Timer Window into a variable which is better.

EDIT: You need to show it first with a timer window by Show Timer trigger.
 
@Karr, wont show without a window.

Also guys, forget about waits or TriggerSleepAction in making respawn trigger. You need to use Timers for such task, so different heroes can revive at different times (unless you want heroes to revive in short amount of time and don't have different amount of time based on levels). If I recall it right, Dota uses timer, that's why it's pretty accurate.
 
Generally the the inaccuracy isn't a very big deal, because who cares if you respawm ~0.2 seconds later or earlier.

But if people are lagging online, then it get's problematic. Because the wait doesnt stop counting, while a player is lagging... but timers do so.

Also with using waits you can run easily into non-MUI problems like Karr123 did with destroying his timer.

So if you anyway use timers to display the respawn time, you also can use them for the respawn itself.. which would be better, as Daffa_the_Mage also suggested.

lastly, I do know that you shoulddestroy it with this to avoid memory leaks:
  • Custom script: call DestroyForce(udg_>>>Variable of the AllPlayer<<<)

Maybe I misunderstand Hell_Master a bit, but if you use "All Players" --> never destroy the force.. it doesnt leak, and if you would destroy All Players, the game may be bugged.
 
Level 4
Joined
Jan 12, 2014
Messages
64
As far as I know that will show for ALL players but if incase it wont, you can show it by picking all players (suggested to store All player into a variable trigger) then in the loop, place this:

  • Countdown Timer - Show (Last created timer window) for (Picked Player)
lastly, I do know that you shoulddestroy it with this to avoid memory leaks:
  • Custom script: call DestroyForce(udg_>>>Variable of the AllPlayer<<<)
But just store the Last Created Timer Window into a variable which is better.

EDIT: You need to show it first with a timer window by Show Timer trigger.
  • Revive
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Countdown Timer - Create a timer window for (Last started timer) with title Respawn:
      • Countdown Timer - Show (Last created timer window) for (Owner of (Triggering unit))
      • Countdown Timer - Start (Last started timer) as a One-shot timer that will expire in (Real(((Hero level of (Triggering unit)) + 15))) seconds
      • Wait (Real(((Hero level of (Triggering unit)) + 15))) seconds
      • Countdown Timer - Destroy (Last created timer window)
      • Hero - Instantly revive (Triggering unit) at (Center of RED Revive <gen>), Show revival graphics
i write like this but still have same problem .
 

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
I kinda caught the dung rolling, but isn't the problem related to the action after the wait destroying '(Last created timer window)'? After the wait, the window that was last created will be the one from the last hero that died, leaving all the other windows up and running.

You need to set the countdown timer to a variable if you want to do what you're doing, and use indexes (arrays) - I think that's what ILH suggested and made for you (I only gave this all a quick look.)

Also, as Daffa and Iceman suggested, you shouldn't use waits, because they're inaccurate and don't stop when the game is paused.
 
Status
Not open for further replies.
Top