- Joined
- Jan 12, 2014
- Messages
- 64
Hi Everyone , im searching for a good trigger for hero respawn like dota .
If this is fine for you. Easy to change seconds.
- 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
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?
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.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.
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:
lastly, I do know that you shoulddestroy it with this to avoid memory leaks:
- Countdown Timer - Show (Last created timer window) for (Picked Player)
But just store the Last Created Timer Window into a variable which is better.
- Custom script: call DestroyForce(udg_>>>Variable of the AllPlayer<<<)
EDIT: You need to show it first with a timer window by Show Timer trigger.