System Revive Heroes in Hero Arena

BornANoob[MR]

Member
Reaction score
21
This is the second part of my Hero Arena tutorial, for this you will only need 2 variables, called DeadHeroTimerWindow, it's a timer window array. Aswell as DeadHeroCountdown, which is a timer array (size 13) with an initial value of New Timer (default).

Code:
Revive Hero
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
        ((Owner of (Triggering unit)) Is playing) Equal to True
    Actions
        Game - Display to (Player group((Owner of (Triggering unit)))) the text: Your hero will be r...
        Game - Display to (All enemies of (Owner of (Triggering unit))) the text: (|cffffcc00 + ((Name of (Owner of (Triggering unit))) + |r died.))
        Countdown Timer - Create a timer window for DeadHeroCountdown[(Player number of (Owner of (Triggering unit)))] with title (Name of (Owner of (Triggering unit)))
        Countdown Timer - Show (Last created timer window)
        Set DeadHeroTimerWindow[(Player number of (Triggering player))] = (Last created timer window)
        Countdown Timer - Start DeadHeroCountdown[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 30.00 seconds
        Wait 30.00 seconds
        Countdown Timer - Destroy DeadHeroTimerWindow[(Player number of (Triggering player))]
        Hero - Instantly revive (Triggering unit) at (Wherever), Show revival graphics

This will tell the players you have died, as well as giving you a message that you will revive soon, it then creates a timer window to show time remaining (30 seconds) then it will revive you hero at desired respawn location. (see 'Whatever') You can choose to show or hide the revival graphics.

Hope this helps.
 

Nestharus

o-o
Reaction score
84
4/10

It's just.. bad programming ;p

all of this
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) Equal to True
Playing Equal to True
Or - Any (Conditions) are true
Conditions
(Owner of (Dying unit)) Equal to Player 1 (Red)
(Owner of (Dying unit)) Equal to Player 2 (Blue)
(Owner of (Dying unit)) Equal to Player 3 (Teal)
(Owner of (Dying unit)) Equal to Player 4 (Purple)
(Owner of (Dying unit)) Equal to Player 5 (Yellow)
(Owner of (Dying unit)) Equal to Player 6 (Orange)
(Owner of (Dying unit)) Equal to Player 7 (Green)
(Owner of (Dying unit)) Equal to Player 8 (Pink)
(Owner of (Dying unit)) Equal to Player 9 (Gray)
(Owner of (Dying unit)) Equal to Player 10 (Light Blue)
(Owner of (Dying unit)) Equal to Player 11 (Dark Green)
(Owner of (Dying unit)) Equal to Player 12 (Brown)
is = to ><
 

Nestharus

o-o
Reaction score
84
All of those lines of code, which would be maybe... 18 lines when converted..

18 lines could be done in 4 lines of code

that's what I said

lol

You don't need any of the conditions, period.

You need to cycle thru the players and add them as events to the trigger in question.

for each integer A from 1 - 12
Trigger - Add New Event to herorevival a unit owned by player[A] dies

That'd be 4 lines of code up there

Also, Don't Use Wait Ever

^_^

All done : P
 

BornANoob[MR]

Member
Reaction score
21
Ok...

All i was doing though was making a VERY SIMPLE guide of how to do it, which works for its intended purpose, it doesn't matter if its not perfect, its for inexperienced users, since reviving is relatively easy for most of thehelper community, who i consider adept users.
 

Magazette2

New Member
Reaction score
3
why cant conditions just be triggering unit is a hero equal to true, because uv listed all players? i dont play hero arenas so i dont know whether u need a specific place to respawn or whatever
 

BornANoob[MR]

Member
Reaction score
21
I basically put it in their to cover all eventualities, in case there was Neutral passive/hostile heroes in the game that could be killed like in custom hero arena.
 

Exide

I am amazingly focused right now!
Reaction score
448
Did you test this trigger?
Try killing several heroes at once, a few owned by you and a few on different teams.
 

Sooda

Diversity enchants
Reaction score
318
That is example how it should ever not to be done. It can easily malfunction because you don' t keep dieing heroes separately in different variables. Each new death will add higher % to just fail.
 

Nestharus

o-o
Reaction score
84
It'll work just fine -.-

It won't malfunction

I'm a really good programmer, I should know. Honestly, the only thign wrong with it is what I said above

In a way, yes you are right, this is how it should never be done

It's like an example of what not to do because of all of those wasted lines.

The other way is still basic, why not just get rid of all of those lines and do what I said above. It'll make it so much better ^_^
 

Sim

Forum Administrator
Staff member
Reaction score
534
This is a system, not a tutorial.

> Playing Equal to True

You might want to change that to "((Owner of (Triggering unit)) Is playing) Equal to True" or something like that.
 

esb

Because none of us are as cruel as all of us.
Reaction score
329
Waits do mess up triggering units... but if you have a timer, why do you need a wait? Can't you make it timer expires?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top