• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

respawning heroes in a certain place in a set time after they die

Status
Not open for further replies.
Level 6
Joined
Jul 13, 2007
Messages
173
:sad: im making a map like angel arena but i have a problem with my map when the players chose a hero they teleport to a place in middle like in angel arena and fights there but when they die i need a place where they got respawned automaticely after a specific time plz help me :sad:
 
Level 3
Joined
Dec 16, 2007
Messages
46
Code:
Respawn
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Dying unit)) Equal to <enemy>
    Actions
        Wait <The wait time> Seconds
        Hero - Instantly revive (Dying unit) at (Center of (<your region>)), Show revival graphics
There ya go.
 
  • Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Equal to <enemy>
    • Actions
      • Wait <The wait time> Seconds
      • Hero - Instantly revive (Dying unit) at (Center of (<your region>)), Show revival graphics
Zathrak: i just copy paste, and trigger tah so he could undarstand better(yea this trigger should work)

edit:
  • Conditions
    • (Owner of (Dying unit)) Equal to <enemy>(of player blue)
  • (Owner of (Dying unit)) Equal to <enemy>(of player (dunno green)
just make a player on oposite site in condition, you neeed two triggers for that its same onl with other condition(player) and with another region.
 
Respawn is annoying!
Unlike most other triggers, respawn can get increadibly annoying because you need 12-13 triggers for it. You see, if you were to write a trigger like this:
  • Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Dying unit) is A Hero) Equal to True
          • (Owner of (Dying unit)) Not equal to Neutral Hostile
    • Actions
      • Wait 20.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) belongs to an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Hero - Instantly revive (Dying unit) at (Center of T1 Respawn <gen>), Show revival graphics
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) belongs to an ally of Player 7 (Green)) Equal to True
        • Then - Actions
          • Hero - Instantly revive (Dying unit) at (Center of T2 Respawn <gen>), Show revival graphics
        • Else - Actions
Then if anyother hero were to die inside that 20 seconds, then the trigger would be void.

So basicly, you need 12 triggers like this:
  • Respawn P1
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Dying unit) is A Hero) Equal to True
          • (Owner of (Dying unit)) Not equal to Player 1 (Red)
    • Actions
      • Wait 20.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) belongs to an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Hero - Instantly revive (Dying unit) at (Center of T1 Respawn <gen>), Show revival graphics
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) belongs to an ally of Player 7 (Green)) Equal to True
        • Then - Actions
          • Hero - Instantly revive (Dying unit) at (Center of T2 Respawn <gen>), Show revival graphics
        • Else - Actions
  • Respawn P2
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Dying unit) is A Hero) Equal to True
          • (Owner of (Dying unit)) Not equal to Player 2 (Blue)
    • Actions
      • Wait 20.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) belongs to an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Hero - Instantly revive (Dying unit) at (Center of T1 Respawn <gen>), Show revival graphics
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) belongs to an ally of Player 7 (Green)) Equal to True
        • Then - Actions
          • Hero - Instantly revive (Dying unit) at (Center of T2 Respawn <gen>), Show revival graphics
        • Else - Actions
ect...
 
  • Revive Sentinel
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • ((Owner of (Dying unit)) is an ally of Player 1 (Red)) Equal to True
    • Actions
      • Set DeadHero[1] = (Dying unit)
      • Wait 5.00 seconds
      • Hero - Instantly revive DeadHero[1] at (Center of Region 007 <gen>), Show revival graphics
      • Camera - Pan camera for (Owner of (Dying unit)) to (Center of Region 007 <gen>) over 0.60 seconds
i know variable is like wtf...
i use this trigger on my aos and it works fine
 
About the if/then/else. See, there is this thing about GUI, where all of the trigger has to run all the way through before it runs again or the first trigger will be lost and wont have an effect. I'm not sure why this is, but it is very annoying. Anyway, if you make 12 if/then/else actions, then if another hero dies within the wait, then the first hero wont be revived, ruining gameplay.

Even if you use Countdown Timers, then you need an additional trigger.
Respawn is a pain.
 
Level 3
Joined
Feb 24, 2008
Messages
67
I can shorten that bunch of codes but it needs declaration of variables first of the regions in another trigger, probably initiated through map initialization or other events. Use arrays. :wink:

I can't help now as I'm nowhere near a World Editor now.... I'll get back to it as soon as i can

EDIT: Awww... inverted beat me to it...
 
Last edited:
Level 10
Joined
Feb 8, 2008
Messages
432
This is what i use in my map, hope it helps. And no you don't need 12 triggers. Just make 1 short one like this. RedHero, BlueHero, TealHero, and PurpleHero were all asigned when heroes were bought at the beginning of the map. (This is the version with all of the countdown timers for eye candy)
  • Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Dying unit)) slot status) Equal to Is playing
      • Or - Any (Conditions) are true
        • Conditions
          • (Dying unit) Equal to Red_Hero
          • (Dying unit) Equal to Purple_Hero
          • (Dying unit) Equal to Blue_Hero
          • (Dying unit) Equal to Teal_Hero
    • Actions
      • Countdown Timer - Create a timer window for Respawn_Timer[(Player number of (Owner of (Dying unit)))] with title Respawn:
      • Set Respawn_Timer_window[(Player number of (Owner of (Dying unit)))] = (Last created timer window)
      • Countdown Timer - Start Respawn_Timer[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in (10.00 + ((Real(Hero_level[(Player number of (Owner of (Dying unit)))])) x 2.50)) seconds
      • Countdown Timer - Hide Respawn_Timer_window[(Player number of (Owner of (Dying unit)))]
      • Countdown Timer - Show Respawn_Timer_window[(Player number of (Owner of (Dying unit)))] for (Owner of (Dying unit))
      • Countdown Timer - Destroy Shop_Exile_Win[(Player number of (Owner of (Triggering unit)))]
      • Wait (10.00 + ((Real(Hero_level[(Player number of (Owner of (Dying unit)))])) x 2.50)) seconds
      • Hero - Instantly revive (Dying unit) at (Center of Shops <gen>), Hide revival graphics
      • Countdown Timer - Destroy Respawn_Timer_window[(Player number of (Owner of (Dying unit)))]
Simple Version:
  • Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Dying unit)) slot status) Equal to Is playing
    • Actions
      • Wait (10.00 + ((Real(Hero_level[(Player number of (Owner of (Dying unit)))])) x 2.50)) seconds
      • Hero - Instantly revive (Dying unit) at (Center of Shops <gen>), Hide revival graphics
Its not complicated at all... and it has a growing respawn time based off of the heroes level.
 
Status
Not open for further replies.
Top